acp

package module
v0.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 16, 2026 License: Apache-2.0 Imports: 14 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

go-acp

Go implementation of the Agent Client Protocol (ACP): JSON-RPC 2.0 over newline-delimited messages, with the protocol's types generated from the pinned schema in schema/ (1.31.0).

go get github.com/gfx-labs/go-acp
import acp "github.com/gfx-labs/go-acp"
  • NewAgentSideConnection(agent, w, r, logger): the agent's end. It calls your acp.Agent for each client request and its methods call the client.
  • NewClientSideConnection(client, w, r, logger): the client's end. It calls your acp.Client for agent requests and session/update, and its methods (Initialize, NewSession, LoadSession, Prompt, Cancel, ...) call the agent.
  • Serve(ctx) reads until the reader ends. Requests run on their own goroutine. Notifications and responses are handled in order, so session/update arrives in order. Arrival(ctx) gives a message's position in the read order, for ordering a session/cancel against prompts.
  • acptest drives an agent from a test with raw JSON lines.

Requires Go 1.27 (encoding/json/v2). Dependencies: valyala/bytebufferpool, and stretchr/testify in tests.

Generated code

The *_gen.go files come from internal/acpgen, a modified copy of the generator in coder/acp-go-sdk (Apache-2.0). Its README lists the changes. Regenerate after changing the schema or the generator:

go generate ./...

v2/ (package github.com/gfx-labs/go-acp/v2) is the same library generated from the draft ACP v2 schema in v2/schema/. v2 is a draft upstream, so its API can change in any release. See docs/notes/2026-11-14-v2-draft.md.

CI fails when the committed files differ from what the generator writes.

Origin

Extracted from pkg/acp in towa, with history. Design notes are in docs/notes/.

Check

go build ./... && go vet ./... && go test ./... && golangci-lint run ./...
(cd internal/acpgen && go vet ./... && go test ./...)

License

Apache-2.0.

Documentation

Overview

Package acp implements the Agent Client Protocol: JSON-RPC 2.0 over newline-delimited messages, with the protocol's types generated from the schema files in schema/.

The *_gen.go files come from internal/acpgen. Regenerate them with "go generate ." after changing the schema files or the generator.

Index

Constants

View Source
const (
	AgentMethodAuthStatus             = "auth/status"
	AgentMethodAuthenticate           = "authenticate"
	AgentMethodInitialize             = "initialize"
	AgentMethodLogout                 = "logout"
	AgentMethodMcpMessage             = "mcp/message"
	AgentMethodProvidersDisable       = "providers/disable"
	AgentMethodProvidersList          = "providers/list"
	AgentMethodProvidersSet           = "providers/set"
	AgentMethodSessionArchive         = "session/archive"
	AgentMethodSessionCancel          = "session/cancel"
	AgentMethodSessionClose           = "session/close"
	AgentMethodSessionDelete          = "session/delete"
	AgentMethodSessionFork            = "session/fork"
	AgentMethodSessionList            = "session/list"
	AgentMethodSessionLoad            = "session/load"
	AgentMethodSessionNew             = "session/new"
	AgentMethodSessionOptions         = "session/options"
	AgentMethodSessionPrompt          = "session/prompt"
	AgentMethodSessionResume          = "session/resume"
	AgentMethodSessionSetConfigOption = "session/set_config_option"
	AgentMethodSessionSetMode         = "session/set_mode"
	AgentMethodSessionSetTitle        = "session/set_title"
	AgentMethodSessionStatus          = "session/status"
	AgentMethodSessionUnarchive       = "session/unarchive"
)

Agent method names

View Source
const (
	ClientMethodAuthStatusUpdate         = "auth/status_update"
	ClientMethodElicitationComplete      = "elicitation/complete"
	ClientMethodElicitationCreate        = "elicitation/create"
	ClientMethodFsReadTextFile           = "fs/read_text_file"
	ClientMethodFsWriteTextFile          = "fs/write_text_file"
	ClientMethodMcpMessage               = "mcp/message"
	ClientMethodSessionRequestPermission = "session/request_permission"
	ClientMethodSessionUpdate            = "session/update"
	ClientMethodTerminalCreate           = "terminal/create"
	ClientMethodTerminalKill             = "terminal/kill"
	ClientMethodTerminalOutput           = "terminal/output"
	ClientMethodTerminalRelease          = "terminal/release"
	ClientMethodTerminalWaitForExit      = "terminal/wait_for_exit"
)

Client method names

View Source
const ProtocolVersionNumber = 1

ProtocolVersionNumber is the ACP protocol version these types are generated for.

Variables

View Source
var ErrClosed = errors.New("acp: connection closed")

ErrClosed is returned by calls on a connection whose reader has ended.

View Source
var ErrWaitInOrder = errors.New("acp: a handler that runs in order cannot wait for a response from the peer")

ErrWaitInOrder is returned when a request is sent with the context of a handler that runs in order: a notification handler, or the agent's initialize handler. Those run on the goroutine that runs Serve, which is the one that would deliver the response, so the call could never return. A handler that must call the peer starts a goroutine with a context of its own.

Functions

func AfterResponse

func AfterResponse(ctx context.Context, fn func()) bool

AfterResponse queues fn to run after the response to ctx's request has been written, in registration order, on the request handler's goroutine. It also runs after an error response or a failed write. Serve waits for the callbacks before returning. A callback must not block indefinitely. It reports false if fn is nil, ctx is not a request handler's context, or the response has already been written.

func Arrival

func Arrival(ctx context.Context) (uint64, bool)

Arrival returns the position of the inbound message that ctx's handler is handling, counted from 1 in the order the messages were read. Handlers of requests run concurrently, so a handler uses Arrival to order its request against other messages, for example a session/cancel against a prompt.

func SendRequest

func SendRequest[T any](ctx context.Context, c *Connection, method string, params any) (T, error)

SendRequest sends a request and waits for its response, decoded into T. When ctx ends first, it asks the peer to cancel the request and returns ctx's error without waiting for the peer's answer.

Types

type Agent

type Agent interface {
	// Request parameters for the authenticate method.
	//
	// Specifies which authentication method to use.
	Authenticate(ctx context.Context, params AuthenticateRequest) (AuthenticateResponse, error)
	// Request parameters for the initialize method.
	//
	// Sent by the client to establish connection and negotiate capabilities.
	//
	// See protocol docs: [Initialization](https://agentclientprotocol.com/protocol/v1/draft/initialization)
	Initialize(ctx context.Context, params InitializeRequest) (InitializeResponse, error)
	// Request parameters for the logout method.
	//
	// Terminates the current authenticated session.
	Logout(ctx context.Context, params LogoutRequest) (LogoutResponse, error)
	// Notification to cancel ongoing operations for a session.
	//
	// See protocol docs: [Cancellation](https://agentclientprotocol.com/protocol/v1/draft/prompt-turn#cancellation)
	Cancel(ctx context.Context, params CancelNotification) error
	// Request parameters for closing an active session.
	//
	// If supported, the agent **must** cancel any ongoing work related to the session
	// (treat it as if 'session/cancel' was called) and then free up any resources
	// associated with the session.
	//
	// Only available if the Agent supports the 'sessionCapabilities.close' capability.
	CloseSession(ctx context.Context, params CloseSessionRequest) (CloseSessionResponse, error)
	// Request parameters for deleting an existing session from 'session/list'.
	//
	// Only available if the Agent supports the 'sessionCapabilities.delete' capability.
	DeleteSession(ctx context.Context, params DeleteSessionRequest) (DeleteSessionResponse, error)
	// Request parameters for listing existing sessions.
	//
	// Only available if the Agent supports the 'sessionCapabilities.list' capability.
	ListSessions(ctx context.Context, params ListSessionsRequest) (ListSessionsResponse, error)
	// Request parameters for creating a new session.
	//
	// See protocol docs: [Creating a Session](https://agentclientprotocol.com/protocol/v1/draft/session-setup#creating-a-session)
	NewSession(ctx context.Context, params NewSessionRequest) (NewSessionResponse, error)
	// Request parameters for sending a user prompt to the agent.
	//
	// Contains the user's message and any additional context.
	//
	// See protocol docs: [User Message](https://agentclientprotocol.com/protocol/v1/draft/prompt-turn#1-user-message)
	Prompt(ctx context.Context, params PromptRequest) (PromptResponse, error)
	// Request parameters for resuming an existing session.
	//
	// Resumes an existing session without returning previous messages (unlike 'session/load').
	// This is useful for agents that can resume sessions but don't implement full session loading.
	//
	// Only available if the Agent supports the 'sessionCapabilities.resume' capability.
	ResumeSession(ctx context.Context, params ResumeSessionRequest) (ResumeSessionResponse, error)
	// Request parameters for setting a session configuration option.
	SetSessionConfigOption(ctx context.Context, params SetSessionConfigOptionRequest) (SetSessionConfigOptionResponse, error)
	// Request parameters for setting a session mode.
	SetSessionMode(ctx context.Context, params SetSessionModeRequest) (SetSessionModeResponse, error)
}

type AgentAuthCapabilities

type AgentAuthCapabilities struct {
	// The _meta property is reserved by ACP to allow clients and agents to attach additional
	// metadata to their interactions. Implementations MUST NOT make assumptions about values at
	// these keys.
	//
	// See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v1/draft/extensibility)
	Meta map[string]any `json:"_meta,omitempty"`
	// Whether the agent supports the logout method.
	//
	// Optional. Omitted or 'null' both mean the agent does not advertise support.
	// Supplying '{}' means the agent supports the logout method.
	Logout *LogoutCapabilities `json:"logout,omitzero"`
	// **UNSTABLE**
	//
	// This capability is not part of the spec yet, and may be removed or changed at any point.
	//
	// Whether the agent supports the 'auth/status' method.
	//
	// Optional. Omitted or 'null' both mean the agent does not advertise support.
	// Supplying '{}' means the agent supports the 'auth/status' method.
	Status *AuthStatusCapabilities `json:"status,omitzero"`
}

Authentication-related capabilities supported by the agent.

type AgentCapabilities

type AgentCapabilities struct {
	// The _meta property is reserved by ACP to allow clients and agents to attach additional
	// metadata to their interactions. Implementations MUST NOT make assumptions about values at
	// these keys.
	//
	// See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v1/draft/extensibility)
	Meta map[string]any `json:"_meta,omitempty"`
	// Authentication-related capabilities supported by the agent.
	//
	// Defaults to {} if unset.
	Auth AgentAuthCapabilities `json:"auth"`
	// Whether the agent supports 'session/load'.
	//
	// Defaults to false if unset.
	LoadSession bool `json:"loadSession,omitzero"`
	// MCP capabilities supported by the agent.
	//
	// Defaults to {"acp":false,"http":false,"sse":false} if unset.
	McpCapabilities McpCapabilities `json:"mcpCapabilities"`
	// Prompt capabilities supported by the agent.
	//
	// Defaults to {"audio":false,"embeddedContext":false,"image":false} if unset.
	PromptCapabilities PromptCapabilities `json:"promptCapabilities"`
	// **UNSTABLE**
	//
	// This capability is not part of the spec yet, and may be removed or changed at any point.
	//
	// Provider configuration capabilities supported by the agent.
	//
	// Optional. Omitted or 'null' both mean the agent does not advertise support.
	// Supplying '{}' means the agent supports provider configuration methods.
	Providers *ProvidersCapabilities `json:"providers,omitzero"`
	// Session lifecycle and prompt capabilities advertised by the agent.
	//
	// Defaults to {} if unset.
	SessionCapabilities SessionCapabilities `json:"sessionCapabilities"`
}

Capabilities supported by the agent.

Advertised during initialization to inform the client about available features and content types.

See protocol docs: [Agent Capabilities](https://agentclientprotocol.com/protocol/v1/draft/initialization#agent-capabilities)

func (AgentCapabilities) MarshalJSONTo

func (v AgentCapabilities) MarshalJSONTo(enc *jsontext.Encoder) error

func (*AgentCapabilities) UnmarshalJSONFrom

func (v *AgentCapabilities) UnmarshalJSONFrom(dec *jsontext.Decoder) error

type AgentError

type AgentError struct {
	// Method-specific error data.
	Error Error `json:"error"`
	// The id of the request this response answers.
	Id RequestId `json:"id"`
}

A failed JSON-RPC response.

type AgentExperimental

type AgentExperimental interface {
	// **UNSTABLE**
	//
	// This capability is not part of the spec yet, and may be removed or changed at any point.
	//
	// Request parameters for the 'auth/status' method.
	//
	// Queries the agent's current authentication state without changing it.
	//
	// Agents MUST NOT reject it with 'auth_required' ('-32000'), since Clients call it to learn
	// whether authentication is required.
	UnstableAuthStatus(ctx context.Context, params UnstableAuthStatusRequest) (UnstableAuthStatusResponse, error)
	// **UNSTABLE**
	//
	// This capability is not part of the spec yet, and may be removed or changed at any point.
	//
	// Notification parameters for 'mcp/message'.
	//
	// Sent by the provider to the consumer for an active request (including
	// subscription acknowledgements and updates). The outer envelope has no 'id'.
	UnstableMessageMcp(ctx context.Context, params UnstableMessageMcpNotification) error
	// **UNSTABLE**
	//
	// This capability is not part of the spec yet, and may be removed or changed at any point.
	//
	// Request parameters for 'providers/disable'.
	UnstableDisableProvider(ctx context.Context, params UnstableDisableProviderRequest) (UnstableDisableProviderResponse, error)
	// **UNSTABLE**
	//
	// This capability is not part of the spec yet, and may be removed or changed at any point.
	//
	// Request parameters for 'providers/list'.
	UnstableListProviders(ctx context.Context, params UnstableListProvidersRequest) (UnstableListProvidersResponse, error)
	// **UNSTABLE**
	//
	// This capability is not part of the spec yet, and may be removed or changed at any point.
	//
	// Request parameters for 'providers/set'.
	//
	// Replaces the full configuration for one provider ID.
	UnstableSetProvider(ctx context.Context, params UnstableSetProviderRequest) (UnstableSetProviderResponse, error)
	// **UNSTABLE**
	//
	// This capability is not part of the spec yet, and may be removed or changed at any point.
	//
	// Request parameters for archiving a session.
	//
	// Only available if the Agent supports the 'sessionCapabilities.archive' capability.
	//
	// Archiving hides the session from default 'session/list' results. It keeps the session ID
	// and saved history. If the session is active, the Agent MUST cancel any ongoing work and
	// free the session's resources as if 'session/close' had been called, then archive it.
	// Archiving an archived session succeeds. A session that does not exist gets '-32002'.
	UnstableArchiveSession(ctx context.Context, params UnstableArchiveSessionRequest) (UnstableArchiveSessionResponse, error)
	// **UNSTABLE**
	//
	// This capability is not part of the spec yet, and may be removed or changed at any point.
	//
	// Request parameters for forking an existing session.
	//
	// Creates a new session based on the context of an existing one, allowing
	// operations like generating summaries without affecting the original session's history.
	//
	// Only available if the Agent supports the 'session.fork' capability.
	UnstableForkSession(ctx context.Context, params UnstableForkSessionRequest) (UnstableForkSessionResponse, error)
	// **UNSTABLE**
	//
	// This capability is not part of the spec yet, and may be removed or changed at any point.
	//
	// Request parameters for 'session/options', which returns the config options a session
	// would start with, without creating or resuming a session.
	//
	// Only available if the Agent supports the 'sessionCapabilities.options' capability.
	//
	// 'session/options' MUST NOT create or resume a session, send 'session/update'
	// notifications, add an entry to 'session/list', or change an existing session. Agents
	// SHOULD NOT connect to MCP servers to answer it.
	UnstableSessionOptions(ctx context.Context, params UnstableSessionOptionsRequest) (UnstableSessionOptionsResponse, error)
	// **UNSTABLE**
	//
	// This capability is not part of the spec yet, and may be removed or changed at any point.
	//
	// Request parameters for setting the title of a session.
	//
	// Only available if the Agent supports the 'sessionCapabilities.title' capability.
	//
	// The session does not need to be active on the connection. Any session the Agent would
	// return from 'session/list' can be retitled. A session that does not exist gets '-32002'.
	//
	// The Agent responds only after it has stored the title. After a successful response, the
	// Agent SHOULD NOT replace the title with one it generates automatically.
	UnstableSetSessionTitle(ctx context.Context, params UnstableSetSessionTitleRequest) (UnstableSetSessionTitleResponse, error)
	// **UNSTABLE**
	//
	// This capability is not part of the spec yet, and may be removed or changed at any point.
	//
	// Request parameters for checking the status of a session.
	//
	// Only available if the Agent supports the 'sessionCapabilities.status' capability.
	//
	// 'session/status' MUST NOT have side effects. The Agent does not load, resume, create,
	// close, or change the session, and does not attach the requesting connection to it.
	// A session the Agent does not know gets '-32002' with the requested 'sessionId' in 'data'.
	UnstableSessionStatus(ctx context.Context, params UnstableSessionStatusRequest) (UnstableSessionStatusResponse, error)
	// **UNSTABLE**
	//
	// This capability is not part of the spec yet, and may be removed or changed at any point.
	//
	// Request parameters for unarchiving a session.
	//
	// Only available if the Agent supports the 'sessionCapabilities.archive' capability.
	//
	// Unarchiving returns the session to default 'session/list' results with the same ID and
	// saved history. It never loads or resumes the session. Clients that want to continue an
	// archived session SHOULD unarchive it before calling 'session/load' or 'session/resume'.
	// Unarchiving a session that is not archived succeeds. A session that does not exist
	// gets '-32002'.
	UnstableUnarchiveSession(ctx context.Context, params UnstableUnarchiveSessionRequest) (UnstableUnarchiveSessionResponse, error)
}

AgentExperimental defines unstable methods that are not part of the official spec. These may change or be removed without notice.

type AgentLoader

type AgentLoader interface {
	// Request parameters for loading an existing session.
	//
	// Only available if the Agent supports the 'loadSession' capability.
	//
	// See protocol docs: [Loading Sessions](https://agentclientprotocol.com/protocol/v1/draft/session-setup#loading-sessions)
	LoadSession(ctx context.Context, params LoadSessionRequest) (LoadSessionResponse, error)
}

AgentLoader defines optional support for loading sessions. Implement and advertise the capability to enable 'session/load'.

type AgentNotification

type AgentNotification struct {
	// The notification method name.
	Method string `json:"method"`
	// Method-specific notification parameters.
	Params any `json:"params,omitzero"`
}

A JSON-RPC notification object.

func (*AgentNotification) Validate

func (v *AgentNotification) Validate() error

type AgentRequest

type AgentRequest struct {
	// The request id used to correlate the matching response.
	Id RequestId `json:"id"`
	// The method name to invoke.
	Method string `json:"method"`
	// Method-specific request parameters.
	Params any `json:"params,omitzero"`
}

A JSON-RPC request object.

func (*AgentRequest) Validate

func (v *AgentRequest) Validate() error

type AgentResponse

type AgentResponse struct {
	// A successful JSON-RPC response.
	Result *AgentResult `json:"-"`
	// A failed JSON-RPC response.
	Error *AgentError `json:"-"`
}

func (AgentResponse) MarshalJSONTo

func (u AgentResponse) MarshalJSONTo(enc *jsontext.Encoder) error

func (*AgentResponse) UnmarshalJSONFrom

func (u *AgentResponse) UnmarshalJSONFrom(dec *jsontext.Decoder) error

type AgentResult

type AgentResult struct {
	// The id of the request this response answers.
	Id RequestId `json:"id"`
	// Method-specific response data.
	Result any `json:"result"`
}

A JSON-RPC response object. A successful JSON-RPC response.

type AgentSideConnection

type AgentSideConnection struct {
	// contains filtered or unexported fields
}

AgentSideConnection is the agent's end of an ACP connection. It passes the client's requests and notifications to an Agent, and its methods call the client.

func NewAgentSideConnection

func NewAgentSideConnection(agent Agent, w io.Writer, r io.Reader, logger *slog.Logger) *AgentSideConnection

NewAgentSideConnection returns the agent's end of a connection that writes to w and reads from r once Serve is called. A nil logger discards log records.

Requests are handled concurrently, so agent orders a session/cancel against the session's prompts with Arrival. The one exception is initialize: it is handled in order, so it has finished before the agent sees any later message, including one the client sent without waiting.

func (*AgentSideConnection) CompleteElicitation

func (c *AgentSideConnection) CompleteElicitation(ctx context.Context, params CompleteElicitationNotification) error

func (*AgentSideConnection) CreateElicitation

func (*AgentSideConnection) CreateTerminal

func (*AgentSideConnection) Done

func (a *AgentSideConnection) Done() <-chan struct{}

Done is closed when Serve has stopped reading.

func (*AgentSideConnection) KillTerminal

func (*AgentSideConnection) ReadTextFile

func (*AgentSideConnection) RegisterExtensionNotification

func (a *AgentSideConnection) RegisterExtensionNotification(method string, handler MethodHandler) error

RegisterExtensionNotification registers a handler for an _-prefixed notification. It runs in read order, like protocol notification handlers, and cannot wait for a response with its context. Its result is discarded. Registration has the same rules as RegisterExtensionRequest.

func (*AgentSideConnection) RegisterExtensionRequest

func (a *AgentSideConnection) RegisterExtensionRequest(method string, handler MethodHandler) error

RegisterExtensionRequest registers a handler for an _-prefixed request. A duplicate registration, nil handler or non-extension name is an error. Registration is safe while Serve is running. Handlers run concurrently, like protocol request handlers. Params are valid until the handler returns.

func (*AgentSideConnection) ReleaseTerminal

func (*AgentSideConnection) RequestPermission

func (*AgentSideConnection) SendExtensionNotification

func (a *AgentSideConnection) SendExtensionNotification(ctx context.Context, method string, params any) error

SendExtensionNotification sends an _-prefixed notification in write order.

func (*AgentSideConnection) SendExtensionRequest

func (a *AgentSideConnection) SendExtensionRequest(ctx context.Context, method string, params any) (jsontext.Value, error)

SendExtensionRequest sends an _-prefixed request and returns its raw JSON result. It follows the cancellation rules of SendRequest.

func (*AgentSideConnection) Serve

func (a *AgentSideConnection) Serve(ctx context.Context) error

Serve handles the client's messages until the reader ends. See Connection.Serve.

func (*AgentSideConnection) SessionUpdate

func (c *AgentSideConnection) SessionUpdate(ctx context.Context, params SessionNotification) error

func (*AgentSideConnection) TerminalOutput

func (*AgentSideConnection) UnstableAuthStatusUpdate

func (c *AgentSideConnection) UnstableAuthStatusUpdate(ctx context.Context, params UnstableAuthStatusUpdateNotification) error

func (*AgentSideConnection) UnstableMessageMcp

func (*AgentSideConnection) WaitForTerminalExit

func (*AgentSideConnection) WriteTextFile

type Annotations

type Annotations struct {
	// The _meta property is reserved by ACP to allow clients and agents to attach additional
	// metadata to their interactions. Implementations MUST NOT make assumptions about values at
	// these keys.
	//
	// See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v1/draft/extensibility)
	Meta map[string]any `json:"_meta,omitempty"`
	// Intended recipients for this content, such as the user or assistant.
	Audience []Role `json:"audience,omitempty"`
	// Timestamp indicating when the underlying resource was last modified.
	LastModified *string `json:"lastModified,omitzero"`
	// Relative importance of this content when clients choose what to surface.
	Priority *float64 `json:"priority,omitzero"`
}

Optional annotations for the client. The client can use annotations to inform how objects are used or displayed

type AudioContent

type AudioContent struct {
	// The _meta property is reserved by ACP to allow clients and agents to attach additional
	// metadata to their interactions. Implementations MUST NOT make assumptions about values at
	// these keys.
	//
	// See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v1/draft/extensibility)
	Meta map[string]any `json:"_meta,omitempty"`
	// Optional annotations that help clients decide how to display or route this content.
	Annotations *Annotations `json:"annotations,omitzero"`
	// Base64-encoded media payload.
	Data string `json:"data"`
	// MIME type describing the encoded media payload.
	MimeType string `json:"mimeType"`
}

Audio provided to or from an LLM.

type AuthCapabilities

type AuthCapabilities struct {
	// The _meta property is reserved by ACP to allow clients and agents to attach additional
	// metadata to their interactions. Implementations MUST NOT make assumptions about values at
	// these keys.
	//
	// See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v1/draft/extensibility)
	Meta map[string]any `json:"_meta,omitempty"`
	// Whether the client supports 'terminal' authentication methods.
	//
	// The client should set this to 'true' only when it can reproduce the
	// configured agent invocation in an interactive terminal. When 'true', the
	// agent may include 'terminal' entries in its authentication methods.
	//
	// Defaults to false if unset.
	Terminal bool `json:"terminal,omitzero"`
}

Authentication capabilities supported by the client.

Advertised during initialization to inform the agent which authentication method types the client can handle. This governs opt-in types that require additional client-side support.

func (AuthCapabilities) MarshalJSONTo

func (v AuthCapabilities) MarshalJSONTo(enc *jsontext.Encoder) error

type AuthMethod

type AuthMethod struct {
	// Client runs the configured agent program as a separate interactive
	// process, without passing this method to 'authenticate'.
	Terminal *AuthMethodTerminalInline `json:"-"`
	// Agent handles authentication itself through 'authenticate'.
	//
	// This is the default when no 'type' is specified.
	Agent *AuthMethodAgent `json:"-"`
}

func (AuthMethod) MarshalJSONTo

func (u AuthMethod) MarshalJSONTo(enc *jsontext.Encoder) error

func (*AuthMethod) UnmarshalJSONFrom

func (u *AuthMethod) UnmarshalJSONFrom(dec *jsontext.Decoder) error

type AuthMethodAgent

type AuthMethodAgent struct {
	// The _meta property is reserved by ACP to allow clients and agents to attach additional
	// metadata to their interactions. Implementations MUST NOT make assumptions about values at
	// these keys.
	//
	// See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v1/draft/extensibility)
	Meta map[string]any `json:"_meta,omitempty"`
	// Optional human-readable description of this authentication method.
	Description *string `json:"description,omitzero"`
	// Unique identifier for this authentication method.
	Id AuthMethodId `json:"id"`
	// Human-readable name of the authentication method.
	Name string `json:"name"`
}

Agent handles authentication itself through 'authenticate'.

This is the default authentication method type.

type AuthMethodId

type AuthMethodId string

Typed identifier used for auth method values on the wire.

type AuthMethodTerminal

type AuthMethodTerminal struct {
	// The _meta property is reserved by ACP to allow clients and agents to attach additional
	// metadata to their interactions. Implementations MUST NOT make assumptions about values at
	// these keys.
	//
	// See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v1/draft/extensibility)
	Meta map[string]any `json:"_meta,omitempty"`
	// Additional arguments to append to the configured agent invocation for terminal auth.
	Args []string `json:"args,omitempty"`
	// Optional human-readable description of this authentication method.
	Description *string `json:"description,omitzero"`
	// Additional environment variables to set on the configured agent invocation for terminal auth.
	// These values override same-named variables in the base launch configuration.
	Env map[string]any `json:"env,omitempty"`
	// Unique identifier for this authentication method.
	Id AuthMethodId `json:"id"`
	// Human-readable name of the authentication method.
	Name string `json:"name"`
}

Terminal-based authentication method.

The client runs the configured agent program as a separate interactive process for the user to authenticate via a TUI. Agents MUST advertise this method only when the client enabled its terminal authentication capability. A zero exit status signals success. Any other termination signals failure. The client MUST NOT pass this method to 'authenticate'.

type AuthMethodTerminalInline

type AuthMethodTerminalInline struct {
	// The _meta property is reserved by ACP to allow clients and agents to attach additional
	// metadata to their interactions. Implementations MUST NOT make assumptions about values at
	// these keys.
	//
	// See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v1/draft/extensibility)
	Meta map[string]any `json:"_meta,omitempty"`
	// Additional arguments to append to the configured agent invocation for terminal auth.
	Args []string `json:"args,omitempty"`
	// Optional human-readable description of this authentication method.
	Description *string `json:"description,omitzero"`
	// Additional environment variables to set on the configured agent invocation for terminal auth.
	// These values override same-named variables in the base launch configuration.
	Env map[string]any `json:"env,omitempty"`
	// Unique identifier for this authentication method.
	Id AuthMethodId `json:"id"`
	// Human-readable name of the authentication method.
	Name string `json:"name"`
	Type string `json:"type"`
}

Describes an available authentication method.

The 'type' field acts as the discriminator in the serialized JSON form. When no 'type' is present, the method is treated as 'agent'. Client runs the configured agent program as a separate interactive process, without passing this method to 'authenticate'.

type AuthStatusCapabilities

type AuthStatusCapabilities struct {
	// The _meta property is reserved by ACP to allow clients and agents to attach additional
	// metadata to their interactions. Implementations MUST NOT make assumptions about values at
	// these keys.
	//
	// See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v1/draft/extensibility)
	Meta map[string]any `json:"_meta,omitempty"`
}

**UNSTABLE**

This capability is not part of the spec yet, and may be removed or changed at any point.

Auth status capabilities supported by the agent.

Supplying '{}' means the agent supports the 'auth/status' method.

type AuthenticateRequest

type AuthenticateRequest struct {
	// The _meta property is reserved by ACP to allow clients and agents to attach additional
	// metadata to their interactions. Implementations MUST NOT make assumptions about values at
	// these keys.
	//
	// See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v1/draft/extensibility)
	Meta map[string]any `json:"_meta,omitempty"`
	// The ID of the authentication method to use.
	// Must be one of the methods advertised in the initialize response.
	MethodId AuthMethodId `json:"methodId"`
}

Request parameters for the authenticate method.

Specifies which authentication method to use.

func (*AuthenticateRequest) Validate

func (v *AuthenticateRequest) Validate() error

type AuthenticateResponse

type AuthenticateResponse struct {
	// The _meta property is reserved by ACP to allow clients and agents to attach additional
	// metadata to their interactions. Implementations MUST NOT make assumptions about values at
	// these keys.
	//
	// See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v1/draft/extensibility)
	Meta map[string]any `json:"_meta,omitempty"`
}

Response to the 'authenticate' method.

func (*AuthenticateResponse) Validate

func (v *AuthenticateResponse) Validate() error

type AvailableCommand

type AvailableCommand struct {
	// The _meta property is reserved by ACP to allow clients and agents to attach additional
	// metadata to their interactions. Implementations MUST NOT make assumptions about values at
	// these keys.
	//
	// See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v1/draft/extensibility)
	Meta map[string]any `json:"_meta,omitempty"`
	// Human-readable description of what the command does.
	Description string `json:"description"`
	// Input for the command if required
	Input *AvailableCommandInput `json:"input,omitzero"`
	// Command name (e.g., 'create_plan', 'research_codebase').
	Name string `json:"name"`
}

Information about a command.

type AvailableCommandInput

type AvailableCommandInput struct {
	// All text that was typed after the command name is provided as input.
	Unstructured *UnstructuredCommandInput `json:"-"`
}

The input specification for a command.

func (AvailableCommandInput) MarshalJSONTo

func (u AvailableCommandInput) MarshalJSONTo(enc *jsontext.Encoder) error

func (*AvailableCommandInput) UnmarshalJSONFrom

func (u *AvailableCommandInput) UnmarshalJSONFrom(dec *jsontext.Decoder) error

type AvailableCommandsUpdate

type AvailableCommandsUpdate struct {
	// The _meta property is reserved by ACP to allow clients and agents to attach additional
	// metadata to their interactions. Implementations MUST NOT make assumptions about values at
	// these keys.
	//
	// See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v1/draft/extensibility)
	Meta map[string]any `json:"_meta,omitempty"`
	// Commands the agent can execute
	AvailableCommands []AvailableCommand `json:"availableCommands"`
}

Available commands are ready or have changed

type BlobResourceContents

type BlobResourceContents struct {
	// The _meta property is reserved by ACP to allow clients and agents to attach additional
	// metadata to their interactions. Implementations MUST NOT make assumptions about values at
	// these keys.
	//
	// See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v1/draft/extensibility)
	Meta map[string]any `json:"_meta,omitempty"`
	// Base64-encoded bytes for a binary resource payload.
	Blob string `json:"blob"`
	// MIME type describing the encoded media payload.
	MimeType *string `json:"mimeType,omitzero"`
	// URI associated with this resource or media payload.
	Uri string `json:"uri"`
}

Binary resource contents.

type BooleanConfigOptionCapabilities

type BooleanConfigOptionCapabilities struct {
	// The _meta property is reserved by ACP to allow clients and agents to attach additional
	// metadata to their interactions. Implementations MUST NOT make assumptions about values at
	// these keys.
	//
	// See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v1/draft/extensibility)
	Meta map[string]any `json:"_meta,omitempty"`
}

Capabilities for boolean session configuration options.

Supplying '{}' means the client supports boolean session configuration options.

type BooleanPropertySchema

type BooleanPropertySchema struct {
	// The _meta property is reserved by ACP to allow clients and agents to attach additional
	// metadata to their interactions. Implementations MUST NOT make assumptions about values at
	// these keys.
	//
	// Optional. Omitted and 'null' are equivalent and mean no metadata.
	//
	// See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v1/extensibility)
	Meta map[string]any `json:"_meta,omitempty"`
	// Default value.
	//
	// Optional. Omitted and 'null' are equivalent and mean no default value is provided.
	Default *bool `json:"default,omitzero"`
	// Human-readable description.
	//
	// Optional. Omitted and 'null' are equivalent and mean no description is provided.
	Description *string `json:"description,omitzero"`
	// Optional title for the property.
	//
	// Optional. Omitted and 'null' are equivalent and mean no title is provided.
	Title *string `json:"title,omitzero"`
}

Schema for boolean properties in an elicitation form.

type CancelNotification

type CancelNotification struct {
	// The _meta property is reserved by ACP to allow clients and agents to attach additional
	// metadata to their interactions. Implementations MUST NOT make assumptions about values at
	// these keys.
	//
	// See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v1/draft/extensibility)
	Meta map[string]any `json:"_meta,omitempty"`
	// The ID of the session to cancel operations for.
	SessionId SessionId `json:"sessionId"`
}

Notification to cancel ongoing operations for a session.

See protocol docs: [Cancellation](https://agentclientprotocol.com/protocol/v1/draft/prompt-turn#cancellation)

func (*CancelNotification) Validate

func (v *CancelNotification) Validate() error

type CancelRequestNotification

type CancelRequestNotification struct {
	// The _meta property is reserved by ACP to allow clients and agents to attach additional
	// metadata to their interactions. Implementations MUST NOT make assumptions about values at
	// these keys.
	//
	// See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v1/draft/extensibility)
	Meta map[string]any `json:"_meta,omitempty"`
	// The ID of the request to cancel.
	RequestId RequestId `json:"requestId"`
}

Notification to cancel an ongoing request.

See protocol docs: [Cancellation](https://agentclientprotocol.com/protocol/v1/draft/cancellation)

func (*CancelRequestNotification) Validate

func (v *CancelRequestNotification) Validate() error

type Client

type Client interface {
	// Notification sent by the agent when a URL-based elicitation is complete.
	CompleteElicitation(ctx context.Context, params CompleteElicitationNotification) error
	// Request from the agent to elicit structured user input.
	//
	// The agent sends this to the client to request information from the user,
	// either via a form or by directing them to a URL.
	// Elicitations are tied to a session (optionally a tool call) or a request.
	CreateElicitation(ctx context.Context, params CreateElicitationRequest) (CreateElicitationResponse, error)
	// Request to read content from a text file.
	//
	// Only available if the client supports the 'fs.readTextFile' capability.
	ReadTextFile(ctx context.Context, params ReadTextFileRequest) (ReadTextFileResponse, error)
	// Request to write content to a text file.
	//
	// Only available if the client supports the 'fs.writeTextFile' capability.
	WriteTextFile(ctx context.Context, params WriteTextFileRequest) (WriteTextFileResponse, error)
	// Request for user permission to execute a tool call.
	//
	// Sent when the agent needs authorization before performing a sensitive operation.
	//
	// See protocol docs: [Requesting Permission](https://agentclientprotocol.com/protocol/v1/draft/tool-calls#requesting-permission)
	RequestPermission(ctx context.Context, params RequestPermissionRequest) (RequestPermissionResponse, error)
	// Notification containing a session update from the agent.
	//
	// Used to stream real-time progress and results during prompt processing.
	//
	// See protocol docs: [Agent Reports Output](https://agentclientprotocol.com/protocol/v1/draft/prompt-turn#3-agent-reports-output)
	SessionUpdate(ctx context.Context, params SessionNotification) error
	// Request to create a new terminal and execute a command.
	CreateTerminal(ctx context.Context, params CreateTerminalRequest) (CreateTerminalResponse, error)
	// Request to kill a terminal without releasing it.
	KillTerminal(ctx context.Context, params KillTerminalRequest) (KillTerminalResponse, error)
	// Request to get the current output and status of a terminal.
	TerminalOutput(ctx context.Context, params TerminalOutputRequest) (TerminalOutputResponse, error)
	// Request to release a terminal and free its resources.
	ReleaseTerminal(ctx context.Context, params ReleaseTerminalRequest) (ReleaseTerminalResponse, error)
	// Request to wait for a terminal command to exit.
	WaitForTerminalExit(ctx context.Context, params WaitForTerminalExitRequest) (WaitForTerminalExitResponse, error)
}

type ClientCapabilities

type ClientCapabilities struct {
	// The _meta property is reserved by ACP to allow clients and agents to attach additional
	// metadata to their interactions. Implementations MUST NOT make assumptions about values at
	// these keys.
	//
	// See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v1/draft/extensibility)
	Meta map[string]any `json:"_meta,omitempty"`
	// Authentication capabilities supported by the client.
	// Determines which authentication method types the agent may include
	// in its 'InitializeResponse'.
	//
	// Defaults to {"terminal":false} if unset.
	Auth AuthCapabilities `json:"auth"`
	// Elicitation capabilities supported by the client.
	// Determines which elicitation modes the agent may use.
	//
	// Optional. Omitted or 'null' both mean the client does not advertise
	// elicitation support.
	Elicitation *ElicitationCapabilities `json:"elicitation,omitzero"`
	// File system capabilities supported by the client.
	// Determines which file operations the agent can request.
	//
	// Defaults to {"readTextFile":false,"writeTextFile":false} if unset.
	Fs FileSystemCapabilities `json:"fs"`
	// **UNSTABLE**
	//
	// This capability is not part of the spec yet, and may be removed or changed at any point.
	//
	// Whether the client supports 'plan_update' and 'plan_removed' session updates.
	//
	// Optional. Omitted or 'null' both mean the client does not advertise support.
	// Supplying '{}' means the client can receive both update types.
	Plan *PlanCapabilities `json:"plan,omitzero"`
	// Session-related capabilities supported by the client.
	//
	// Optional. Omitted or 'null' both mean the client does not advertise any
	// session-related extensions.
	Session *ClientSessionCapabilities `json:"session,omitzero"`
	// **UNSTABLE**
	//
	// This capability is not part of the spec yet, and may be removed or changed at any point.
	//
	// Whether the client understands exposed subagent sessions.
	//
	// Optional and nullable. Omitted or 'null' both mean the client does not
	// advertise support.
	// Supplying '{}' means the client understands child associations, work-state
	// snapshots, session-directed messages, and restricted-session semantics.
	Subagents *SubagentCapabilities `json:"subagents,omitzero"`
	// Whether the Client support all 'terminal/*' methods.
	//
	// Defaults to false if unset.
	Terminal bool `json:"terminal,omitzero"`
}

Capabilities supported by the client.

Advertised during initialization to inform the agent about available features and methods.

See protocol docs: [Client Capabilities](https://agentclientprotocol.com/protocol/v1/draft/initialization#client-capabilities)

func (ClientCapabilities) MarshalJSONTo

func (v ClientCapabilities) MarshalJSONTo(enc *jsontext.Encoder) error

func (*ClientCapabilities) UnmarshalJSONFrom

func (v *ClientCapabilities) UnmarshalJSONFrom(dec *jsontext.Decoder) error

type ClientError

type ClientError struct {
	// Method-specific error data.
	Error Error `json:"error"`
	// The id of the request this response answers.
	Id RequestId `json:"id"`
}

A failed JSON-RPC response.

type ClientExperimental

type ClientExperimental interface {
	// **UNSTABLE**
	//
	// This capability is not part of the spec yet, and may be removed or changed at any point.
	//
	// Notification sent by the agent when its authentication status changes.
	//
	// Carries the same fields as the 'auth/status' response. Agents that advertise the
	// 'auth.status' capability MAY send it at any time after 'initialize', and SHOULD only
	// send it when the reported status differs from the last one sent on the connection.
	UnstableAuthStatusUpdate(ctx context.Context, params UnstableAuthStatusUpdateNotification) error
	// **UNSTABLE**
	//
	// This capability is not part of the spec yet, and may be removed or changed at any point.
	//
	// Request parameters for 'mcp/message'.
	UnstableMessageMcp(ctx context.Context, params UnstableMessageMcpRequest) (UnstableMessageMcpResponse, error)
}

ClientExperimental defines unstable methods that are not part of the official spec. These may change or be removed without notice.

type ClientNotification

type ClientNotification struct {
	// The notification method name.
	Method string `json:"method"`
	// Method-specific notification parameters.
	Params any `json:"params,omitzero"`
}

A JSON-RPC notification object.

func (*ClientNotification) Validate

func (v *ClientNotification) Validate() error

type ClientRequest

type ClientRequest struct {
	// The request id used to correlate the matching response.
	Id RequestId `json:"id"`
	// The method name to invoke.
	Method string `json:"method"`
	// Method-specific request parameters.
	Params any `json:"params,omitzero"`
}

A JSON-RPC request object.

func (*ClientRequest) Validate

func (v *ClientRequest) Validate() error

type ClientResponse

type ClientResponse struct {
	// A successful JSON-RPC response.
	Result *ClientResult `json:"-"`
	// A failed JSON-RPC response.
	Error *ClientError `json:"-"`
}

func (ClientResponse) MarshalJSONTo

func (u ClientResponse) MarshalJSONTo(enc *jsontext.Encoder) error

func (*ClientResponse) UnmarshalJSONFrom

func (u *ClientResponse) UnmarshalJSONFrom(dec *jsontext.Decoder) error

type ClientResult

type ClientResult struct {
	// The id of the request this response answers.
	Id RequestId `json:"id"`
	// Method-specific response data.
	Result any `json:"result"`
}

A JSON-RPC response object. A successful JSON-RPC response.

type ClientSessionCapabilities

type ClientSessionCapabilities struct {
	// The _meta property is reserved by ACP to allow clients and agents to attach additional
	// metadata to their interactions. Implementations MUST NOT make assumptions about values at
	// these keys.
	//
	// See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v1/draft/extensibility)
	Meta map[string]any `json:"_meta,omitempty"`
	// Support for ID-addressed context compaction updates. Omitted or 'null'
	// means unsupported. '{}' advertises the complete compaction contract.
	Compaction *CompactionCapabilities `json:"compaction,omitzero"`
	// Config option capabilities supported by the client.
	//
	// Omitted or 'null' both mean the client does not advertise support for any
	// config option extensions.
	ConfigOptions *SessionConfigOptionsCapabilities `json:"configOptions,omitzero"`
	// Support for live user-facing 'notice' session updates.
	//
	// Optional. Omitted or 'null' both mean the client does not advertise support.
	// Supplying '{}' means the client can present notices to the user.
	Notices *NoticeCapabilities `json:"notices,omitzero"`
}

Session-related capabilities supported by the client.

type ClientSideConnection

type ClientSideConnection struct {
	// contains filtered or unexported fields
}

ClientSideConnection is the client's end of an ACP connection. It passes the agent's requests and notifications to a Client, and its methods call the agent.

func NewClientSideConnection

func NewClientSideConnection(client Client, w io.Writer, r io.Reader, logger *slog.Logger) *ClientSideConnection

NewClientSideConnection returns the client's end of a connection that writes to w and reads from r once Serve is called. A nil logger discards log records.

func (*ClientSideConnection) Authenticate

func (*ClientSideConnection) Cancel

func (*ClientSideConnection) CloseSession

func (*ClientSideConnection) DeleteSession

func (*ClientSideConnection) Done

func (c *ClientSideConnection) Done() <-chan struct{}

Done is closed when Serve has stopped reading.

func (*ClientSideConnection) Initialize

func (*ClientSideConnection) ListSessions

func (*ClientSideConnection) LoadSession

func (*ClientSideConnection) Logout

func (*ClientSideConnection) NewSession

func (*ClientSideConnection) Prompt

func (*ClientSideConnection) RegisterExtensionNotification

func (c *ClientSideConnection) RegisterExtensionNotification(method string, handler MethodHandler) error

RegisterExtensionNotification registers a handler for an _-prefixed notification. It has the same rules as the agent-side method.

func (*ClientSideConnection) RegisterExtensionRequest

func (c *ClientSideConnection) RegisterExtensionRequest(method string, handler MethodHandler) error

RegisterExtensionRequest registers a handler for an _-prefixed request. It has the same registration and execution rules as the agent-side method.

func (*ClientSideConnection) ResumeSession

func (*ClientSideConnection) SendExtensionNotification

func (c *ClientSideConnection) SendExtensionNotification(ctx context.Context, method string, params any) error

SendExtensionNotification sends an _-prefixed notification in write order.

func (*ClientSideConnection) SendExtensionRequest

func (c *ClientSideConnection) SendExtensionRequest(ctx context.Context, method string, params any) (jsontext.Value, error)

SendExtensionRequest sends an _-prefixed request and returns its raw JSON result. It follows the cancellation rules of SendRequest.

func (*ClientSideConnection) Serve

func (c *ClientSideConnection) Serve(ctx context.Context) error

Serve handles the agent's messages until the reader ends. See Connection.Serve.

func (*ClientSideConnection) SetSessionConfigOption

func (*ClientSideConnection) SetSessionMode

func (*ClientSideConnection) UnstableArchiveSession

func (*ClientSideConnection) UnstableAuthStatus

func (*ClientSideConnection) UnstableDisableProvider

func (*ClientSideConnection) UnstableForkSession

func (*ClientSideConnection) UnstableListProviders

func (*ClientSideConnection) UnstableMessageMcp

func (c *ClientSideConnection) UnstableMessageMcp(ctx context.Context, params UnstableMessageMcpNotification) error

func (*ClientSideConnection) UnstableSessionOptions

func (*ClientSideConnection) UnstableSessionStatus

func (*ClientSideConnection) UnstableSetProvider

func (*ClientSideConnection) UnstableSetSessionTitle

func (*ClientSideConnection) UnstableUnarchiveSession

type CloseSessionRequest

type CloseSessionRequest struct {
	// The _meta property is reserved by ACP to allow clients and agents to attach additional
	// metadata to their interactions. Implementations MUST NOT make assumptions about values at
	// these keys.
	//
	// See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v1/draft/extensibility)
	Meta map[string]any `json:"_meta,omitempty"`
	// The ID of the session to close.
	SessionId SessionId `json:"sessionId"`
}

Request parameters for closing an active session.

If supported, the agent **must** cancel any ongoing work related to the session (treat it as if 'session/cancel' was called) and then free up any resources associated with the session.

Only available if the Agent supports the 'sessionCapabilities.close' capability.

func (*CloseSessionRequest) Validate

func (v *CloseSessionRequest) Validate() error

type CloseSessionResponse

type CloseSessionResponse struct {
	// The _meta property is reserved by ACP to allow clients and agents to attach additional
	// metadata to their interactions. Implementations MUST NOT make assumptions about values at
	// these keys.
	//
	// See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v1/draft/extensibility)
	Meta map[string]any `json:"_meta,omitempty"`
}

Response from closing a session.

func (*CloseSessionResponse) Validate

func (v *CloseSessionResponse) Validate() error

type CompactionCapabilities

type CompactionCapabilities struct{}

Client support for ID-addressed context compaction updates.

type CompactionId

type CompactionId string

Unique identifier for a context compaction within a session.

type CompactionStatus

type CompactionStatus string

Lifecycle state of a context compaction.

const (
	CompactionStatusInProgress CompactionStatus = "in_progress"
	CompactionStatusCompleted  CompactionStatus = "completed"
	CompactionStatusFailed     CompactionStatus = "failed"
	CompactionStatusCancelled  CompactionStatus = "cancelled"
)

type CompactionSummaryChunk

type CompactionSummaryChunk struct {
	// Metadata scoped to this chunk. Omission and 'null' both mean absent.
	Meta map[string]any `json:"_meta,omitempty"`
	// ID of the compaction whose summary receives this content.
	CompactionId CompactionId `json:"compactionId"`
	// One content block to append.
	Content ContentBlock `json:"content"`
}

A content block appended to a compaction's summary. A first-seen ID creates an in-progress compaction. Chunks append in receive order. Agents MUST only send this update when the Client advertised the 'session.compaction' Client capability.

type CompactionUpdate

type CompactionUpdate struct {
	// Extensible metadata patch for this compaction.
	Meta map[string]any `json:"_meta,omitempty"`
	// The Agent-owned ID of this compaction, unique within the session.
	CompactionId CompactionId `json:"compactionId"`
	// Human-readable error details for the compaction.
	Error *string `json:"error,omitzero"`
	// Current lifecycle status.
	Status CompactionStatus `json:"status"`
	// Complete replacement user-displayable summary content for the compaction.
	Summary []ContentBlock `json:"summary,omitempty"`
}

A context compaction upsert. The first notification fixes the compaction's timeline position. Later updates with the same ID patch that entity in place. Agents MUST only send this update when the Client advertised the 'session.compaction' Client capability.

'summary', 'error', and '_meta' have patch semantics: omission leaves the stored value unchanged, 'null' clears it, and a concrete value replaces it. 'summary: []' also clears the summary.

type CompleteElicitationNotification

type CompleteElicitationNotification struct {
	// The _meta property is reserved by ACP to allow clients and agents to attach additional
	// metadata to their interactions. Implementations MUST NOT make assumptions about values at
	// these keys.
	//
	// Optional. Omitted and 'null' are equivalent and mean no metadata.
	//
	// See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v1/draft/extensibility)
	Meta map[string]any `json:"_meta,omitempty"`
	// The ID of the elicitation that completed.
	ElicitationId ElicitationId `json:"elicitationId"`
}

Notification sent by the agent when a URL-based elicitation is complete.

func (*CompleteElicitationNotification) Validate

func (v *CompleteElicitationNotification) Validate() error

type ConfigOptionUpdate

type ConfigOptionUpdate struct {
	// The _meta property is reserved by ACP to allow clients and agents to attach additional
	// metadata to their interactions. Implementations MUST NOT make assumptions about values at
	// these keys.
	//
	// See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v1/draft/extensibility)
	Meta map[string]any `json:"_meta,omitempty"`
	// The full set of configuration options and their current values.
	ConfigOptions []SessionConfigOption `json:"configOptions"`
}

Session configuration options have been updated.

type Connection

type Connection struct {
	// contains filtered or unexported fields
}

Connection is a JSON-RPC 2.0 connection over newline-delimited messages.

Inbound notifications and responses are handled one at a time on the goroutine that runs Serve, in the order they were read. Each inbound request is handled on its own goroutine. A second goroutine reads the messages, so that Serve can stop while a read is blocked.

func NewConnection

func NewConnection(handler MethodHandler, w io.Writer, r io.Reader, logger *slog.Logger) *Connection

NewConnection returns a connection that writes to w and reads from r once Serve is called. A nil logger discards log records.

func (*Connection) Done

func (c *Connection) Done() <-chan struct{}

Done is closed when Serve has stopped reading.

func (*Connection) SendNotification

func (c *Connection) SendNotification(_ context.Context, method string, params any) error

SendNotification sends a notification. It returns once the message has been written, so notifications reach the peer in the order they were sent. Params passed as a pointer are encoded without being copied.

func (*Connection) SendRequestNoResult

func (c *Connection) SendRequestNoResult(ctx context.Context, method string, params any) error

SendRequestNoResult sends a request whose response carries no data.

func (*Connection) Serve

func (c *Connection) Serve(ctx context.Context) error

Serve handles messages until the reader ends or fails, or ctx is cancelled. It returns nil when the peer closed the stream between messages, and ctx's error when ctx ended first. ctx is the parent of every handler's context. Before it returns, Serve cancels the handlers still running and waits for them, which includes writing their responses: close the writer if the peer has stopped reading.

A read that is blocked when ctx is cancelled stays blocked, with its goroutine, until the reader returns. Standard input cannot be interrupted, so a process that stops this way exits. Close any other reader.

A message is read whole, whatever its length. Prompts carry files and images inline, and the protocol sets no limit.

type Content

type Content struct {
	// The _meta property is reserved by ACP to allow clients and agents to attach additional
	// metadata to their interactions. Implementations MUST NOT make assumptions about values at
	// these keys.
	//
	// See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v1/draft/extensibility)
	Meta map[string]any `json:"_meta,omitempty"`
	// The actual content block.
	Content ContentBlock `json:"content"`
}

Standard content block (text, images, resources).

type ContentBlock

type ContentBlock struct {
	// Text content. May be plain text or formatted with Markdown.
	//
	// All agents MUST support text content blocks in prompts.
	// Clients SHOULD render this text as Markdown.
	Text *ContentBlockText `json:"-"`
	// Images for visual context or analysis.
	//
	// Requires the 'image' prompt capability when included in prompts.
	Image *ContentBlockImage `json:"-"`
	// Audio data for transcription or analysis.
	//
	// Requires the 'audio' prompt capability when included in prompts.
	Audio *ContentBlockAudio `json:"-"`
	// References to resources that the agent can access.
	//
	// All agents MUST support resource links in prompts.
	ResourceLink *ContentBlockResourceLink `json:"-"`
	// Complete resource contents embedded directly in the message.
	//
	// Preferred for including context as it avoids extra round-trips.
	//
	// Requires the 'embeddedContext' prompt capability when included in prompts.
	Resource *ContentBlockResource `json:"-"`
}

func (ContentBlock) MarshalJSONTo

func (u ContentBlock) MarshalJSONTo(enc *jsontext.Encoder) error

func (*ContentBlock) UnmarshalJSONFrom

func (u *ContentBlock) UnmarshalJSONFrom(dec *jsontext.Decoder) error

func (*ContentBlock) Validate

func (u *ContentBlock) Validate() error

type ContentBlockAudio

type ContentBlockAudio struct {
	// The _meta property is reserved by ACP to allow clients and agents to attach additional
	// metadata to their interactions. Implementations MUST NOT make assumptions about values at
	// these keys.
	//
	// See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v1/draft/extensibility)
	Meta map[string]any `json:"_meta,omitempty"`
	// Optional annotations that help clients decide how to display or route this content.
	Annotations *Annotations `json:"annotations,omitzero"`
	// Base64-encoded media payload.
	Data string `json:"data"`
	// MIME type describing the encoded media payload.
	MimeType string `json:"mimeType"`
	Type     string `json:"type"`
}

Audio data for transcription or analysis.

Requires the 'audio' prompt capability when included in prompts.

type ContentBlockImage

type ContentBlockImage struct {
	// The _meta property is reserved by ACP to allow clients and agents to attach additional
	// metadata to their interactions. Implementations MUST NOT make assumptions about values at
	// these keys.
	//
	// See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v1/draft/extensibility)
	Meta map[string]any `json:"_meta,omitempty"`
	// Optional annotations that help clients decide how to display or route this content.
	Annotations *Annotations `json:"annotations,omitzero"`
	// Base64-encoded media payload.
	Data string `json:"data"`
	// MIME type describing the encoded media payload.
	MimeType string `json:"mimeType"`
	Type     string `json:"type"`
	// URI associated with this resource or media payload.
	Uri *string `json:"uri,omitzero"`
}

Images for visual context or analysis.

Requires the 'image' prompt capability when included in prompts.

type ContentBlockResource

type ContentBlockResource struct {
	// The _meta property is reserved by ACP to allow clients and agents to attach additional
	// metadata to their interactions. Implementations MUST NOT make assumptions about values at
	// these keys.
	//
	// See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v1/draft/extensibility)
	Meta map[string]any `json:"_meta,omitempty"`
	// Optional annotations that help clients decide how to display or route this content.
	Annotations *Annotations `json:"annotations,omitzero"`
	// Embedded resource payload, either text or binary data.
	Resource EmbeddedResourceResource `json:"resource"`
	Type     string                   `json:"type"`
}

Complete resource contents embedded directly in the message.

Preferred for including context as it avoids extra round-trips.

Requires the 'embeddedContext' prompt capability when included in prompts.

type ContentBlockResourceLink struct {
	// The _meta property is reserved by ACP to allow clients and agents to attach additional
	// metadata to their interactions. Implementations MUST NOT make assumptions about values at
	// these keys.
	//
	// See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v1/draft/extensibility)
	Meta map[string]any `json:"_meta,omitempty"`
	// Optional annotations that help clients decide how to display or route this content.
	Annotations *Annotations `json:"annotations,omitzero"`
	// Optional human-readable details shown with this protocol object.
	Description *string `json:"description,omitzero"`
	// MIME type describing the encoded media payload.
	MimeType *string `json:"mimeType,omitzero"`
	// Human-readable name shown for this protocol object.
	Name string `json:"name"`
	// Optional size of the linked resource in bytes, if known.
	Size *int `json:"size,omitzero"`
	// Optional display title for end-user UI.
	Title *string `json:"title,omitzero"`
	Type  string  `json:"type"`
	// URI associated with this resource or media payload.
	Uri string `json:"uri"`
}

References to resources that the agent can access.

All agents MUST support resource links in prompts.

type ContentBlockText

type ContentBlockText struct {
	// The _meta property is reserved by ACP to allow clients and agents to attach additional
	// metadata to their interactions. Implementations MUST NOT make assumptions about values at
	// these keys.
	//
	// See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v1/draft/extensibility)
	Meta map[string]any `json:"_meta,omitempty"`
	// Optional annotations that help clients decide how to display or route this content.
	Annotations *Annotations `json:"annotations,omitzero"`
	// Text payload carried by this content block.
	Text string `json:"text"`
	Type string `json:"type"`
}

Content blocks represent displayable information in the Agent Client Protocol.

Content blocks appear in: - User prompts sent via 'session/prompt' - Language model output streamed through 'session/update' notifications - Progress updates and results from tool calls

This structure is compatible with the Model Context Protocol (MCP), so agents can forward content from MCP tool outputs without transformation.

See protocol docs: Content(https://agentclientprotocol.com/protocol/v1/draft/content) Text content. May be plain text or formatted with Markdown.

All agents MUST support text content blocks in prompts. Clients SHOULD render this text as Markdown.

type ContentChunk

type ContentChunk struct {
	// The _meta property is reserved by ACP to allow clients and agents to attach additional
	// metadata to their interactions. Implementations MUST NOT make assumptions about values at
	// these keys.
	//
	// See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v1/draft/extensibility)
	Meta map[string]any `json:"_meta,omitempty"`
	// A single item of content
	Content ContentBlock `json:"content"`
	// A unique identifier for the message this chunk belongs to.
	//
	// All chunks belonging to the same message share the same 'messageId'.
	// A change in 'messageId' indicates a new message has started.
	MessageId *MessageId `json:"messageId,omitzero"`
}

A streamed item of content

type Cost

type Cost struct {
	// The _meta property is reserved by ACP to allow clients and agents to attach additional
	// metadata to their interactions. Implementations MUST NOT make assumptions about values at
	// these keys.
	//
	// See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v1/draft/extensibility)
	Meta map[string]any `json:"_meta,omitempty"`
	// Total cumulative cost for session.
	Amount float64 `json:"amount"`
	// Unit of 'amount': an ISO 4217 currency code (e.g., "USD", "EUR") for money, or another
	// unit such as "credits".
	Currency string `json:"currency"`
}

Cost information for a session.

type CreateElicitationAccept

type CreateElicitationAccept struct {
	// The _meta property is reserved by ACP to allow clients and agents to attach additional
	// metadata to their interactions. Implementations MUST NOT make assumptions about values at
	// these keys.
	//
	// Optional. Omitted and 'null' are equivalent and mean no metadata.
	//
	// See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v1/draft/extensibility)
	Meta   map[string]any `json:"_meta,omitempty"`
	Action string         `json:"action"`
	// The user-provided content, if any, as an object matching the requested schema.
	Content map[string]any `json:"content,omitempty"`
}

Response from the client to an elicitation request. The user accepted and provided content.

type CreateElicitationCancel

type CreateElicitationCancel struct {
	// The _meta property is reserved by ACP to allow clients and agents to attach additional
	// metadata to their interactions. Implementations MUST NOT make assumptions about values at
	// these keys.
	//
	// Optional. Omitted and 'null' are equivalent and mean no metadata.
	//
	// See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v1/draft/extensibility)
	Meta   map[string]any `json:"_meta,omitempty"`
	Action string         `json:"action"`
}

The elicitation was cancelled.

type CreateElicitationDecline

type CreateElicitationDecline struct {
	// The _meta property is reserved by ACP to allow clients and agents to attach additional
	// metadata to their interactions. Implementations MUST NOT make assumptions about values at
	// these keys.
	//
	// Optional. Omitted and 'null' are equivalent and mean no metadata.
	//
	// See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v1/draft/extensibility)
	Meta   map[string]any `json:"_meta,omitempty"`
	Action string         `json:"action"`
}

The user declined the elicitation.

type CreateElicitationForm

type CreateElicitationForm struct {
	// The _meta property is reserved by ACP to allow clients and agents to attach additional
	// metadata to their interactions. Implementations MUST NOT make assumptions about values at
	// these keys.
	//
	// Optional. Omitted and 'null' are equivalent and mean no metadata.
	//
	// See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v1/draft/extensibility)
	Meta map[string]any `json:"_meta,omitempty"`
	// A human-readable message describing what input is needed.
	Message string `json:"message"`
	Mode    string `json:"mode"`
	// The request this elicitation is tied to.
	RequestId *RequestId `json:"requestId,omitzero"`
	// A JSON Schema describing the form fields to present to the user.
	RequestedSchema ElicitationSchema `json:"requestedSchema"`
	// The session this elicitation is tied to.
	SessionId SessionId `json:"sessionId,omitzero"`
	// Optional tool call within the session.
	//
	// Optional. Omitted and 'null' are equivalent and mean the elicitation is scoped to the
	// session without a specific tool call.
	ToolCallId *ToolCallId `json:"toolCallId,omitzero"`
}

Request from the agent to elicit structured user input.

The agent sends this to the client to request information from the user, either via a form or by directing them to a URL. Elicitations are tied to a session (optionally a tool call) or a request. Form-based elicitation where the client renders a form from the provided schema.

type CreateElicitationOther

type CreateElicitationOther struct {
	// The _meta property is reserved by ACP to allow clients and agents to attach additional
	// metadata to their interactions. Implementations MUST NOT make assumptions about values at
	// these keys.
	//
	// Optional. Omitted and 'null' are equivalent and mean no metadata.
	//
	// See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v1/draft/extensibility)
	Meta map[string]any `json:"_meta,omitempty"`
	// A human-readable message describing what input is needed.
	Message string `json:"message"`
	// Custom or future elicitation mode.
	//
	// Values beginning with '_' are reserved for implementation-specific
	// extensions. Unknown values that do not begin with '_' are reserved for
	// future ACP variants.
	Mode string `json:"mode"`
	// The request this elicitation is tied to.
	RequestId *RequestId `json:"requestId,omitzero"`
	// The session this elicitation is tied to.
	SessionId SessionId `json:"sessionId,omitzero"`
	// Optional tool call within the session.
	//
	// Optional. Omitted and 'null' are equivalent and mean the elicitation is scoped to the
	// session without a specific tool call.
	ToolCallId *ToolCallId `json:"toolCallId,omitzero"`
}

Custom or future elicitation mode.

Values beginning with '_' are reserved for implementation-specific extensions. Unknown values that do not begin with '_' are reserved for future ACP variants.

Clients that do not understand this mode should preserve the raw payload when storing, replaying, proxying, or forwarding elicitation requests. They MUST NOT render it as a known elicitation mode.

type CreateElicitationRequest

type CreateElicitationRequest struct {
	// Form-based elicitation where the client renders a form from the provided schema.
	Form *CreateElicitationForm `json:"-"`
	// URL-based elicitation where the client directs the user to a URL.
	Url *CreateElicitationUrl `json:"-"`
	// Custom or future elicitation mode.
	//
	// Values beginning with '_' are reserved for implementation-specific
	// extensions. Unknown values that do not begin with '_' are reserved for
	// future ACP variants.
	//
	// Clients that do not understand this mode should preserve the raw payload
	// when storing, replaying, proxying, or forwarding elicitation requests.
	// They MUST NOT render it as a known elicitation mode.
	Other *CreateElicitationOther `json:"-"`
}

func (CreateElicitationRequest) MarshalJSONTo

func (u CreateElicitationRequest) MarshalJSONTo(enc *jsontext.Encoder) error

func (*CreateElicitationRequest) UnmarshalJSONFrom

func (u *CreateElicitationRequest) UnmarshalJSONFrom(dec *jsontext.Decoder) error

func (*CreateElicitationRequest) Validate

func (v *CreateElicitationRequest) Validate() error

type CreateElicitationResponse

type CreateElicitationResponse struct {
	// The user accepted and provided content.
	Accept *CreateElicitationAccept `json:"-"`
	// The user declined the elicitation.
	Decline *CreateElicitationDecline `json:"-"`
	// The elicitation was cancelled.
	Cancel *CreateElicitationCancel `json:"-"`
	// Custom or future elicitation action.
	//
	// Values beginning with '_' are reserved for implementation-specific
	// extensions. Unknown values that do not begin with '_' are reserved for
	// future ACP variants.
	//
	// Agents that do not understand this action should preserve the raw
	// payload when storing, replaying, proxying, or forwarding elicitation
	// responses. They MUST NOT treat it as a known elicitation action.
	Other *CreateElicitationResponseOther `json:"-"`
}

func (CreateElicitationResponse) MarshalJSONTo

func (u CreateElicitationResponse) MarshalJSONTo(enc *jsontext.Encoder) error

func (*CreateElicitationResponse) UnmarshalJSONFrom

func (u *CreateElicitationResponse) UnmarshalJSONFrom(dec *jsontext.Decoder) error

func (*CreateElicitationResponse) Validate

func (v *CreateElicitationResponse) Validate() error

type CreateElicitationResponseOther

type CreateElicitationResponseOther struct {
	// The _meta property is reserved by ACP to allow clients and agents to attach additional
	// metadata to their interactions. Implementations MUST NOT make assumptions about values at
	// these keys.
	//
	// Optional. Omitted and 'null' are equivalent and mean no metadata.
	//
	// See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v1/draft/extensibility)
	Meta map[string]any `json:"_meta,omitempty"`
	// Custom or future elicitation action.
	//
	// Values beginning with '_' are reserved for implementation-specific
	// extensions. Unknown values that do not begin with '_' are reserved for
	// future ACP variants.
	Action string `json:"action"`
}

Custom or future elicitation action.

Values beginning with '_' are reserved for implementation-specific extensions. Unknown values that do not begin with '_' are reserved for future ACP variants.

Agents that do not understand this action should preserve the raw payload when storing, replaying, proxying, or forwarding elicitation responses. They MUST NOT treat it as a known elicitation action.

type CreateElicitationUrl

type CreateElicitationUrl struct {
	// The _meta property is reserved by ACP to allow clients and agents to attach additional
	// metadata to their interactions. Implementations MUST NOT make assumptions about values at
	// these keys.
	//
	// Optional. Omitted and 'null' are equivalent and mean no metadata.
	//
	// See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v1/draft/extensibility)
	Meta map[string]any `json:"_meta,omitempty"`
	// The unique identifier for this elicitation.
	ElicitationId ElicitationId `json:"elicitationId"`
	// A human-readable message describing what input is needed.
	Message string `json:"message"`
	Mode    string `json:"mode"`
	// The request this elicitation is tied to.
	RequestId *RequestId `json:"requestId,omitzero"`
	// The session this elicitation is tied to.
	SessionId SessionId `json:"sessionId,omitzero"`
	// Optional tool call within the session.
	//
	// Optional. Omitted and 'null' are equivalent and mean the elicitation is scoped to the
	// session without a specific tool call.
	ToolCallId *ToolCallId `json:"toolCallId,omitzero"`
	// The URL to direct the user to.
	Url string `json:"url"`
}

URL-based elicitation where the client directs the user to a URL.

type CreateTerminalRequest

type CreateTerminalRequest struct {
	// The _meta property is reserved by ACP to allow clients and agents to attach additional
	// metadata to their interactions. Implementations MUST NOT make assumptions about values at
	// these keys.
	//
	// See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v1/draft/extensibility)
	Meta map[string]any `json:"_meta,omitempty"`
	// Array of command arguments.
	Args []string `json:"args,omitempty"`
	// The command to execute.
	Command string `json:"command"`
	// Working directory for the command. Must be an absolute path.
	Cwd *string `json:"cwd,omitzero"`
	// Environment variables for the command.
	Env []EnvVariable `json:"env,omitempty"`
	// Maximum number of output bytes to retain.
	//
	// When the limit is exceeded, the Client truncates from the beginning of the output
	// to stay within the limit.
	//
	// The Client MUST ensure truncation happens at a character boundary to maintain valid
	// string output, even if this means the retained output is slightly less than the
	// specified limit.
	OutputByteLimit *int `json:"outputByteLimit,omitzero"`
	// The session ID for this request.
	SessionId SessionId `json:"sessionId"`
}

Request to create a new terminal and execute a command.

func (*CreateTerminalRequest) Validate

func (v *CreateTerminalRequest) Validate() error

type CreateTerminalResponse

type CreateTerminalResponse struct {
	// The _meta property is reserved by ACP to allow clients and agents to attach additional
	// metadata to their interactions. Implementations MUST NOT make assumptions about values at
	// these keys.
	//
	// See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v1/draft/extensibility)
	Meta map[string]any `json:"_meta,omitempty"`
	// The unique identifier for the created terminal.
	TerminalId TerminalId `json:"terminalId"`
}

Response containing the ID of the created terminal.

func (*CreateTerminalResponse) Validate

func (v *CreateTerminalResponse) Validate() error

type CurrentModeUpdate

type CurrentModeUpdate struct {
	// The _meta property is reserved by ACP to allow clients and agents to attach additional
	// metadata to their interactions. Implementations MUST NOT make assumptions about values at
	// these keys.
	//
	// See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v1/draft/extensibility)
	Meta map[string]any `json:"_meta,omitempty"`
	// The ID of the current mode
	CurrentModeId SessionModeId `json:"currentModeId"`
}

The current mode of the session has changed

See protocol docs: [Session Modes](https://agentclientprotocol.com/protocol/v1/draft/session-modes)

type DeleteSessionRequest

type DeleteSessionRequest struct {
	// The _meta property is reserved by ACP to allow clients and agents to attach additional
	// metadata to their interactions. Implementations MUST NOT make assumptions about values at
	// these keys.
	//
	// See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v1/draft/extensibility)
	Meta map[string]any `json:"_meta,omitempty"`
	// The ID of the session to delete.
	SessionId SessionId `json:"sessionId"`
}

Request parameters for deleting an existing session from 'session/list'.

Only available if the Agent supports the 'sessionCapabilities.delete' capability.

func (*DeleteSessionRequest) Validate

func (v *DeleteSessionRequest) Validate() error

type DeleteSessionResponse

type DeleteSessionResponse struct {
	// The _meta property is reserved by ACP to allow clients and agents to attach additional
	// metadata to their interactions. Implementations MUST NOT make assumptions about values at
	// these keys.
	//
	// See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v1/draft/extensibility)
	Meta map[string]any `json:"_meta,omitempty"`
}

Response from deleting a session.

func (*DeleteSessionResponse) Validate

func (v *DeleteSessionResponse) Validate() error

type Diff

type Diff struct {
	// The _meta property is reserved by ACP to allow clients and agents to attach additional
	// metadata to their interactions. Implementations MUST NOT make assumptions about values at
	// these keys.
	//
	// See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v1/draft/extensibility)
	Meta map[string]any `json:"_meta,omitempty"`
	// The new content after modification.
	NewText string `json:"newText"`
	// The original content (omitted or 'null' for new files).
	OldText *string `json:"oldText,omitzero"`
	// The absolute file path being modified.
	Path string `json:"path"`
}

A diff representing file modifications.

Shows changes to files in a format suitable for display in the client UI.

See protocol docs: Content(https://agentclientprotocol.com/protocol/v1/draft/tool-calls#content)

type ElicitationAcceptAction

type ElicitationAcceptAction struct {
	// The user-provided content, if any, as an object matching the requested schema.
	Content map[string]any `json:"content,omitempty"`
}

The user accepted the elicitation and provided content.

type ElicitationCapabilities

type ElicitationCapabilities struct {
	// The _meta property is reserved by ACP to allow clients and agents to attach additional
	// metadata to their interactions. Implementations MUST NOT make assumptions about values at
	// these keys.
	//
	// Optional. Omitted and 'null' are equivalent and mean no metadata.
	//
	// See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v1/draft/extensibility)
	Meta map[string]any `json:"_meta,omitempty"`
	// Whether the client supports form-based elicitation.
	//
	// Optional. Omitted and 'null' are equivalent and mean form support is not advertised.
	// Supplying '{}' explicitly advertises form support.
	Form *ElicitationFormCapabilities `json:"form,omitzero"`
	// Whether the client supports URL-based elicitation.
	//
	// Optional. Omitted or 'null' both mean the client does not advertise support.
	// Supplying '{}' means the client supports URL-based elicitation.
	Url *ElicitationUrlCapabilities `json:"url,omitzero"`
}

Elicitation capabilities supported by the client.

type ElicitationContentValue

type ElicitationContentValue struct {
	// String value accepted in elicitation response content.
	String *ElicitationContentValueString `json:"-"`
	// Integer value accepted in elicitation response content.
	Integer *ElicitationContentValueInteger `json:"-"`
	// Number value accepted in elicitation response content.
	Number *ElicitationContentValueNumber `json:"-"`
	// Boolean value accepted in elicitation response content.
	Boolean *ElicitationContentValueBoolean `json:"-"`
	// String array value accepted in elicitation response content.
	StringArray *ElicitationContentValueStringArray `json:"-"`
}

func (ElicitationContentValue) MarshalJSONTo

func (u ElicitationContentValue) MarshalJSONTo(enc *jsontext.Encoder) error

func (*ElicitationContentValue) UnmarshalJSONFrom

func (u *ElicitationContentValue) UnmarshalJSONFrom(dec *jsontext.Decoder) error

type ElicitationContentValueBoolean

type ElicitationContentValueBoolean bool

Boolean value accepted in elicitation response content.

type ElicitationContentValueInteger

type ElicitationContentValueInteger int

Integer value accepted in elicitation response content.

type ElicitationContentValueNumber

type ElicitationContentValueNumber float64

Number value accepted in elicitation response content.

type ElicitationContentValueString

type ElicitationContentValueString string

Allowed wire representations for 'ElicitationContentValue'. String value accepted in elicitation response content.

type ElicitationContentValueStringArray

type ElicitationContentValueStringArray []string

String array value accepted in elicitation response content.

type ElicitationFormCapabilities

type ElicitationFormCapabilities struct {
	// The _meta property is reserved by ACP to allow clients and agents to attach additional
	// metadata to their interactions. Implementations MUST NOT make assumptions about values at
	// these keys.
	//
	// Optional. Omitted and 'null' are equivalent and mean no metadata.
	//
	// See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v1/draft/extensibility)
	Meta map[string]any `json:"_meta,omitempty"`
}

Form-based elicitation capabilities.

Supplying '{}' means the client supports form-based elicitation.

type ElicitationFormMode

type ElicitationFormMode struct {
	// Tied to a session, optionally to a specific tool call within that session.
	Session *ElicitationSessionScope `json:"-"`
	// Tied to a specific JSON-RPC request outside of a session
	// (e.g., during auth/configuration phases before any session is started).
	Request *ElicitationRequestScope `json:"-"`
}

Form-based elicitation mode where the client renders a form from the provided schema.

func (ElicitationFormMode) MarshalJSONTo

func (u ElicitationFormMode) MarshalJSONTo(enc *jsontext.Encoder) error

func (*ElicitationFormMode) UnmarshalJSONFrom

func (u *ElicitationFormMode) UnmarshalJSONFrom(dec *jsontext.Decoder) error

type ElicitationId

type ElicitationId string

Unique identifier for an elicitation.

type ElicitationPropertySchema

type ElicitationPropertySchema struct {
	// String property (or single-select enum when 'enum'/'oneOf' is set).
	String *ElicitationPropertySchemaString `json:"-"`
	// Number (floating-point) property.
	Number *ElicitationPropertySchemaNumber `json:"-"`
	// Integer property.
	Integer *ElicitationPropertySchemaInteger `json:"-"`
	// Boolean property.
	Boolean *ElicitationPropertySchemaBoolean `json:"-"`
	// Multi-select array property.
	Array *ElicitationPropertySchemaArray `json:"-"`
	// Custom or future elicitation property schema.
	//
	// Values beginning with '_' are reserved for implementation-specific
	// extensions. Unknown values that do not begin with '_' are reserved for
	// future ACP variants.
	//
	// Clients that do not understand this property schema type should preserve
	// the raw schema when storing, replaying, proxying, or forwarding
	// elicitation requests. They MUST NOT render it as a known input control.
	Other *ElicitationPropertySchemaOther `json:"-"`
}

func (ElicitationPropertySchema) MarshalJSONTo

func (u ElicitationPropertySchema) MarshalJSONTo(enc *jsontext.Encoder) error

func (*ElicitationPropertySchema) UnmarshalJSONFrom

func (u *ElicitationPropertySchema) UnmarshalJSONFrom(dec *jsontext.Decoder) error

type ElicitationPropertySchemaArray

type ElicitationPropertySchemaArray struct {
	// The _meta property is reserved by ACP to allow clients and agents to attach additional
	// metadata to their interactions. Implementations MUST NOT make assumptions about values at
	// these keys.
	//
	// Optional. Omitted and 'null' are equivalent and mean no metadata.
	//
	// See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v1/extensibility)
	Meta map[string]any `json:"_meta,omitempty"`
	// Default selected values.
	//
	// Optional. Omitted and 'null' are equivalent and mean no default selections are provided.
	Default []string `json:"default,omitempty"`
	// Human-readable description.
	//
	// Optional. Omitted and 'null' are equivalent and mean no description is provided.
	Description *string `json:"description,omitzero"`
	// The items definition describing allowed values.
	Items MultiSelectItems `json:"items"`
	// Maximum number of items to select.
	//
	// Optional. Omitted and 'null' are equivalent and mean there is no maximum selection count.
	MaxItems *int `json:"maxItems,omitzero"`
	// Minimum number of items to select.
	//
	// Optional. Omitted and 'null' are equivalent and mean there is no minimum selection count.
	MinItems *int `json:"minItems,omitzero"`
	// Optional title for the property.
	//
	// Optional. Omitted and 'null' are equivalent and mean no title is provided.
	Title *string `json:"title,omitzero"`
	Type  string  `json:"type"`
}

Multi-select array property.

type ElicitationPropertySchemaBoolean

type ElicitationPropertySchemaBoolean struct {
	// The _meta property is reserved by ACP to allow clients and agents to attach additional
	// metadata to their interactions. Implementations MUST NOT make assumptions about values at
	// these keys.
	//
	// Optional. Omitted and 'null' are equivalent and mean no metadata.
	//
	// See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v1/extensibility)
	Meta map[string]any `json:"_meta,omitempty"`
	// Default value.
	//
	// Optional. Omitted and 'null' are equivalent and mean no default value is provided.
	Default *bool `json:"default,omitzero"`
	// Human-readable description.
	//
	// Optional. Omitted and 'null' are equivalent and mean no description is provided.
	Description *string `json:"description,omitzero"`
	// Optional title for the property.
	//
	// Optional. Omitted and 'null' are equivalent and mean no title is provided.
	Title *string `json:"title,omitzero"`
	Type  string  `json:"type"`
}

Boolean property.

type ElicitationPropertySchemaInteger

type ElicitationPropertySchemaInteger struct {
	// The _meta property is reserved by ACP to allow clients and agents to attach additional
	// metadata to their interactions. Implementations MUST NOT make assumptions about values at
	// these keys.
	//
	// Optional. Omitted and 'null' are equivalent and mean no metadata.
	//
	// See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v1/extensibility)
	Meta map[string]any `json:"_meta,omitempty"`
	// Default value.
	//
	// Optional. Omitted and 'null' are equivalent and mean no default value is provided.
	Default *int `json:"default,omitzero"`
	// Human-readable description.
	//
	// Optional. Omitted and 'null' are equivalent and mean no description is provided.
	Description *string `json:"description,omitzero"`
	// Maximum value (inclusive).
	//
	// Optional. Omitted and 'null' are equivalent and mean there is no inclusive upper bound.
	Maximum *int `json:"maximum,omitzero"`
	// Minimum value (inclusive).
	//
	// Optional. Omitted and 'null' are equivalent and mean there is no inclusive lower bound.
	Minimum *int `json:"minimum,omitzero"`
	// Optional title for the property.
	//
	// Optional. Omitted and 'null' are equivalent and mean no title is provided.
	Title *string `json:"title,omitzero"`
	Type  string  `json:"type"`
}

Integer property.

type ElicitationPropertySchemaNumber

type ElicitationPropertySchemaNumber struct {
	// The _meta property is reserved by ACP to allow clients and agents to attach additional
	// metadata to their interactions. Implementations MUST NOT make assumptions about values at
	// these keys.
	//
	// Optional. Omitted and 'null' are equivalent and mean no metadata.
	//
	// See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v1/extensibility)
	Meta map[string]any `json:"_meta,omitempty"`
	// Default value.
	//
	// Optional. Omitted and 'null' are equivalent and mean no default value is provided.
	Default *float64 `json:"default,omitzero"`
	// Human-readable description.
	//
	// Optional. Omitted and 'null' are equivalent and mean no description is provided.
	Description *string `json:"description,omitzero"`
	// Maximum value (inclusive).
	//
	// Optional. Omitted and 'null' are equivalent and mean there is no inclusive upper bound.
	Maximum *float64 `json:"maximum,omitzero"`
	// Minimum value (inclusive).
	//
	// Optional. Omitted and 'null' are equivalent and mean there is no inclusive lower bound.
	Minimum *float64 `json:"minimum,omitzero"`
	// Optional title for the property.
	//
	// Optional. Omitted and 'null' are equivalent and mean no title is provided.
	Title *string `json:"title,omitzero"`
	Type  string  `json:"type"`
}

Number (floating-point) property.

type ElicitationPropertySchemaOther

type ElicitationPropertySchemaOther struct {
	// Custom or future elicitation property schema type.
	//
	// Values beginning with '_' are reserved for implementation-specific
	// extensions. Unknown values that do not begin with '_' are reserved for
	// future ACP variants.
	Type string `json:"type"`
}

Custom or future elicitation property schema.

Values beginning with '_' are reserved for implementation-specific extensions. Unknown values that do not begin with '_' are reserved for future ACP variants.

Clients that do not understand this property schema type should preserve the raw schema when storing, replaying, proxying, or forwarding elicitation requests. They MUST NOT render it as a known input control.

type ElicitationPropertySchemaString

type ElicitationPropertySchemaString struct {
	// The _meta property is reserved by ACP to allow clients and agents to attach additional
	// metadata to their interactions. Implementations MUST NOT make assumptions about values at
	// these keys.
	//
	// Optional. Omitted and 'null' are equivalent and mean no metadata.
	//
	// See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v1/extensibility)
	Meta map[string]any `json:"_meta,omitempty"`
	// Default value.
	//
	// Optional. Omitted and 'null' are equivalent and mean no default value is provided.
	Default *string `json:"default,omitzero"`
	// Human-readable description.
	//
	// Optional. Omitted and 'null' are equivalent and mean no description is provided.
	Description *string `json:"description,omitzero"`
	// Enum values for untitled single-select enums.
	// Optional. Omitted and 'null' are equivalent and mean no untitled single-select choices are
	// declared by 'enum'.
	Enum []string `json:"enum,omitempty"`
	// String format.
	//
	// Optional. Omitted and 'null' are equivalent and mean there is no format constraint.
	Format *StringFormat `json:"format,omitzero"`
	// Maximum string length.
	//
	// Optional. Omitted and 'null' are equivalent and mean there is no maximum length constraint.
	MaxLength *int `json:"maxLength,omitzero"`
	// Minimum string length.
	//
	// Optional. Omitted and 'null' are equivalent and mean there is no minimum length constraint.
	MinLength *int `json:"minLength,omitzero"`
	// Titled enum options for titled single-select enums.
	// Optional. Omitted and 'null' are equivalent and mean no titled single-select choices are
	// declared by 'oneOf'.
	OneOf []EnumOption `json:"oneOf,omitempty"`
	// Pattern the string must match.
	//
	// Optional. Omitted and 'null' are equivalent and mean there is no pattern constraint.
	Pattern *string `json:"pattern,omitzero"`
	// Optional title for the property.
	//
	// Optional. Omitted and 'null' are equivalent and mean no title is provided.
	Title *string `json:"title,omitzero"`
	Type  string  `json:"type"`
}

Property schema for elicitation form fields.

Each variant corresponds to a JSON Schema '"type"' value. Single-select enums use 'type: "string"' with 'enum' or 'oneOf' set. Multi-select enums use 'type: "array"'. String property (or single-select enum when 'enum'/'oneOf' is set).

type ElicitationRequestScope

type ElicitationRequestScope struct {
	// The request this elicitation is tied to.
	RequestId RequestId `json:"requestId"`
}

Request-scoped elicitation, tied to a specific JSON-RPC request outside of a session (e.g., during auth/configuration phases before any session is started).

type ElicitationSchema

type ElicitationSchema struct {
	// The _meta property is reserved by ACP to allow clients and agents to attach additional
	// metadata to their interactions. Implementations MUST NOT make assumptions about values at
	// these keys.
	//
	// Optional. Omitted and 'null' are equivalent and mean no metadata.
	//
	// See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v1/draft/extensibility)
	Meta map[string]any `json:"_meta,omitempty"`
	// Optional description of what this schema represents.
	//
	// Optional. Omitted and 'null' are equivalent and mean no schema description is provided.
	Description *string `json:"description,omitzero"`
	// Property definitions (must be primitive types).
	//
	// Defaults to {} if unset.
	Properties map[string]any `json:"properties"`
	// List of required property names.
	//
	// Optional. Omitted and 'null' are equivalent and mean no property names are required.
	Required []string `json:"required,omitempty"`
	// Optional title for the schema.
	//
	// Optional. Omitted and 'null' are equivalent and mean no title is provided.
	Title *string `json:"title,omitzero"`
	// Type discriminator. Always '"object"'.
	//
	// Defaults to "object" if unset.
	Type ElicitationSchemaType `json:"type,omitzero"`
}

Type-safe elicitation schema for requesting structured user input.

This represents a JSON Schema object with primitive-typed properties, as required by the elicitation specification.

func (ElicitationSchema) MarshalJSONTo

func (v ElicitationSchema) MarshalJSONTo(enc *jsontext.Encoder) error

func (*ElicitationSchema) UnmarshalJSONFrom

func (v *ElicitationSchema) UnmarshalJSONFrom(dec *jsontext.Decoder) error

type ElicitationSchemaType

type ElicitationSchemaType string

Type discriminator for elicitation schemas.

const (
	ElicitationSchemaTypeObject ElicitationSchemaType = "object"
)

type ElicitationSessionScope

type ElicitationSessionScope struct {
	// The session this elicitation is tied to.
	SessionId SessionId `json:"sessionId"`
	// Optional tool call within the session.
	//
	// Optional. Omitted and 'null' are equivalent and mean the elicitation is scoped to the
	// session without a specific tool call.
	ToolCallId *ToolCallId `json:"toolCallId,omitzero"`
}

Session-scoped elicitation, optionally tied to a specific tool call.

When 'toolCallId' is set, the elicitation is tied to a specific tool call. This is useful when an agent receives an elicitation from an MCP server during a tool call and needs to redirect it to the user.

type ElicitationUrlCapabilities

type ElicitationUrlCapabilities struct {
	// The _meta property is reserved by ACP to allow clients and agents to attach additional
	// metadata to their interactions. Implementations MUST NOT make assumptions about values at
	// these keys.
	//
	// Optional. Omitted and 'null' are equivalent and mean no metadata.
	//
	// See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v1/draft/extensibility)
	Meta map[string]any `json:"_meta,omitempty"`
}

URL-based elicitation capabilities.

Supplying '{}' means the client supports URL-based elicitation.

type ElicitationUrlMode

type ElicitationUrlMode struct {
	// Tied to a session, optionally to a specific tool call within that session.
	Session *ElicitationSessionScope `json:"-"`
	// Tied to a specific JSON-RPC request outside of a session
	// (e.g., during auth/configuration phases before any session is started).
	Request *ElicitationRequestScope `json:"-"`
}

URL-based elicitation mode where the client directs the user to a URL.

func (ElicitationUrlMode) MarshalJSONTo

func (u ElicitationUrlMode) MarshalJSONTo(enc *jsontext.Encoder) error

func (*ElicitationUrlMode) UnmarshalJSONFrom

func (u *ElicitationUrlMode) UnmarshalJSONFrom(dec *jsontext.Decoder) error

type EmbeddedResource

type EmbeddedResource struct {
	// The _meta property is reserved by ACP to allow clients and agents to attach additional
	// metadata to their interactions. Implementations MUST NOT make assumptions about values at
	// these keys.
	//
	// See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v1/draft/extensibility)
	Meta map[string]any `json:"_meta,omitempty"`
	// Optional annotations that help clients decide how to display or route this content.
	Annotations *Annotations `json:"annotations,omitzero"`
	// Embedded resource payload, either text or binary data.
	Resource EmbeddedResourceResource `json:"resource"`
}

The contents of a resource, embedded into a prompt or tool call result.

type EmbeddedResourceResource

type EmbeddedResourceResource struct {
	// Text resource contents embedded directly in the message.
	TextResourceContents *TextResourceContents `json:"-"`
	// Binary resource contents embedded directly in the message.
	BlobResourceContents *BlobResourceContents `json:"-"`
}

Resource content that can be embedded in a message.

func (EmbeddedResourceResource) MarshalJSONTo

func (u EmbeddedResourceResource) MarshalJSONTo(enc *jsontext.Encoder) error

func (*EmbeddedResourceResource) UnmarshalJSONFrom

func (u *EmbeddedResourceResource) UnmarshalJSONFrom(dec *jsontext.Decoder) error

type EnumOption

type EnumOption struct {
	// The _meta property is reserved by ACP to allow clients and agents to attach additional
	// metadata to their interactions. Implementations MUST NOT make assumptions about values at
	// these keys.
	//
	// Optional. Omitted and 'null' are equivalent and mean no metadata.
	//
	// See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v1/extensibility)
	Meta map[string]any `json:"_meta,omitempty"`
	// The constant value for this option.
	Const string `json:"const"`
	// Human-readable description.
	//
	// Optional. Omitted and 'null' are equivalent and mean no description is provided.
	Description *string `json:"description,omitzero"`
	// Human-readable title for this option.
	Title string `json:"title"`
}

A titled enum option with a const value, human-readable title, and optional description.

type EnvVariable

type EnvVariable struct {
	// The _meta property is reserved by ACP to allow clients and agents to attach additional
	// metadata to their interactions. Implementations MUST NOT make assumptions about values at
	// these keys.
	//
	// See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v1/draft/extensibility)
	Meta map[string]any `json:"_meta,omitempty"`
	// The name of the environment variable.
	Name string `json:"name"`
	// The value to set for the environment variable.
	Value string `json:"value"`
}

An environment variable to set when launching an MCP server.

type Error

type Error struct {
	// A number indicating the error type that occurred.
	// This must be an integer as defined in the JSON-RPC specification.
	Code ErrorCode `json:"code"`
	// Optional primitive or structured value that contains additional information about the error.
	// This may include debugging information or context-specific details.
	Data any `json:"data,omitzero"`
	// A string providing a short description of the error.
	// The message should be limited to a concise single sentence.
	Message string `json:"message"`
}

JSON-RPC error object.

Represents an error that occurred during method execution, following the JSON-RPC 2.0 error object specification with optional additional data.

See protocol docs: [JSON-RPC Error Object](https://www.jsonrpc.org/specification#error_object)

type ErrorCode

type ErrorCode struct {
	// **Parse error**: Invalid JSON was received by the server.
	// An error occurred on the server while parsing the JSON text.
	ParseError *ErrorCodeParseError `json:"-"`
	// **Invalid request**: The JSON sent is not a valid Request object.
	InvalidRequest *ErrorCodeInvalidRequest `json:"-"`
	// **Method not found**: The method does not exist or is not available.
	MethodNotFound *ErrorCodeMethodNotFound `json:"-"`
	// **Invalid params**: Invalid method parameter(s).
	InvalidParams *ErrorCodeInvalidParams `json:"-"`
	// **Internal error**: Internal JSON-RPC error.
	InternalError *ErrorCodeInternalError `json:"-"`
	// **Request cancelled**: Execution of the method was aborted either due to a cancellation request from the caller or
	// because of resource constraints or shutdown.
	RequestCancelled *ErrorCodeRequestCancelled `json:"-"`
	// **Authentication required**: Authentication is required before this operation can be performed.
	AuthenticationRequired *ErrorCodeAuthenticationRequired `json:"-"`
	// **Resource not found**: A given resource, such as a session or file, was not found.
	ResourceNotFound *ErrorCodeResourceNotFound `json:"-"`
	// Other undefined error code.
	Other *ErrorCodeOther `json:"-"`
}

func (ErrorCode) MarshalJSONTo

func (u ErrorCode) MarshalJSONTo(enc *jsontext.Encoder) error

func (*ErrorCode) UnmarshalJSONFrom

func (u *ErrorCode) UnmarshalJSONFrom(dec *jsontext.Decoder) error

type ErrorCodeAuthenticationRequired

type ErrorCodeAuthenticationRequired int

**Authentication required**: Authentication is required before this operation can be performed.

type ErrorCodeInternalError

type ErrorCodeInternalError int

**Internal error**: Internal JSON-RPC error.

type ErrorCodeInvalidParams

type ErrorCodeInvalidParams int

**Invalid params**: Invalid method parameter(s).

type ErrorCodeInvalidRequest

type ErrorCodeInvalidRequest int

**Invalid request**: The JSON sent is not a valid Request object.

type ErrorCodeMethodNotFound

type ErrorCodeMethodNotFound int

**Method not found**: The method does not exist or is not available.

type ErrorCodeOther

type ErrorCodeOther int

Other undefined error code.

type ErrorCodeParseError

type ErrorCodeParseError int

Predefined error codes for common JSON-RPC and ACP-specific errors.

Standard errors use the JSON-RPC 2.0 codes. ACP-specific errors use the JSON-RPC server-error range (-32000 to -32099), and request cancellation uses -32800 from the range LSP reserves (-32899 to -32800). **Parse error**: Invalid JSON was received by the server. An error occurred on the server while parsing the JSON text.

type ErrorCodeRequestCancelled

type ErrorCodeRequestCancelled int

**Request cancelled**: Execution of the method was aborted either due to a cancellation request from the caller or because of resource constraints or shutdown.

type ErrorCodeResourceNotFound

type ErrorCodeResourceNotFound int

**Resource not found**: A given resource, such as a session or file, was not found.

type ErrorStopReason

type ErrorStopReason struct {
	// The failure, as a JSON-RPC error object.
	//
	// Optional. Omitted or 'null' both mean the agent is not reporting failure details.
	// Agents SHOULD include it.
	Error *Error `json:"error,omitzero"`
}

**UNSTABLE**

This capability is not part of the spec yet, and may be removed or changed at any point.

Details of a failure that ended a child's foreground work.

type ExtNotification

type ExtNotification any

Allows either side to send an arbitrary notification that is not part of the ACP spec. Extension notifications provide a way to send one-way messages for custom functionality while maintaining protocol compatibility.

See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v1/extensibility) ExtNotification is a union or complex schema; represented generically.

type ExtRequest

type ExtRequest any

Allows for sending an arbitrary request that is not part of the ACP spec. Extension methods provide a way to add custom functionality while maintaining protocol compatibility.

See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v1/extensibility) ExtRequest is a union or complex schema; represented generically.

type ExtResponse

type ExtResponse any

Allows for sending an arbitrary response to an extension request that is not part of the ACP spec. Extension methods provide a way to add custom functionality while maintaining protocol compatibility.

See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v1/extensibility) ExtResponse is a union or complex schema; represented generically.

type FileSystemCapabilities

type FileSystemCapabilities struct {
	// The _meta property is reserved by ACP to allow clients and agents to attach additional
	// metadata to their interactions. Implementations MUST NOT make assumptions about values at
	// these keys.
	//
	// See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v1/draft/extensibility)
	Meta map[string]any `json:"_meta,omitempty"`
	// Whether the Client supports 'fs/read_text_file' requests.
	//
	// Defaults to false if unset.
	ReadTextFile bool `json:"readTextFile,omitzero"`
	// Whether the Client supports 'fs/write_text_file' requests.
	//
	// Defaults to false if unset.
	WriteTextFile bool `json:"writeTextFile,omitzero"`
}

File system capabilities that a client may support.

See protocol docs: [FileSystem](https://agentclientprotocol.com/protocol/v1/draft/initialization#filesystem)

func (FileSystemCapabilities) MarshalJSONTo

func (v FileSystemCapabilities) MarshalJSONTo(enc *jsontext.Encoder) error

type HttpHeader

type HttpHeader struct {
	// The _meta property is reserved by ACP to allow clients and agents to attach additional
	// metadata to their interactions. Implementations MUST NOT make assumptions about values at
	// these keys.
	//
	// See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v1/draft/extensibility)
	Meta map[string]any `json:"_meta,omitempty"`
	// The name of the HTTP header.
	Name string `json:"name"`
	// The value to set for the HTTP header.
	Value string `json:"value"`
}

An HTTP header to set when making requests to the MCP server.

type IdleStateUpdate

type IdleStateUpdate struct {
	// The work ended successfully.
	EndTurn *IdleStateUpdateEndTurn `json:"-"`
	// The work ended because the agent reached the maximum number of tokens.
	MaxTokens *IdleStateUpdateMaxTokens `json:"-"`
	// The work ended because the agent reached the maximum number of allowed
	// agent requests.
	MaxTurnRequests *IdleStateUpdateMaxTurnRequests `json:"-"`
	// The work ended because the agent refused to continue.
	Refusal *IdleStateUpdateRefusal `json:"-"`
	// The work was cancelled.
	Cancelled *IdleStateUpdateCancelled `json:"-"`
	// The work ended because something failed.
	Error *IdleStateUpdateError `json:"-"`
	// Custom or future stop reason.
	//
	// Values beginning with '_' are reserved for implementation-specific
	// extensions. Other unknown values are reserved for future ACP variants.
	Other *IdleStateUpdateOther `json:"-"`
	// No stop reason: 'stopReason' is omitted or 'null'.
	None *IdleStateUpdateNone `json:"-"`
}

func (IdleStateUpdate) MarshalJSONTo

func (u IdleStateUpdate) MarshalJSONTo(enc *jsontext.Encoder) error

func (*IdleStateUpdate) UnmarshalJSONFrom

func (u *IdleStateUpdate) UnmarshalJSONFrom(dec *jsontext.Decoder) error

type IdleStateUpdateCancelled

type IdleStateUpdateCancelled struct {
	// The _meta property is reserved by ACP for additional metadata.
	// Implementations MUST NOT make assumptions about values at these keys.
	// Optional. Omitted and 'null' mean no metadata for this state snapshot.
	Meta       map[string]any `json:"_meta,omitempty"`
	StopReason string         `json:"stopReason"`
	// **UNSTABLE** Token usage for completed foreground work.
	//
	// Optional. Omitted or 'null' means not reported.
	Usage *Usage `json:"usage,omitzero"`
}

The work was cancelled.

type IdleStateUpdateEndTurn

type IdleStateUpdateEndTurn struct {
	// The _meta property is reserved by ACP for additional metadata.
	// Implementations MUST NOT make assumptions about values at these keys.
	// Optional. Omitted and 'null' mean no metadata for this state snapshot.
	Meta       map[string]any `json:"_meta,omitempty"`
	StopReason string         `json:"stopReason"`
	// **UNSTABLE** Token usage for completed foreground work.
	//
	// Optional. Omitted or 'null' means not reported.
	Usage *Usage `json:"usage,omitzero"`
}

The child is ready to process another prompt.

An omitted, 'null', or malformed 'stopReason' means not reported. The work ended successfully.

type IdleStateUpdateError

type IdleStateUpdateError struct {
	// The _meta property is reserved by ACP for additional metadata.
	// Implementations MUST NOT make assumptions about values at these keys.
	// Optional. Omitted and 'null' mean no metadata for this state snapshot.
	Meta map[string]any `json:"_meta,omitempty"`
	// The failure, as a JSON-RPC error object.
	//
	// Optional. Omitted or 'null' both mean the agent is not reporting failure details.
	// Agents SHOULD include it.
	Error      *Error `json:"error,omitzero"`
	StopReason string `json:"stopReason"`
	// **UNSTABLE** Token usage for completed foreground work.
	//
	// Optional. Omitted or 'null' means not reported.
	Usage *Usage `json:"usage,omitzero"`
}

The work ended because something failed.

type IdleStateUpdateMaxTokens

type IdleStateUpdateMaxTokens struct {
	// The _meta property is reserved by ACP for additional metadata.
	// Implementations MUST NOT make assumptions about values at these keys.
	// Optional. Omitted and 'null' mean no metadata for this state snapshot.
	Meta       map[string]any `json:"_meta,omitempty"`
	StopReason string         `json:"stopReason"`
	// **UNSTABLE** Token usage for completed foreground work.
	//
	// Optional. Omitted or 'null' means not reported.
	Usage *Usage `json:"usage,omitzero"`
}

The work ended because the agent reached the maximum number of tokens.

type IdleStateUpdateMaxTurnRequests

type IdleStateUpdateMaxTurnRequests struct {
	// The _meta property is reserved by ACP for additional metadata.
	// Implementations MUST NOT make assumptions about values at these keys.
	// Optional. Omitted and 'null' mean no metadata for this state snapshot.
	Meta       map[string]any `json:"_meta,omitempty"`
	StopReason string         `json:"stopReason"`
	// **UNSTABLE** Token usage for completed foreground work.
	//
	// Optional. Omitted or 'null' means not reported.
	Usage *Usage `json:"usage,omitzero"`
}

The work ended because the agent reached the maximum number of allowed agent requests.

type IdleStateUpdateNone

type IdleStateUpdateNone struct {
	// The _meta property is reserved by ACP for additional metadata.
	// Implementations MUST NOT make assumptions about values at these keys.
	// Optional. Omitted and 'null' mean no metadata for this state snapshot.
	Meta       map[string]any `json:"_meta,omitempty"`
	StopReason any            `json:"stopReason,omitzero"`
	// **UNSTABLE** Token usage for completed foreground work.
	//
	// Optional. Omitted or 'null' means not reported.
	Usage *Usage `json:"usage,omitzero"`
}

No stop reason: 'stopReason' is omitted or 'null'.

type IdleStateUpdateOther

type IdleStateUpdateOther struct {
	// The _meta property is reserved by ACP for additional metadata.
	// Implementations MUST NOT make assumptions about values at these keys.
	// Optional. Omitted and 'null' mean no metadata for this state snapshot.
	Meta map[string]any `json:"_meta,omitempty"`
	// Unrecognized stop reason.
	StopReason string `json:"stopReason"`
	// **UNSTABLE** Token usage for completed foreground work.
	//
	// Optional. Omitted or 'null' means not reported.
	Usage *Usage `json:"usage,omitzero"`
}

Custom or future stop reason.

Values beginning with '_' are reserved for implementation-specific extensions. Other unknown values are reserved for future ACP variants.

type IdleStateUpdateRefusal

type IdleStateUpdateRefusal struct {
	// The _meta property is reserved by ACP for additional metadata.
	// Implementations MUST NOT make assumptions about values at these keys.
	// Optional. Omitted and 'null' mean no metadata for this state snapshot.
	Meta       map[string]any `json:"_meta,omitempty"`
	StopReason string         `json:"stopReason"`
	// **UNSTABLE** Token usage for completed foreground work.
	//
	// Optional. Omitted or 'null' means not reported.
	Usage *Usage `json:"usage,omitzero"`
}

The work ended because the agent refused to continue.

type ImageContent

type ImageContent struct {
	// The _meta property is reserved by ACP to allow clients and agents to attach additional
	// metadata to their interactions. Implementations MUST NOT make assumptions about values at
	// these keys.
	//
	// See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v1/draft/extensibility)
	Meta map[string]any `json:"_meta,omitempty"`
	// Optional annotations that help clients decide how to display or route this content.
	Annotations *Annotations `json:"annotations,omitzero"`
	// Base64-encoded media payload.
	Data string `json:"data"`
	// MIME type describing the encoded media payload.
	MimeType string `json:"mimeType"`
	// URI associated with this resource or media payload.
	Uri *string `json:"uri,omitzero"`
}

An image provided to or from an LLM.

type Implementation

type Implementation struct {
	// The _meta property is reserved by ACP to allow clients and agents to attach additional
	// metadata to their interactions. Implementations MUST NOT make assumptions about values at
	// these keys.
	//
	// See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v1/draft/extensibility)
	Meta map[string]any `json:"_meta,omitempty"`
	// Intended for programmatic or logical use, but can be used as a display
	// name fallback if title isn't present.
	Name string `json:"name"`
	// Intended for UI and end-user contexts and optimized to be human-readable
	// and easily understood.
	//
	// If not provided, the name should be used for display.
	Title *string `json:"title,omitzero"`
	// Version of the implementation. Can be displayed to the user or used
	// for debugging or metrics purposes. (e.g. "1.0.0").
	Version string `json:"version"`
}

Metadata about the implementation of the client or agent. Describes the name and version of an ACP implementation, with an optional title for UI representation.

type InitialSessionConfigOption

type InitialSessionConfigOption struct {
	// A boolean value ('type: "boolean"').
	Boolean *InitialSessionConfigOptionBoolean `json:"-"`
	// A 'SessionConfigValueId' string value.
	//
	// This is the default when 'type' is absent on the wire. Unknown 'type'
	// values with string payloads also gracefully deserialize into this
	// variant.
	ValueId *InitialSessionConfigOptionValueId `json:"-"`
}

func (InitialSessionConfigOption) MarshalJSONTo

func (u InitialSessionConfigOption) MarshalJSONTo(enc *jsontext.Encoder) error

func (*InitialSessionConfigOption) UnmarshalJSONFrom

func (u *InitialSessionConfigOption) UnmarshalJSONFrom(dec *jsontext.Decoder) error

type InitialSessionConfigOptionBoolean

type InitialSessionConfigOptionBoolean struct {
	// The _meta property is reserved by ACP to allow clients and agents to attach additional
	// metadata to their interactions. Implementations MUST NOT make assumptions about values at
	// these keys.
	//
	// See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v1/draft/extensibility)
	Meta map[string]any `json:"_meta,omitempty"`
	// The ID of the configuration option to set.
	ConfigId SessionConfigId `json:"configId"`
	Type     string          `json:"type"`
	// The boolean value.
	Value bool `json:"value"`
}

**UNSTABLE**

This capability is not part of the spec yet, and may be removed or changed at any point.

An initial value for a config option, sent on session setup requests.

Same shape as 'session/set_config_option' without 'sessionId'. Unlike 'session/set_config_option', an unknown 'configId', a 'type' that does not match the option, or a value that is not allowed is ignored instead of rejected.

Clients only send 'type: "boolean"' entries when they advertise 'sessionCapabilities.configOptions.boolean'. A boolean value ('type: "boolean"').

type InitialSessionConfigOptionValueId

type InitialSessionConfigOptionValueId struct {
	// The _meta property is reserved by ACP to allow clients and agents to attach additional
	// metadata to their interactions. Implementations MUST NOT make assumptions about values at
	// these keys.
	//
	// See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v1/draft/extensibility)
	Meta map[string]any `json:"_meta,omitempty"`
	// The ID of the configuration option to set.
	ConfigId SessionConfigId `json:"configId"`
	// The value ID.
	Value SessionConfigValueId `json:"value"`
}

A 'SessionConfigValueId' string value.

This is the default when 'type' is absent on the wire. Unknown 'type' values with string payloads also gracefully deserialize into this variant.

type InitializeRequest

type InitializeRequest struct {
	// The _meta property is reserved by ACP to allow clients and agents to attach additional
	// metadata to their interactions. Implementations MUST NOT make assumptions about values at
	// these keys.
	//
	// See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v1/draft/extensibility)
	Meta map[string]any `json:"_meta,omitempty"`
	// Capabilities supported by the client.
	//
	// Defaults to {"auth":{"terminal":false},"fs":{"readTextFile":false,"writeTextFile":false},"terminal":false} if unset.
	ClientCapabilities ClientCapabilities `json:"clientCapabilities"`
	// Information about the Client name and version sent to the Agent.
	//
	// Note: in future versions of the protocol, this will be required.
	ClientInfo *Implementation `json:"clientInfo,omitzero"`
	// The latest protocol version supported by the client.
	ProtocolVersion ProtocolVersion `json:"protocolVersion"`
}

Request parameters for the initialize method.

Sent by the client to establish connection and negotiate capabilities.

See protocol docs: [Initialization](https://agentclientprotocol.com/protocol/v1/draft/initialization)

func (InitializeRequest) MarshalJSONTo

func (v InitializeRequest) MarshalJSONTo(enc *jsontext.Encoder) error

func (*InitializeRequest) UnmarshalJSONFrom

func (v *InitializeRequest) UnmarshalJSONFrom(dec *jsontext.Decoder) error

func (*InitializeRequest) Validate

func (v *InitializeRequest) Validate() error

type InitializeResponse

type InitializeResponse struct {
	// The _meta property is reserved by ACP to allow clients and agents to attach additional
	// metadata to their interactions. Implementations MUST NOT make assumptions about values at
	// these keys.
	//
	// See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v1/draft/extensibility)
	Meta map[string]any `json:"_meta,omitempty"`
	// Capabilities supported by the agent.
	//
	// Defaults to {"auth":{},"loadSession":false,"mcpCapabilities":{"acp":false,"http":false,"sse":false},"promptCapabilities":{"audio":false,"embeddedContext":false,"image":false},"sessionCapabilities":{}} if unset.
	AgentCapabilities AgentCapabilities `json:"agentCapabilities"`
	// Information about the Agent name and version sent to the Client.
	//
	// Note: in future versions of the protocol, this will be required.
	AgentInfo *Implementation `json:"agentInfo,omitzero"`
	// Authentication methods supported by the agent.
	//
	// Defaults to [] if unset.
	AuthMethods []AuthMethod `json:"authMethods"`
	// The protocol version the client specified if supported by the agent,
	// or the latest protocol version supported by the agent.
	//
	// The client should disconnect, if it doesn't support this version.
	ProtocolVersion ProtocolVersion `json:"protocolVersion"`
}

Response to the 'initialize' method.

Contains the negotiated protocol version and agent capabilities.

See protocol docs: [Initialization](https://agentclientprotocol.com/protocol/v1/draft/initialization)

func (InitializeResponse) MarshalJSONTo

func (v InitializeResponse) MarshalJSONTo(enc *jsontext.Encoder) error

func (*InitializeResponse) UnmarshalJSONFrom

func (v *InitializeResponse) UnmarshalJSONFrom(dec *jsontext.Decoder) error

func (*InitializeResponse) Validate

func (v *InitializeResponse) Validate() error

type IntegerPropertySchema

type IntegerPropertySchema struct {
	// The _meta property is reserved by ACP to allow clients and agents to attach additional
	// metadata to their interactions. Implementations MUST NOT make assumptions about values at
	// these keys.
	//
	// Optional. Omitted and 'null' are equivalent and mean no metadata.
	//
	// See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v1/extensibility)
	Meta map[string]any `json:"_meta,omitempty"`
	// Default value.
	//
	// Optional. Omitted and 'null' are equivalent and mean no default value is provided.
	Default *int `json:"default,omitzero"`
	// Human-readable description.
	//
	// Optional. Omitted and 'null' are equivalent and mean no description is provided.
	Description *string `json:"description,omitzero"`
	// Maximum value (inclusive).
	//
	// Optional. Omitted and 'null' are equivalent and mean there is no inclusive upper bound.
	Maximum *int `json:"maximum,omitzero"`
	// Minimum value (inclusive).
	//
	// Optional. Omitted and 'null' are equivalent and mean there is no inclusive lower bound.
	Minimum *int `json:"minimum,omitzero"`
	// Optional title for the property.
	//
	// Optional. Omitted and 'null' are equivalent and mean no title is provided.
	Title *string `json:"title,omitzero"`
}

Schema for integer properties in an elicitation form.

type KillTerminalRequest

type KillTerminalRequest struct {
	// The _meta property is reserved by ACP to allow clients and agents to attach additional
	// metadata to their interactions. Implementations MUST NOT make assumptions about values at
	// these keys.
	//
	// See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v1/draft/extensibility)
	Meta map[string]any `json:"_meta,omitempty"`
	// The session ID for this request.
	SessionId SessionId `json:"sessionId"`
	// The ID of the terminal to kill.
	TerminalId TerminalId `json:"terminalId"`
}

Request to kill a terminal without releasing it.

func (*KillTerminalRequest) Validate

func (v *KillTerminalRequest) Validate() error

type KillTerminalResponse

type KillTerminalResponse struct {
	// The _meta property is reserved by ACP to allow clients and agents to attach additional
	// metadata to their interactions. Implementations MUST NOT make assumptions about values at
	// these keys.
	//
	// See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v1/draft/extensibility)
	Meta map[string]any `json:"_meta,omitempty"`
}

Response to 'terminal/kill' method

func (*KillTerminalResponse) Validate

func (v *KillTerminalResponse) Validate() error

type ListSessionsRequest

type ListSessionsRequest struct {
	// The _meta property is reserved by ACP to allow clients and agents to attach additional
	// metadata to their interactions. Implementations MUST NOT make assumptions about values at
	// these keys.
	//
	// See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v1/draft/extensibility)
	Meta map[string]any `json:"_meta,omitempty"`
	// **UNSTABLE**
	//
	// This capability is not part of the spec yet, and may be removed or changed at any point.
	//
	// Filter sessions by archive state.
	//
	// Optional. Omitted and 'null' are equivalent and mean 'exclude'. Only send this when
	// the Agent advertises the 'sessionCapabilities.archive' capability. The filter combines with 'cwd' and
	// applies before pagination. Clients keep the same value when following 'nextCursor'.
	Archived *SessionArchiveFilter `json:"archived,omitzero"`
	// Opaque cursor token from a previous response's nextCursor field for cursor-based pagination
	Cursor *string `json:"cursor,omitzero"`
	// Filter sessions by working directory. Must be an absolute path.
	Cwd *string `json:"cwd,omitzero"`
}

Request parameters for listing existing sessions.

Only available if the Agent supports the 'sessionCapabilities.list' capability.

func (*ListSessionsRequest) Validate

func (v *ListSessionsRequest) Validate() error

type ListSessionsResponse

type ListSessionsResponse struct {
	// The _meta property is reserved by ACP to allow clients and agents to attach additional
	// metadata to their interactions. Implementations MUST NOT make assumptions about values at
	// these keys.
	//
	// See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v1/draft/extensibility)
	Meta map[string]any `json:"_meta,omitempty"`
	// Opaque cursor token. If present, pass this in the next request's cursor parameter
	// to fetch the next page. If absent, there are no more results.
	NextCursor *string `json:"nextCursor,omitzero"`
	// Array of session information objects
	Sessions []SessionInfo `json:"sessions"`
}

Response from listing sessions.

func (*ListSessionsResponse) Validate

func (v *ListSessionsResponse) Validate() error

type LoadSessionRequest

type LoadSessionRequest struct {
	// The _meta property is reserved by ACP to allow clients and agents to attach additional
	// metadata to their interactions. Implementations MUST NOT make assumptions about values at
	// these keys.
	//
	// See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v1/draft/extensibility)
	Meta map[string]any `json:"_meta,omitempty"`
	// Additional workspace roots to activate for this session. Each path must be absolute.
	//
	// When omitted or empty, no additional roots are activated. When non-empty,
	// this is the complete resulting additional-root list for the loaded
	// session. It may differ from any previously used or reported list as long as
	// the request 'cwd' matches the session's 'cwd'.
	AdditionalDirectories []string `json:"additionalDirectories,omitempty"`
	// **UNSTABLE**
	//
	// This capability is not part of the spec yet, and may be removed or changed at any point.
	//
	// Initial values for the session's config options.
	//
	// Optional. Omitted and 'null' are equivalent to an empty list. Clients MUST only send
	// this when the Agent advertises 'sessionCapabilities.options'.
	//
	// The Agent applies the entries in list order, as if the Client had called
	// 'session/set_config_option' for each entry after the session was set up. Malformed
	// entries and duplicate 'configId' values fail the request with '-32602'. The Agent MUST
	// ignore an entry whose 'configId' is unknown, whose 'type' does not match the option,
	// or whose value is not allowed when it is applied. The 'configOptions' in the response contain the values the session actually
	// has. The Agent SHOULD NOT send 'config_option_update' notifications for these entries.
	ConfigOptions []InitialSessionConfigOption `json:"configOptions,omitempty"`
	// The working directory for this session. Must be an absolute path.
	Cwd string `json:"cwd"`
	// List of MCP servers to connect to for this session.
	McpServers []McpServer `json:"mcpServers"`
	// The ID of the session to load.
	SessionId SessionId `json:"sessionId"`
	// System-level instructions for the loaded session.
	//
	// Optional. Omitted and 'null' are equivalent. The Agent may then keep a
	// system prompt it stored with the session or use its default instructions.
	// Clients MUST only send this when the Agent advertises
	// 'sessionCapabilities.systemPrompt', and SHOULD send the same value they used
	// when the session was created.
	SystemPrompt *SystemPrompt `json:"systemPrompt,omitzero"`
}

Request parameters for loading an existing session.

Only available if the Agent supports the 'loadSession' capability.

See protocol docs: [Loading Sessions](https://agentclientprotocol.com/protocol/v1/draft/session-setup#loading-sessions)

func (*LoadSessionRequest) Validate

func (v *LoadSessionRequest) Validate() error

type LoadSessionResponse

type LoadSessionResponse struct {
	// The _meta property is reserved by ACP to allow clients and agents to attach additional
	// metadata to their interactions. Implementations MUST NOT make assumptions about values at
	// these keys.
	//
	// See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v1/draft/extensibility)
	Meta map[string]any `json:"_meta,omitempty"`
	// Initial session configuration options if supported by the Agent.
	ConfigOptions []SessionConfigOption `json:"configOptions,omitempty"`
	// Initial mode state if supported by the Agent
	//
	// See protocol docs: [Session Modes](https://agentclientprotocol.com/protocol/v1/draft/session-modes)
	Modes *SessionModeState `json:"modes,omitzero"`
}

Response from loading an existing session.

func (*LoadSessionResponse) Validate

func (v *LoadSessionResponse) Validate() error

type LogoutCapabilities

type LogoutCapabilities struct {
	// The _meta property is reserved by ACP to allow clients and agents to attach additional
	// metadata to their interactions. Implementations MUST NOT make assumptions about values at
	// these keys.
	//
	// See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v1/draft/extensibility)
	Meta map[string]any `json:"_meta,omitempty"`
}

Logout capabilities supported by the agent.

Supplying '{}' means the agent supports the logout method.

type LogoutRequest

type LogoutRequest struct {
	// The _meta property is reserved by ACP to allow clients and agents to attach additional
	// metadata to their interactions. Implementations MUST NOT make assumptions about values at
	// these keys.
	//
	// See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v1/draft/extensibility)
	Meta map[string]any `json:"_meta,omitempty"`
}

Request parameters for the logout method.

Terminates the current authenticated session.

func (*LogoutRequest) Validate

func (v *LogoutRequest) Validate() error

type LogoutResponse

type LogoutResponse struct {
	// The _meta property is reserved by ACP to allow clients and agents to attach additional
	// metadata to their interactions. Implementations MUST NOT make assumptions about values at
	// these keys.
	//
	// See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v1/draft/extensibility)
	Meta map[string]any `json:"_meta,omitempty"`
}

Response to the 'logout' method.

func (*LogoutResponse) Validate

func (v *LogoutResponse) Validate() error

type McpCapabilities

type McpCapabilities struct {
	// The _meta property is reserved by ACP to allow clients and agents to attach additional
	// metadata to their interactions. Implementations MUST NOT make assumptions about values at
	// these keys.
	//
	// See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v1/draft/extensibility)
	Meta map[string]any `json:"_meta,omitempty"`
	// **UNSTABLE**
	//
	// This capability is not part of the spec yet, and may be removed or changed at any point.
	//
	// Agent supports 'acp' MCP servers.
	//
	// Defaults to false if unset.
	Acp bool `json:"acp,omitzero"`
	// Agent supports 'http' MCP servers.
	//
	// Defaults to false if unset.
	Http bool `json:"http,omitzero"`
	// Agent supports 'sse' MCP servers.
	//
	// Defaults to false if unset.
	Sse bool `json:"sse,omitzero"`
}

MCP capabilities supported by the agent

func (McpCapabilities) MarshalJSONTo

func (v McpCapabilities) MarshalJSONTo(enc *jsontext.Encoder) error

type McpServer

type McpServer struct {
	// HTTP transport configuration
	//
	// Only available when the Agent capabilities indicate 'mcp_capabilities.http' is 'true'.
	Http *McpServerHttpInline `json:"-"`
	// SSE transport configuration
	//
	// Only available when the Agent capabilities indicate 'mcp_capabilities.sse' is 'true'.
	Sse *McpServerSseInline `json:"-"`
	// **UNSTABLE**
	//
	// This capability is not part of the spec yet, and may be removed or changed at any point.
	//
	// ACP transport configuration
	//
	// Only available when the Agent capabilities indicate 'mcp_capabilities.acp' is 'true'.
	// The MCP server is provided by an ACP component and communicates over the ACP channel.
	Acp *McpServerAcpInline `json:"-"`
	// Stdio transport configuration
	//
	// All Agents MUST support this transport.
	Stdio *McpServerStdio `json:"-"`
}

func (McpServer) MarshalJSONTo

func (u McpServer) MarshalJSONTo(enc *jsontext.Encoder) error

func (*McpServer) UnmarshalJSONFrom

func (u *McpServer) UnmarshalJSONFrom(dec *jsontext.Decoder) error

type McpServerAcp

type McpServerAcp struct {
	// The _meta property is reserved by ACP to allow clients and agents to attach additional
	// metadata to their interactions. Implementations MUST NOT make assumptions about values at
	// these keys.
	//
	// See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v1/draft/extensibility)
	Meta map[string]any `json:"_meta,omitempty"`
	// Human-readable name identifying this MCP server.
	Name string `json:"name"`
	// Unique identifier for this MCP server, generated by the component providing it.
	//
	// Providers MUST NOT reuse an ID for multiple ACP-transport MCP servers that are visible
	// on the same ACP connection.
	ServerId McpServerAcpId `json:"serverId"`
}

**UNSTABLE**

This capability is not part of the spec yet, and may be removed or changed at any point.

ACP transport configuration for MCP.

The MCP server is provided by an ACP component and communicates over the ACP channel using 'mcp/message'.

type McpServerAcpId

type McpServerAcpId string

**UNSTABLE**

This capability is not part of the spec yet, and may be removed or changed at any point.

Unique identifier for an MCP server using the ACP transport.

The value is opaque and generated by the ACP component providing the MCP server. It is used by 'mcp/message' to route requests to the component that declared the server.

type McpServerAcpInline

type McpServerAcpInline struct {
	// The _meta property is reserved by ACP to allow clients and agents to attach additional
	// metadata to their interactions. Implementations MUST NOT make assumptions about values at
	// these keys.
	//
	// See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v1/draft/extensibility)
	Meta map[string]any `json:"_meta,omitempty"`
	// Human-readable name identifying this MCP server.
	Name string `json:"name"`
	// Unique identifier for this MCP server, generated by the component providing it.
	//
	// Providers MUST NOT reuse an ID for multiple ACP-transport MCP servers that are visible
	// on the same ACP connection.
	ServerId McpServerAcpId `json:"serverId"`
	Type     string         `json:"type"`
}

**UNSTABLE**

This capability is not part of the spec yet, and may be removed or changed at any point.

ACP transport configuration

Only available when the Agent capabilities indicate 'mcp_capabilities.acp' is 'true'. The MCP server is provided by an ACP component and communicates over the ACP channel.

type McpServerHttp

type McpServerHttp struct {
	// The _meta property is reserved by ACP to allow clients and agents to attach additional
	// metadata to their interactions. Implementations MUST NOT make assumptions about values at
	// these keys.
	//
	// See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v1/draft/extensibility)
	Meta map[string]any `json:"_meta,omitempty"`
	// HTTP headers to set when making requests to the MCP server.
	Headers []HttpHeader `json:"headers"`
	// Human-readable name identifying this MCP server.
	Name string `json:"name"`
	// URL to the MCP server.
	Url string `json:"url"`
}

HTTP transport configuration for MCP.

type McpServerHttpInline

type McpServerHttpInline struct {
	// The _meta property is reserved by ACP to allow clients and agents to attach additional
	// metadata to their interactions. Implementations MUST NOT make assumptions about values at
	// these keys.
	//
	// See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v1/draft/extensibility)
	Meta map[string]any `json:"_meta,omitempty"`
	// HTTP headers to set when making requests to the MCP server.
	Headers []HttpHeader `json:"headers"`
	// Human-readable name identifying this MCP server.
	Name string `json:"name"`
	Type string `json:"type"`
	// URL to the MCP server.
	Url string `json:"url"`
}

Configuration for connecting to an MCP (Model Context Protocol) server.

MCP servers provide tools and context that the agent can use when processing prompts.

See protocol docs: [MCP Servers](https://agentclientprotocol.com/protocol/v1/draft/session-setup#mcp-servers) HTTP transport configuration

Only available when the Agent capabilities indicate 'mcp_capabilities.http' is 'true'.

type McpServerSse

type McpServerSse struct {
	// The _meta property is reserved by ACP to allow clients and agents to attach additional
	// metadata to their interactions. Implementations MUST NOT make assumptions about values at
	// these keys.
	//
	// See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v1/draft/extensibility)
	Meta map[string]any `json:"_meta,omitempty"`
	// HTTP headers to set when making requests to the MCP server.
	Headers []HttpHeader `json:"headers"`
	// Human-readable name identifying this MCP server.
	Name string `json:"name"`
	// URL to the MCP server.
	Url string `json:"url"`
}

SSE transport configuration for MCP.

type McpServerSseInline

type McpServerSseInline struct {
	// The _meta property is reserved by ACP to allow clients and agents to attach additional
	// metadata to their interactions. Implementations MUST NOT make assumptions about values at
	// these keys.
	//
	// See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v1/draft/extensibility)
	Meta map[string]any `json:"_meta,omitempty"`
	// HTTP headers to set when making requests to the MCP server.
	Headers []HttpHeader `json:"headers"`
	// Human-readable name identifying this MCP server.
	Name string `json:"name"`
	Type string `json:"type"`
	// URL to the MCP server.
	Url string `json:"url"`
}

SSE transport configuration

Only available when the Agent capabilities indicate 'mcp_capabilities.sse' is 'true'.

type McpServerStdio

type McpServerStdio struct {
	// The _meta property is reserved by ACP to allow clients and agents to attach additional
	// metadata to their interactions. Implementations MUST NOT make assumptions about values at
	// these keys.
	//
	// See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v1/draft/extensibility)
	Meta map[string]any `json:"_meta,omitempty"`
	// Command-line arguments to pass to the MCP server.
	Args []string `json:"args"`
	// Absolute path to the MCP server executable.
	Command string `json:"command"`
	// Environment variables to set when launching the MCP server.
	Env []EnvVariable `json:"env"`
	// Human-readable name identifying this MCP server.
	Name string `json:"name"`
}

Stdio transport configuration for MCP.

type MessageId

type MessageId string

Unique identifier for a message within a session.

type MethodHandler

type MethodHandler func(ctx context.Context, method string, params jsontext.Value) (any, *RequestError)

MethodHandler handles one inbound request or notification. For a notification the result is discarded.

params is only valid until the handler returns.

type MultiSelectItems

type MultiSelectItems struct {
	// Multi-select string items with plain string values.
	String *MultiSelectItemsString `json:"-"`
	// Custom or future typed multi-select items.
	Other *MultiSelectItemsOther `json:"-"`
	// Titled multi-select items with human-readable labels.
	//
	// As in MCP, titled items omit 'type' and are identified by 'anyOf'.
	Titled *TitledMultiSelectItems `json:"-"`
}

func (MultiSelectItems) MarshalJSONTo

func (u MultiSelectItems) MarshalJSONTo(enc *jsontext.Encoder) error

func (*MultiSelectItems) UnmarshalJSONFrom

func (u *MultiSelectItems) UnmarshalJSONFrom(dec *jsontext.Decoder) error

type MultiSelectItemsOther

type MultiSelectItemsOther struct {
	// Custom or future multi-select item type.
	//
	// Values beginning with '_' are reserved for implementation-specific
	// extensions. Unknown values that do not begin with '_' are reserved for
	// future ACP variants.
	Type string `json:"type"`
}

Custom or future typed multi-select items.

type MultiSelectItemsString

type MultiSelectItemsString struct {
	// The _meta property is reserved by ACP to allow clients and agents to attach additional
	// metadata to their interactions. Implementations MUST NOT make assumptions about values at
	// these keys.
	//
	// Optional. Omitted and 'null' are equivalent and mean no metadata.
	//
	// See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v1/extensibility)
	Meta map[string]any `json:"_meta,omitempty"`
	// Allowed enum values.
	Enum []string `json:"enum"`
	Type string   `json:"type"`
}

Items for a multi-select (array) property schema. Multi-select string items with plain string values.

type MultiSelectPropertySchema

type MultiSelectPropertySchema struct {
	// The _meta property is reserved by ACP to allow clients and agents to attach additional
	// metadata to their interactions. Implementations MUST NOT make assumptions about values at
	// these keys.
	//
	// Optional. Omitted and 'null' are equivalent and mean no metadata.
	//
	// See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v1/extensibility)
	Meta map[string]any `json:"_meta,omitempty"`
	// Default selected values.
	//
	// Optional. Omitted and 'null' are equivalent and mean no default selections are provided.
	Default []string `json:"default,omitempty"`
	// Human-readable description.
	//
	// Optional. Omitted and 'null' are equivalent and mean no description is provided.
	Description *string `json:"description,omitzero"`
	// The items definition describing allowed values.
	Items MultiSelectItems `json:"items"`
	// Maximum number of items to select.
	//
	// Optional. Omitted and 'null' are equivalent and mean there is no maximum selection count.
	MaxItems *int `json:"maxItems,omitzero"`
	// Minimum number of items to select.
	//
	// Optional. Omitted and 'null' are equivalent and mean there is no minimum selection count.
	MinItems *int `json:"minItems,omitzero"`
	// Optional title for the property.
	//
	// Optional. Omitted and 'null' are equivalent and mean no title is provided.
	Title *string `json:"title,omitzero"`
}

Schema for multi-select (array) properties in an elicitation form.

type NewSessionRequest

type NewSessionRequest struct {
	// The _meta property is reserved by ACP to allow clients and agents to attach additional
	// metadata to their interactions. Implementations MUST NOT make assumptions about values at
	// these keys.
	//
	// See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v1/draft/extensibility)
	Meta map[string]any `json:"_meta,omitempty"`
	// Additional workspace roots for this session. Each path must be absolute.
	//
	// These expand the session's filesystem scope without changing 'cwd', which
	// remains the base for relative paths. When omitted or empty, no
	// additional roots are activated for the new session.
	AdditionalDirectories []string `json:"additionalDirectories,omitempty"`
	// **UNSTABLE**
	//
	// This capability is not part of the spec yet, and may be removed or changed at any point.
	//
	// Initial values for the session's config options.
	//
	// Optional. Omitted and 'null' are equivalent to an empty list. Clients MUST only send
	// this when the Agent advertises 'sessionCapabilities.options'.
	//
	// The Agent applies the entries in list order, as if the Client had called
	// 'session/set_config_option' for each entry after the session was set up. Malformed
	// entries and duplicate 'configId' values fail the request with '-32602'. The Agent MUST
	// ignore an entry whose 'configId' is unknown, whose 'type' does not match the option,
	// or whose value is not allowed when it is applied. The 'configOptions' in the response contain the values the session actually
	// has. The Agent SHOULD NOT send 'config_option_update' notifications for these entries.
	ConfigOptions []InitialSessionConfigOption `json:"configOptions,omitempty"`
	// The working directory for this session. Must be an absolute path.
	Cwd string `json:"cwd"`
	// List of MCP (Model Context Protocol) servers the agent should connect to.
	McpServers []McpServer `json:"mcpServers"`
	// System-level instructions for the new session.
	//
	// Optional. Omitted and 'null' are equivalent and mean the Agent uses its
	// own default instructions. Clients MUST only send this when the Agent
	// advertises 'sessionCapabilities.systemPrompt'.
	SystemPrompt *SystemPrompt `json:"systemPrompt,omitzero"`
}

Request parameters for creating a new session.

See protocol docs: [Creating a Session](https://agentclientprotocol.com/protocol/v1/draft/session-setup#creating-a-session)

func (*NewSessionRequest) Validate

func (v *NewSessionRequest) Validate() error

type NewSessionResponse

type NewSessionResponse struct {
	// The _meta property is reserved by ACP to allow clients and agents to attach additional
	// metadata to their interactions. Implementations MUST NOT make assumptions about values at
	// these keys.
	//
	// See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v1/draft/extensibility)
	Meta map[string]any `json:"_meta,omitempty"`
	// Initial session configuration options if supported by the Agent.
	ConfigOptions []SessionConfigOption `json:"configOptions,omitempty"`
	// Initial mode state if supported by the Agent
	//
	// See protocol docs: [Session Modes](https://agentclientprotocol.com/protocol/v1/draft/session-modes)
	Modes *SessionModeState `json:"modes,omitzero"`
	// Unique identifier for the created session.
	//
	// Used in all subsequent requests for this conversation.
	SessionId SessionId `json:"sessionId"`
}

Response from creating a new session.

See protocol docs: [Creating a Session](https://agentclientprotocol.com/protocol/v1/draft/session-setup#creating-a-session)

func (*NewSessionResponse) Validate

func (v *NewSessionResponse) Validate() error

type Notice

type Notice struct {
	// Metadata scoped to this notice.
	//
	// Omitted and 'null' are equivalent and mean no metadata was supplied.
	Meta map[string]any `json:"_meta,omitempty"`
	// Optional plain-text detail or guidance.
	//
	// Omitted and 'null' are equivalent and mean no description was supplied.
	Description *string `json:"description,omitzero"`
	// Presentation severity hint.
	Severity NoticeSeverity `json:"severity"`
	// Required non-empty plain-text title that can stand alone.
	Title string `json:"title"`
}

Fire-and-forget information for the user.

Notices are live events rather than session history. Agents must not rely on a notice being received, displayed, or seen by the user. Agents MUST only send notices when the Client advertised the 'session.notices' Client capability. Otherwise, Agents may use an agent message when the information should still be surfaced to the user.

See RFD: [Session Notices](https://agentclientprotocol.com/rfds/session-notices)

type NoticeCapabilities

type NoticeCapabilities struct{}

Client support for presenting live notices to the user.

type NoticeSeverity

type NoticeSeverity string

Severity hint for a session notice.

const (
	NoticeSeverityInfo    NoticeSeverity = "info"
	NoticeSeverityWarning NoticeSeverity = "warning"
	NoticeSeverityError   NoticeSeverity = "error"
)

type NumberPropertySchema

type NumberPropertySchema struct {
	// The _meta property is reserved by ACP to allow clients and agents to attach additional
	// metadata to their interactions. Implementations MUST NOT make assumptions about values at
	// these keys.
	//
	// Optional. Omitted and 'null' are equivalent and mean no metadata.
	//
	// See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v1/extensibility)
	Meta map[string]any `json:"_meta,omitempty"`
	// Default value.
	//
	// Optional. Omitted and 'null' are equivalent and mean no default value is provided.
	Default *float64 `json:"default,omitzero"`
	// Human-readable description.
	//
	// Optional. Omitted and 'null' are equivalent and mean no description is provided.
	Description *string `json:"description,omitzero"`
	// Maximum value (inclusive).
	//
	// Optional. Omitted and 'null' are equivalent and mean there is no inclusive upper bound.
	Maximum *float64 `json:"maximum,omitzero"`
	// Minimum value (inclusive).
	//
	// Optional. Omitted and 'null' are equivalent and mean there is no inclusive lower bound.
	Minimum *float64 `json:"minimum,omitzero"`
	// Optional title for the property.
	//
	// Optional. Omitted and 'null' are equivalent and mean no title is provided.
	Title *string `json:"title,omitzero"`
}

Schema for number (floating-point) properties in an elicitation form.

type PermissionOption

type PermissionOption struct {
	// The _meta property is reserved by ACP to allow clients and agents to attach additional
	// metadata to their interactions. Implementations MUST NOT make assumptions about values at
	// these keys.
	//
	// See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v1/draft/extensibility)
	Meta map[string]any `json:"_meta,omitempty"`
	// Hint about the nature of this permission option.
	Kind PermissionOptionKind `json:"kind"`
	// Human-readable label to display to the user.
	Name string `json:"name"`
	// Unique identifier for this permission option.
	OptionId PermissionOptionId `json:"optionId"`
}

An option presented to the user when requesting permission.

type PermissionOptionId

type PermissionOptionId string

Unique identifier for a permission option.

type PermissionOptionKind

type PermissionOptionKind string

The type of permission option being presented to the user.

Helps clients choose appropriate icons and UI treatment.

const (
	PermissionOptionKindAllowOnce    PermissionOptionKind = "allow_once"
	PermissionOptionKindAllowAlways  PermissionOptionKind = "allow_always"
	PermissionOptionKindRejectOnce   PermissionOptionKind = "reject_once"
	PermissionOptionKindRejectAlways PermissionOptionKind = "reject_always"
)

type Plan

type Plan struct {
	// The _meta property is reserved by ACP to allow clients and agents to attach additional
	// metadata to their interactions. Implementations MUST NOT make assumptions about values at
	// these keys.
	//
	// See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v1/draft/extensibility)
	Meta map[string]any `json:"_meta,omitempty"`
	// The list of tasks to be accomplished.
	//
	// When updating a plan, the agent must send a complete list of all entries
	// with their current status. The client replaces the entire plan with each update.
	Entries []PlanEntry `json:"entries"`
}

An execution plan for accomplishing complex tasks.

Plans consist of multiple entries representing individual tasks or goals. Agents report plans to clients to provide visibility into their execution strategy. Plans can evolve during execution as the agent discovers new requirements or completes tasks.

See protocol docs: [Agent Plan](https://agentclientprotocol.com/protocol/v1/draft/agent-plan)

type PlanCapabilities

type PlanCapabilities struct {
	// The _meta property is reserved by ACP to allow clients and agents to attach additional
	// metadata to their interactions. Implementations MUST NOT make assumptions about values at
	// these keys.
	//
	// See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v1/draft/extensibility)
	Meta map[string]any `json:"_meta,omitempty"`
}

**UNSTABLE**

This capability is not part of the spec yet, and may be removed or changed at any point.

Capabilities for receiving 'plan_update' and 'plan_removed' session updates.

type PlanEntry

type PlanEntry struct {
	// The _meta property is reserved by ACP to allow clients and agents to attach additional
	// metadata to their interactions. Implementations MUST NOT make assumptions about values at
	// these keys.
	//
	// See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v1/draft/extensibility)
	Meta map[string]any `json:"_meta,omitempty"`
	// Human-readable description of what this task aims to accomplish.
	Content string `json:"content"`
	// The relative importance of this task.
	// Used to indicate which tasks are most critical to the overall goal.
	Priority PlanEntryPriority `json:"priority"`
	// Current execution status of this task.
	Status PlanEntryStatus `json:"status"`
}

A single entry in the execution plan.

Represents a task or goal that the assistant intends to accomplish as part of fulfilling the user's request. See protocol docs: [Plan Entries](https://agentclientprotocol.com/protocol/v1/draft/agent-plan#plan-entries)

type PlanEntryPriority

type PlanEntryPriority string

Priority levels for plan entries.

Used to indicate the relative importance or urgency of different tasks in the execution plan. See protocol docs: [Plan Entries](https://agentclientprotocol.com/protocol/v1/draft/agent-plan#plan-entries)

const (
	PlanEntryPriorityHigh   PlanEntryPriority = "high"
	PlanEntryPriorityMedium PlanEntryPriority = "medium"
	PlanEntryPriorityLow    PlanEntryPriority = "low"
)

type PlanEntryStatus

type PlanEntryStatus string

Status of a plan entry in the execution flow.

Tracks the lifecycle of each task from planning through completion. See protocol docs: [Plan Entries](https://agentclientprotocol.com/protocol/v1/draft/agent-plan#plan-entries)

const (
	PlanEntryStatusPending    PlanEntryStatus = "pending"
	PlanEntryStatusInProgress PlanEntryStatus = "in_progress"
	PlanEntryStatusCompleted  PlanEntryStatus = "completed"
)

type PlanFile

type PlanFile struct {
	// The _meta property is reserved by ACP to allow clients and agents to attach additional
	// metadata to their interactions. Implementations MUST NOT make assumptions about values at
	// these keys.
	//
	// See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v1/draft/extensibility)
	Meta map[string]any `json:"_meta,omitempty"`
	// The plan ID to update.
	PlanId PlanId `json:"planId"`
	// The URI of the file containing the plan.
	Uri string `json:"uri"`
}

**UNSTABLE**

This capability is not part of the spec yet, and may be removed or changed at any point.

A plan represented by a file URI.

type PlanId

type PlanId string

**UNSTABLE**

This capability is not part of the spec yet, and may be removed or changed at any point.

Unique identifier for a plan within a session.

type PlanItems

type PlanItems struct {
	// The _meta property is reserved by ACP to allow clients and agents to attach additional
	// metadata to their interactions. Implementations MUST NOT make assumptions about values at
	// these keys.
	//
	// See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v1/draft/extensibility)
	Meta map[string]any `json:"_meta,omitempty"`
	// The list of tasks to be accomplished.
	//
	// When updating an item-based plan, the agent must send a complete list of all entries
	// with their current status. The client replaces that plan with each update.
	Entries []PlanEntry `json:"entries"`
	// The plan ID to update.
	PlanId PlanId `json:"planId"`
}

**UNSTABLE**

This capability is not part of the spec yet, and may be removed or changed at any point.

A plan represented as structured entries.

type PlanMarkdown

type PlanMarkdown struct {
	// The _meta property is reserved by ACP to allow clients and agents to attach additional
	// metadata to their interactions. Implementations MUST NOT make assumptions about values at
	// these keys.
	//
	// See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v1/draft/extensibility)
	Meta map[string]any `json:"_meta,omitempty"`
	// Markdown content for the plan.
	Content string `json:"content"`
	// The plan ID to update.
	PlanId PlanId `json:"planId"`
}

**UNSTABLE**

This capability is not part of the spec yet, and may be removed or changed at any point.

A plan represented as raw markdown content.

type PlanRemoved

type PlanRemoved struct {
	// The _meta property is reserved by ACP to allow clients and agents to attach additional
	// metadata to their interactions. Implementations MUST NOT make assumptions about values at
	// these keys.
	//
	// See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v1/draft/extensibility)
	Meta map[string]any `json:"_meta,omitempty"`
	// The plan ID to remove.
	PlanId PlanId `json:"planId"`
}

**UNSTABLE**

This capability is not part of the spec yet, and may be removed or changed at any point.

Removal notice for a plan identified by ID.

type PlanUpdate

type PlanUpdate struct {
	// The _meta property is reserved by ACP to allow clients and agents to attach additional
	// metadata to their interactions. Implementations MUST NOT make assumptions about values at
	// these keys.
	//
	// See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v1/draft/extensibility)
	Meta map[string]any `json:"_meta,omitempty"`
	// The updated plan content.
	Plan PlanUpdateContent `json:"plan"`
}

**UNSTABLE**

This capability is not part of the spec yet, and may be removed or changed at any point.

A content update for a plan identified by ID.

type PlanUpdateContent

type PlanUpdateContent struct {
	// Structured plan entries.
	Items *PlanUpdateContentItems `json:"-"`
	// A URI pointing to a file containing the plan.
	File *PlanUpdateContentFile `json:"-"`
	// Raw markdown content for the plan.
	Markdown *PlanUpdateContentMarkdown `json:"-"`
}

func NewPlanUpdateContentFile

func NewPlanUpdateContentFile(planId PlanId, uri string) PlanUpdateContent

NewPlanUpdateContentFile constructs a PlanUpdateContent using the 'file' variant.

func NewPlanUpdateContentItems

func NewPlanUpdateContentItems(planId PlanId, entries []PlanEntry) PlanUpdateContent

NewPlanUpdateContentItems constructs a PlanUpdateContent using the 'items' variant.

func NewPlanUpdateContentMarkdown

func NewPlanUpdateContentMarkdown(planId PlanId, content string) PlanUpdateContent

NewPlanUpdateContentMarkdown constructs a PlanUpdateContent using the 'markdown' variant.

func (PlanUpdateContent) MarshalJSONTo

func (u PlanUpdateContent) MarshalJSONTo(enc *jsontext.Encoder) error

func (*PlanUpdateContent) UnmarshalJSONFrom

func (u *PlanUpdateContent) UnmarshalJSONFrom(dec *jsontext.Decoder) error

func (*PlanUpdateContent) Validate

func (u *PlanUpdateContent) Validate() error

type PlanUpdateContentFile

type PlanUpdateContentFile struct {
	// The _meta property is reserved by ACP to allow clients and agents to attach additional
	// metadata to their interactions. Implementations MUST NOT make assumptions about values at
	// these keys.
	//
	// See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v1/draft/extensibility)
	Meta map[string]any `json:"_meta,omitempty"`
	// The plan ID to update.
	PlanId PlanId `json:"planId"`
	Type   string `json:"type"`
	// The URI of the file containing the plan.
	Uri string `json:"uri"`
}

A URI pointing to a file containing the plan.

type PlanUpdateContentItems

type PlanUpdateContentItems struct {
	// The _meta property is reserved by ACP to allow clients and agents to attach additional
	// metadata to their interactions. Implementations MUST NOT make assumptions about values at
	// these keys.
	//
	// See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v1/draft/extensibility)
	Meta map[string]any `json:"_meta,omitempty"`
	// The list of tasks to be accomplished.
	//
	// When updating an item-based plan, the agent must send a complete list of all entries
	// with their current status. The client replaces that plan with each update.
	Entries []PlanEntry `json:"entries"`
	// The plan ID to update.
	PlanId PlanId `json:"planId"`
	Type   string `json:"type"`
}

**UNSTABLE**

This capability is not part of the spec yet, and may be removed or changed at any point.

Updated content for a plan. Structured plan entries.

type PlanUpdateContentMarkdown

type PlanUpdateContentMarkdown struct {
	// The _meta property is reserved by ACP to allow clients and agents to attach additional
	// metadata to their interactions. Implementations MUST NOT make assumptions about values at
	// these keys.
	//
	// See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v1/draft/extensibility)
	Meta map[string]any `json:"_meta,omitempty"`
	// Markdown content for the plan.
	Content string `json:"content"`
	// The plan ID to update.
	PlanId PlanId `json:"planId"`
	Type   string `json:"type"`
}

Raw markdown content for the plan.

type PromptCapabilities

type PromptCapabilities struct {
	// The _meta property is reserved by ACP to allow clients and agents to attach additional
	// metadata to their interactions. Implementations MUST NOT make assumptions about values at
	// these keys.
	//
	// See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v1/draft/extensibility)
	Meta map[string]any `json:"_meta,omitempty"`
	// Agent supports 'audio' content blocks.
	//
	// Defaults to false if unset.
	Audio bool `json:"audio,omitzero"`
	// Agent supports embedded context in 'session/prompt' requests.
	//
	// When enabled, the Client is allowed to include 'resource' content blocks
	// in prompt requests for pieces of context that are referenced in the message.
	//
	// Defaults to false if unset.
	EmbeddedContext bool `json:"embeddedContext,omitzero"`
	// Agent supports 'image' content blocks.
	//
	// Defaults to false if unset.
	Image bool `json:"image,omitzero"`
}

Prompt capabilities supported by the agent in 'session/prompt' requests.

Baseline agent functionality requires support for 'text' and 'resource_link' content blocks in prompt requests.

Other variants must be explicitly opted in to. Capabilities for different types of content in prompt requests.

Indicates which content types beyond the baseline (text and resource links) the agent can process.

See protocol docs: [Prompt Capabilities](https://agentclientprotocol.com/protocol/v1/draft/initialization#prompt-capabilities)

func (PromptCapabilities) MarshalJSONTo

func (v PromptCapabilities) MarshalJSONTo(enc *jsontext.Encoder) error

type PromptRequest

type PromptRequest struct {
	// The _meta property is reserved by ACP to allow clients and agents to attach additional
	// metadata to their interactions. Implementations MUST NOT make assumptions about values at
	// these keys.
	//
	// See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v1/draft/extensibility)
	Meta map[string]any `json:"_meta,omitempty"`
	// The blocks of content that compose the user's message.
	//
	// As a baseline, the Agent MUST support 'text' and 'resource_link' content blocks,
	// while other variants are optionally enabled via 'PromptCapabilities'.
	//
	// The Client MUST adapt its interface according to 'PromptCapabilities'.
	//
	// The client MAY include referenced pieces of context as either
	// 'resource' or 'resource_link' content blocks.
	//
	// When available, 'resource' is preferred
	// as it avoids extra round-trips and allows the message to include
	// pieces of context from sources the agent may not have access to.
	Prompt []ContentBlock `json:"prompt"`
	// The ID of the session to send this user message to
	SessionId SessionId `json:"sessionId"`
}

Request parameters for sending a user prompt to the agent.

Contains the user's message and any additional context.

See protocol docs: [User Message](https://agentclientprotocol.com/protocol/v1/draft/prompt-turn#1-user-message)

func (*PromptRequest) Validate

func (v *PromptRequest) Validate() error

type PromptResponse

type PromptResponse struct {
	// The _meta property is reserved by ACP to allow clients and agents to attach additional
	// metadata to their interactions. Implementations MUST NOT make assumptions about values at
	// these keys.
	//
	// See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v1/draft/extensibility)
	Meta map[string]any `json:"_meta,omitempty"`
	// Indicates why the agent stopped processing the turn.
	StopReason StopReason `json:"stopReason"`
	// **UNSTABLE**
	//
	// This capability is not part of the spec yet, and may be removed or changed at any point.
	//
	// Token usage for this turn (optional).
	Usage *Usage `json:"usage,omitzero"`
}

Response from processing a user prompt.

See protocol docs: [Check for Completion](https://agentclientprotocol.com/protocol/v1/draft/prompt-turn#4-check-for-completion)

func (*PromptResponse) Validate

func (v *PromptResponse) Validate() error

type ProtocolVersion

type ProtocolVersion int

Protocol version identifier.

This version is only bumped for breaking changes. Non-breaking changes should be introduced via capabilities.

type ProvidersCapabilities

type ProvidersCapabilities struct {
	// The _meta property is reserved by ACP to allow clients and agents to attach additional
	// metadata to their interactions. Implementations MUST NOT make assumptions about values at
	// these keys.
	//
	// See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v1/draft/extensibility)
	Meta map[string]any `json:"_meta,omitempty"`
}

**UNSTABLE**

This capability is not part of the spec yet, and may be removed or changed at any point.

Provider configuration capabilities supported by the agent.

Supplying '{}' means the agent supports provider configuration methods.

type ReadTextFileRequest

type ReadTextFileRequest struct {
	// The _meta property is reserved by ACP to allow clients and agents to attach additional
	// metadata to their interactions. Implementations MUST NOT make assumptions about values at
	// these keys.
	//
	// See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v1/draft/extensibility)
	Meta map[string]any `json:"_meta,omitempty"`
	// Maximum number of lines to read.
	Limit *int `json:"limit,omitzero"`
	// Line number to start reading from (1-based).
	Line *int `json:"line,omitzero"`
	// Absolute path to the file to read.
	Path string `json:"path"`
	// The session ID for this request.
	SessionId SessionId `json:"sessionId"`
}

Request to read content from a text file.

Only available if the client supports the 'fs.readTextFile' capability.

func (*ReadTextFileRequest) Validate

func (v *ReadTextFileRequest) Validate() error

type ReadTextFileResponse

type ReadTextFileResponse struct {
	// The _meta property is reserved by ACP to allow clients and agents to attach additional
	// metadata to their interactions. Implementations MUST NOT make assumptions about values at
	// these keys.
	//
	// See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v1/draft/extensibility)
	Meta map[string]any `json:"_meta,omitempty"`
	// Content payload returned by this response.
	Content string `json:"content"`
}

Response containing the contents of a text file.

func (*ReadTextFileResponse) Validate

func (v *ReadTextFileResponse) Validate() error

type ReleaseTerminalRequest

type ReleaseTerminalRequest struct {
	// The _meta property is reserved by ACP to allow clients and agents to attach additional
	// metadata to their interactions. Implementations MUST NOT make assumptions about values at
	// these keys.
	//
	// See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v1/draft/extensibility)
	Meta map[string]any `json:"_meta,omitempty"`
	// The session ID for this request.
	SessionId SessionId `json:"sessionId"`
	// The ID of the terminal to release.
	TerminalId TerminalId `json:"terminalId"`
}

Request to release a terminal and free its resources.

func (*ReleaseTerminalRequest) Validate

func (v *ReleaseTerminalRequest) Validate() error

type ReleaseTerminalResponse

type ReleaseTerminalResponse struct {
	// The _meta property is reserved by ACP to allow clients and agents to attach additional
	// metadata to their interactions. Implementations MUST NOT make assumptions about values at
	// these keys.
	//
	// See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v1/draft/extensibility)
	Meta map[string]any `json:"_meta,omitempty"`
}

Response to terminal/release method

func (*ReleaseTerminalResponse) Validate

func (v *ReleaseTerminalResponse) Validate() error

type RequestError

type RequestError struct {
	Code    int    `json:"code"`
	Message string `json:"message"`
	Data    any    `json:"data,omitzero"`
}

RequestError is a JSON-RPC error object. A handler that returns one sends it to the peer unchanged.

func NewAuthRequired

func NewAuthRequired(data any) *RequestError

NewAuthRequired reports that the method needs authentication first.

func NewInternalError

func NewInternalError(data any) *RequestError

NewInternalError reports a failure inside the receiver.

func NewInvalidParams

func NewInvalidParams(data any) *RequestError

NewInvalidParams reports parameters that do not fit the method.

func NewInvalidRequest

func NewInvalidRequest(data any) *RequestError

NewInvalidRequest reports a message that is not a valid JSON-RPC message.

func NewMethodNotFound

func NewMethodNotFound(method string) *RequestError

NewMethodNotFound reports a method the receiver does not implement.

func NewParseError

func NewParseError(data any) *RequestError

NewParseError reports a message that is not valid JSON.

func NewRequestCancelled

func NewRequestCancelled(data any) *RequestError

NewRequestCancelled reports a request that was cancelled before it finished.

func NewResourceNotFound

func NewResourceNotFound(data any) *RequestError

NewResourceNotFound reports a resource, such as a session, that does not exist.

func (*RequestError) Error

func (e *RequestError) Error() string

Error implements error.

type RequestId

type RequestId struct {
	// The JSON-RPC 'null' request id.
	Null *RequestIdNull `json:"-"`
	// A numeric JSON-RPC request id.
	Number *RequestIdNumber `json:"-"`
	// A string JSON-RPC request id.
	Str *RequestIdStr `json:"-"`
}

func (RequestId) MarshalJSONTo

func (u RequestId) MarshalJSONTo(enc *jsontext.Encoder) error

func (*RequestId) UnmarshalJSONFrom

func (u *RequestId) UnmarshalJSONFrom(dec *jsontext.Decoder) error

type RequestIdNull

type RequestIdNull struct{}

JSON RPC Request Id

An identifier established by the Client that MUST contain a String, Number, or NULL value if included. If it is not included it is assumed to be a notification. The value SHOULD normally not be Null \[1\] and Numbers SHOULD NOT contain fractional parts \[2\]

The Server MUST reply with the same value in the Response object if included. This member is used to correlate the context between the two objects.

\[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.

\[2\] Fractional parts may be problematic, since many decimal fractions cannot be represented exactly as binary fractions.

type RequestIdNumber

type RequestIdNumber int

A numeric JSON-RPC request id.

type RequestIdStr

type RequestIdStr string

A string JSON-RPC request id.

type RequestPermissionOutcome

type RequestPermissionOutcome struct {
	// The prompt turn was cancelled before the user responded.
	//
	// When a client sends a 'session/cancel' notification to cancel an ongoing
	// prompt turn, it MUST respond to all pending 'session/request_permission'
	// requests with this 'cancelled' outcome.
	//
	// See protocol docs: [Cancellation](https://agentclientprotocol.com/protocol/v1/draft/prompt-turn#cancellation)
	Cancelled *RequestPermissionOutcomeCancelled `json:"-"`
	// The user selected one of the provided options.
	Selected *RequestPermissionOutcomeSelected `json:"-"`
}

func NewRequestPermissionOutcomeCancelled

func NewRequestPermissionOutcomeCancelled() RequestPermissionOutcome

NewRequestPermissionOutcomeCancelled constructs a RequestPermissionOutcome using the 'cancelled' variant.

func NewRequestPermissionOutcomeSelected

func NewRequestPermissionOutcomeSelected(optionId PermissionOptionId) RequestPermissionOutcome

NewRequestPermissionOutcomeSelected constructs a RequestPermissionOutcome using the 'selected' variant.

func (RequestPermissionOutcome) MarshalJSONTo

func (u RequestPermissionOutcome) MarshalJSONTo(enc *jsontext.Encoder) error

func (*RequestPermissionOutcome) UnmarshalJSONFrom

func (u *RequestPermissionOutcome) UnmarshalJSONFrom(dec *jsontext.Decoder) error

func (*RequestPermissionOutcome) Validate

func (u *RequestPermissionOutcome) Validate() error

type RequestPermissionOutcomeCancelled

type RequestPermissionOutcomeCancelled struct {
	Outcome string `json:"outcome"`
}

The outcome of a permission request. The prompt turn was cancelled before the user responded.

When a client sends a 'session/cancel' notification to cancel an ongoing prompt turn, it MUST respond to all pending 'session/request_permission' requests with this 'cancelled' outcome.

See protocol docs: [Cancellation](https://agentclientprotocol.com/protocol/v1/draft/prompt-turn#cancellation)

type RequestPermissionOutcomeSelected

type RequestPermissionOutcomeSelected struct {
	// The _meta property is reserved by ACP to allow clients and agents to attach additional
	// metadata to their interactions. Implementations MUST NOT make assumptions about values at
	// these keys.
	//
	// See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v1/draft/extensibility)
	Meta map[string]any `json:"_meta,omitempty"`
	// The ID of the option the user selected.
	OptionId PermissionOptionId `json:"optionId"`
	Outcome  string             `json:"outcome"`
}

The user selected one of the provided options.

type RequestPermissionRequest

type RequestPermissionRequest struct {
	// The _meta property is reserved by ACP to allow clients and agents to attach additional
	// metadata to their interactions. Implementations MUST NOT make assumptions about values at
	// these keys.
	//
	// See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v1/draft/extensibility)
	Meta map[string]any `json:"_meta,omitempty"`
	// Available permission options for the user to choose from.
	Options []PermissionOption `json:"options"`
	// The session ID for this request.
	SessionId SessionId `json:"sessionId"`
	// Details about the tool call requiring permission.
	ToolCall ToolCallUpdate `json:"toolCall"`
}

Request for user permission to execute a tool call.

Sent when the agent needs authorization before performing a sensitive operation.

See protocol docs: [Requesting Permission](https://agentclientprotocol.com/protocol/v1/draft/tool-calls#requesting-permission)

func (*RequestPermissionRequest) Validate

func (v *RequestPermissionRequest) Validate() error

type RequestPermissionResponse

type RequestPermissionResponse struct {
	// The _meta property is reserved by ACP to allow clients and agents to attach additional
	// metadata to their interactions. Implementations MUST NOT make assumptions about values at
	// these keys.
	//
	// See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v1/draft/extensibility)
	Meta map[string]any `json:"_meta,omitempty"`
	// The user's decision on the permission request.
	Outcome RequestPermissionOutcome `json:"outcome"`
}

Response to a permission request.

func (*RequestPermissionResponse) Validate

func (v *RequestPermissionResponse) Validate() error

type RequiresActionStateUpdate

type RequiresActionStateUpdate struct {
	// The _meta property is reserved by ACP for additional metadata.
	// Implementations MUST NOT make assumptions about values at these keys.
	// Optional. Omitted and 'null' mean no metadata for this state snapshot.
	Meta map[string]any `json:"_meta,omitempty"`
}

Foreground work is blocked on user action.

type ResourceLink struct {
	// The _meta property is reserved by ACP to allow clients and agents to attach additional
	// metadata to their interactions. Implementations MUST NOT make assumptions about values at
	// these keys.
	//
	// See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v1/draft/extensibility)
	Meta map[string]any `json:"_meta,omitempty"`
	// Optional annotations that help clients decide how to display or route this content.
	Annotations *Annotations `json:"annotations,omitzero"`
	// Optional human-readable details shown with this protocol object.
	Description *string `json:"description,omitzero"`
	// MIME type describing the encoded media payload.
	MimeType *string `json:"mimeType,omitzero"`
	// Human-readable name shown for this protocol object.
	Name string `json:"name"`
	// Optional size of the linked resource in bytes, if known.
	Size *int `json:"size,omitzero"`
	// Optional display title for end-user UI.
	Title *string `json:"title,omitzero"`
	// URI associated with this resource or media payload.
	Uri string `json:"uri"`
}

A resource that the server is capable of reading, included in a prompt or tool call result.

type ResumeSessionRequest

type ResumeSessionRequest struct {
	// The _meta property is reserved by ACP to allow clients and agents to attach additional
	// metadata to their interactions. Implementations MUST NOT make assumptions about values at
	// these keys.
	//
	// See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v1/draft/extensibility)
	Meta map[string]any `json:"_meta,omitempty"`
	// Additional workspace roots to activate for this session. Each path must be absolute.
	//
	// When omitted or empty, no additional roots are activated. When non-empty,
	// this is the complete resulting additional-root list for the resumed
	// session. It may differ from any previously used or reported list as long as
	// the request 'cwd' matches the session's 'cwd'.
	AdditionalDirectories []string `json:"additionalDirectories,omitempty"`
	// **UNSTABLE**
	//
	// This capability is not part of the spec yet, and may be removed or changed at any point.
	//
	// Initial values for the session's config options.
	//
	// Optional. Omitted and 'null' are equivalent to an empty list. Clients MUST only send
	// this when the Agent advertises 'sessionCapabilities.options'.
	//
	// The Agent applies the entries in list order, as if the Client had called
	// 'session/set_config_option' for each entry after the session was set up. Malformed
	// entries and duplicate 'configId' values fail the request with '-32602'. The Agent MUST
	// ignore an entry whose 'configId' is unknown, whose 'type' does not match the option,
	// or whose value is not allowed when it is applied. The 'configOptions' in the response contain the values the session actually
	// has. The Agent SHOULD NOT send 'config_option_update' notifications for these entries.
	ConfigOptions []InitialSessionConfigOption `json:"configOptions,omitempty"`
	// The working directory for this session. Must be an absolute path.
	Cwd string `json:"cwd"`
	// List of MCP servers to connect to for this session.
	McpServers []McpServer `json:"mcpServers,omitempty"`
	// The ID of the session to resume.
	SessionId SessionId `json:"sessionId"`
	// System-level instructions for the resumed session.
	//
	// Optional. Omitted and 'null' are equivalent. The Agent may then keep a
	// system prompt it stored with the session or use its default instructions.
	// Clients MUST only send this when the Agent advertises
	// 'sessionCapabilities.systemPrompt', and SHOULD send the same value they used
	// when the session was created.
	SystemPrompt *SystemPrompt `json:"systemPrompt,omitzero"`
}

Request parameters for resuming an existing session.

Resumes an existing session without returning previous messages (unlike 'session/load'). This is useful for agents that can resume sessions but don't implement full session loading.

Only available if the Agent supports the 'sessionCapabilities.resume' capability.

func (*ResumeSessionRequest) Validate

func (v *ResumeSessionRequest) Validate() error

type ResumeSessionResponse

type ResumeSessionResponse struct {
	// The _meta property is reserved by ACP to allow clients and agents to attach additional
	// metadata to their interactions. Implementations MUST NOT make assumptions about values at
	// these keys.
	//
	// See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v1/draft/extensibility)
	Meta map[string]any `json:"_meta,omitempty"`
	// Initial session configuration options if supported by the Agent.
	ConfigOptions []SessionConfigOption `json:"configOptions,omitempty"`
	// Initial mode state if supported by the Agent
	//
	// See protocol docs: [Session Modes](https://agentclientprotocol.com/protocol/v1/draft/session-modes)
	Modes *SessionModeState `json:"modes,omitzero"`
}

Response from resuming an existing session.

func (*ResumeSessionResponse) Validate

func (v *ResumeSessionResponse) Validate() error

type Role

type Role string

The sender or recipient of messages and data in a conversation.

const (
	RoleAssistant Role = "assistant"
	RoleUser      Role = "user"
)

type RunningStateUpdate

type RunningStateUpdate struct {
	// The _meta property is reserved by ACP for additional metadata.
	// Implementations MUST NOT make assumptions about values at these keys.
	// Optional. Omitted and 'null' mean no metadata for this state snapshot.
	Meta map[string]any `json:"_meta,omitempty"`
}

Foreground work is in progress.

type SelectedPermissionOutcome

type SelectedPermissionOutcome struct {
	// The _meta property is reserved by ACP to allow clients and agents to attach additional
	// metadata to their interactions. Implementations MUST NOT make assumptions about values at
	// these keys.
	//
	// See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v1/draft/extensibility)
	Meta map[string]any `json:"_meta,omitempty"`
	// The ID of the option the user selected.
	OptionId PermissionOptionId `json:"optionId"`
}

The user selected one of the provided options.

type SessionAdditionalDirectoriesCapabilities

type SessionAdditionalDirectoriesCapabilities struct {
	// The _meta property is reserved by ACP to allow clients and agents to attach additional
	// metadata to their interactions. Implementations MUST NOT make assumptions about values at
	// these keys.
	//
	// See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v1/draft/extensibility)
	Meta map[string]any `json:"_meta,omitempty"`
}

Capabilities for additional session directories support.

Supplying '{}' means the agent supports the 'additionalDirectories' field on supported session lifecycle requests. Agents that also support 'session/list' may return 'SessionInfo.additionalDirectories' to report the complete ordered additional-root list associated with a listed session.

type SessionArchiveCapabilities

type SessionArchiveCapabilities struct {
	// The _meta property is reserved by ACP to allow clients and agents to attach additional
	// metadata to their interactions. Implementations MUST NOT make assumptions about values at
	// these keys.
	//
	// See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v1/draft/extensibility)
	Meta map[string]any `json:"_meta,omitempty"`
}

**UNSTABLE**

This capability is not part of the spec yet, and may be removed or changed at any point.

Capabilities for 'session/archive' and 'session/unarchive'.

Supplying '{}' means the agent supports both methods, the 'archived' filter on 'session/list', and 'SessionInfo.archived'.

type SessionArchiveFilter

type SessionArchiveFilter string

**UNSTABLE**

This capability is not part of the spec yet, and may be removed or changed at any point.

Which sessions 'session/list' returns based on their archive state.

Unknown values are preserved so they can be stored, proxied, or forwarded. An Agent MUST return '-32602' for a value it does not support rather than treating it as 'exclude'.

const (
	SessionArchiveFilterExclude SessionArchiveFilter = "exclude"
	SessionArchiveFilterInclude SessionArchiveFilter = "include"
	SessionArchiveFilterOnly    SessionArchiveFilter = "only"
)

type SessionAvailableCommandsUpdate

type SessionAvailableCommandsUpdate struct {
	// The _meta property is reserved by ACP to allow clients and agents to attach additional
	// metadata to their interactions. Implementations MUST NOT make assumptions about values at
	// these keys.
	//
	// See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v1/draft/extensibility)
	Meta map[string]any `json:"_meta,omitempty"`
	// Commands the agent can execute
	AvailableCommands []AvailableCommand `json:"availableCommands"`
	SessionUpdate     string             `json:"sessionUpdate"`
}

Available commands are ready or have changed

type SessionCancelCapabilities

type SessionCancelCapabilities struct {
	// The _meta property is reserved by ACP to allow clients and agents to attach additional
	// metadata to their interactions. Implementations MUST NOT make assumptions about values at
	// these keys.
	//
	// See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v1/draft/extensibility)
	Meta map[string]any `json:"_meta,omitempty"`
}

**UNSTABLE**

This capability is not part of the spec yet, and may be removed or changed at any point.

Capability to cancel work in a subagent session without ending that session.

Supplying '{}' advertises support. An omitted or 'null' 'cancel' does not.

type SessionCapabilities

type SessionCapabilities struct {
	// The _meta property is reserved by ACP to allow clients and agents to attach additional
	// metadata to their interactions. Implementations MUST NOT make assumptions about values at
	// these keys.
	//
	// See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v1/draft/extensibility)
	Meta map[string]any `json:"_meta,omitempty"`
	// Whether the agent supports 'additionalDirectories' on supported session lifecycle requests.
	//
	// Optional. Omitted or 'null' both mean the agent does not advertise support.
	// Supplying '{}' means the agent supports 'additionalDirectories' on
	// supported session lifecycle requests.
	//
	// Agents that also support 'session/list' may return
	// 'SessionInfo.additionalDirectories' to report the complete ordered
	// additional-root list associated with a listed session.
	AdditionalDirectories *SessionAdditionalDirectoriesCapabilities `json:"additionalDirectories,omitzero"`
	// **UNSTABLE**
	//
	// This capability is not part of the spec yet, and may be removed or changed at any point.
	//
	// Whether the agent supports 'session/archive' and 'session/unarchive'.
	//
	// Optional. Omitted or 'null' both mean the agent does not advertise support.
	// Supplying '{}' means the agent supports both methods, the 'archived' filter on
	// 'session/list', and 'SessionInfo.archived'. Agents that advertise it MUST also advertise 'sessionCapabilities.list'.
	Archive *SessionArchiveCapabilities `json:"archive,omitzero"`
	// Whether the agent supports 'session/close'.
	//
	// Optional. Omitted or 'null' both mean the agent does not advertise support.
	// Supplying '{}' means the agent supports closing sessions.
	Close *SessionCloseCapabilities `json:"close,omitzero"`
	// Whether the agent supports 'session/delete'.
	//
	// Optional. Omitted or 'null' both mean the agent does not advertise support.
	// Supplying '{}' means the agent supports deleting sessions from 'session/list'.
	Delete *SessionDeleteCapabilities `json:"delete,omitzero"`
	// **UNSTABLE**
	//
	// This capability is not part of the spec yet, and may be removed or changed at any point.
	//
	// Whether the agent supports 'session/fork'.
	//
	// Optional. Omitted or 'null' both mean the agent does not advertise support.
	// Supplying '{}' means the agent supports forking sessions.
	Fork *SessionForkCapabilities `json:"fork,omitzero"`
	// Whether the agent supports 'session/list'.
	//
	// Optional. Omitted or 'null' both mean the agent does not advertise support.
	// Supplying '{}' means the agent supports listing sessions.
	List *SessionListCapabilities `json:"list,omitzero"`
	// **UNSTABLE**
	//
	// This capability is not part of the spec yet, and may be removed or changed at any point.
	//
	// Whether the agent supports 'session/options'.
	//
	// Optional. Omitted or 'null' both mean the agent does not advertise support.
	// Supplying '{}' means the agent supports 'session/options' and accepts initial
	// config option values on session setup requests.
	Options *SessionOptionsCapabilities `json:"options,omitzero"`
	// Whether the agent supports 'session/resume'.
	//
	// Optional. Omitted or 'null' both mean the agent does not advertise support.
	// Supplying '{}' means the agent supports resuming sessions.
	Resume *SessionResumeCapabilities `json:"resume,omitzero"`
	// **UNSTABLE**
	//
	// This capability is not part of the spec yet, and may be removed or changed at any point.
	//
	// Whether the agent supports 'session/status'.
	//
	// Optional. Omitted or 'null' both mean the agent does not advertise support.
	// Supplying '{}' means the agent supports checking session status.
	Status *SessionStatusCapabilities `json:"status,omitzero"`
	// Whether the agent supports 'systemPrompt' on session lifecycle requests.
	//
	// Optional. Omitted or 'null' both mean the agent does not advertise support.
	// Supplying '{}' means the agent supports 'systemPrompt' in 'append' mode.
	SystemPrompt *SessionSystemPromptCapabilities `json:"systemPrompt,omitzero"`
	// **UNSTABLE**
	//
	// This capability is not part of the spec yet, and may be removed or changed at any point.
	//
	// Whether the agent supports 'session/set_title'.
	//
	// Agents report titles through 'session/list' and 'session_info_update' without this
	// capability. It only advertises that Clients can set titles.
	//
	// Optional. Omitted or 'null' both mean the agent does not advertise support.
	// Supplying '{}' means the agent supports setting session titles.
	Title *SessionTitleCapabilities `json:"title,omitzero"`
}

Session capabilities supported by the agent.

As a baseline, all Agents **MUST** support 'session/new', 'session/prompt', 'session/cancel', and 'session/update'.

Optionally, they **MAY** support other session methods and notifications by specifying additional capabilities.

Note: 'session/load' is still handled by the top-level 'loadSession' capability. This will be unified in future versions of the protocol.

See protocol docs: [Session Capabilities](https://agentclientprotocol.com/protocol/v1/draft/initialization#session-capabilities)

type SessionCloseCapabilities

type SessionCloseCapabilities struct {
	// The _meta property is reserved by ACP to allow clients and agents to attach additional
	// metadata to their interactions. Implementations MUST NOT make assumptions about values at
	// these keys.
	//
	// See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v1/draft/extensibility)
	Meta map[string]any `json:"_meta,omitempty"`
}

Capabilities for the 'session/close' method.

Supplying '{}' means the agent supports closing sessions.

type SessionCompactionUpdate

type SessionCompactionUpdate struct {
	// Extensible metadata patch for this compaction.
	Meta map[string]any `json:"_meta,omitempty"`
	// The Agent-owned ID of this compaction, unique within the session.
	CompactionId CompactionId `json:"compactionId"`
	// Human-readable error details for the compaction.
	Error         *string `json:"error,omitzero"`
	SessionUpdate string  `json:"sessionUpdate"`
	// Current lifecycle status.
	Status CompactionStatus `json:"status"`
	// Complete replacement user-displayable summary content for the compaction.
	Summary []ContentBlock `json:"summary,omitempty"`
}

A context compaction has been created or updated.

Agents MUST only send this update when the Client advertised the 'session.compaction' Client capability.

type SessionConfigBoolean

type SessionConfigBoolean struct {
	// The current value of the boolean option.
	CurrentValue bool `json:"currentValue"`
}

A boolean on/off toggle session configuration option payload.

type SessionConfigGroupId

type SessionConfigGroupId string

Unique identifier for a session configuration option value group.

type SessionConfigId

type SessionConfigId string

Unique identifier for a session configuration option.

type SessionConfigOption

type SessionConfigOption struct {
	// Single-value selector (dropdown).
	Select *SessionConfigOptionSelect `json:"-"`
	// Boolean on/off toggle.
	Boolean *SessionConfigOptionBoolean `json:"-"`
}

func NewSessionConfigOptionBoolean

func NewSessionConfigOptionBoolean(currentValue bool) SessionConfigOption

NewSessionConfigOptionBoolean constructs a SessionConfigOption using the 'boolean' variant.

func NewSessionConfigOptionSelect

func NewSessionConfigOptionSelect(currentValue SessionConfigValueId, options SessionConfigSelectOptions) SessionConfigOption

NewSessionConfigOptionSelect constructs a SessionConfigOption using the 'select' variant.

func (SessionConfigOption) MarshalJSONTo

func (u SessionConfigOption) MarshalJSONTo(enc *jsontext.Encoder) error

func (*SessionConfigOption) UnmarshalJSONFrom

func (u *SessionConfigOption) UnmarshalJSONFrom(dec *jsontext.Decoder) error

func (*SessionConfigOption) Validate

func (u *SessionConfigOption) Validate() error

type SessionConfigOptionBoolean

type SessionConfigOptionBoolean struct {
	// The _meta property is reserved by ACP to allow clients and agents to attach additional
	// metadata to their interactions. Implementations MUST NOT make assumptions about values at
	// these keys.
	//
	// See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v1/draft/extensibility)
	Meta map[string]any `json:"_meta,omitempty"`
	// Optional semantic category for this option (UX only).
	Category *SessionConfigOptionCategory `json:"category,omitzero"`
	// The current value of the boolean option.
	CurrentValue bool `json:"currentValue"`
	// Optional description for the Client to display to the user.
	Description *string `json:"description,omitzero"`
	// Unique identifier for the configuration option.
	Id SessionConfigId `json:"id"`
	// Human-readable label for the option.
	Name string `json:"name"`
	Type string `json:"type"`
}

Boolean on/off toggle.

type SessionConfigOptionCategory

type SessionConfigOptionCategory string

Semantic category for a session configuration option.

This is intended to help Clients distinguish broadly common selectors (e.g. model selector vs session mode selector vs thought/reasoning level) for UX purposes (keyboard shortcuts, icons, placement). It MUST NOT be required for correctness. Clients MUST handle missing or unknown categories gracefully.

Category names beginning with '_' are free for custom use, like other ACP extension methods. Category names that do not begin with '_' are reserved for the ACP spec.

const (
	SessionConfigOptionCategoryMode         SessionConfigOptionCategory = "mode"
	SessionConfigOptionCategoryModel        SessionConfigOptionCategory = "model"
	SessionConfigOptionCategoryModelConfig  SessionConfigOptionCategory = "model_config"
	SessionConfigOptionCategoryThoughtLevel SessionConfigOptionCategory = "thought_level"
)

type SessionConfigOptionSelect

type SessionConfigOptionSelect struct {
	// The _meta property is reserved by ACP to allow clients and agents to attach additional
	// metadata to their interactions. Implementations MUST NOT make assumptions about values at
	// these keys.
	//
	// See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v1/draft/extensibility)
	Meta map[string]any `json:"_meta,omitempty"`
	// Optional semantic category for this option (UX only).
	Category *SessionConfigOptionCategory `json:"category,omitzero"`
	// The currently selected value.
	CurrentValue SessionConfigValueId `json:"currentValue"`
	// Optional description for the Client to display to the user.
	Description *string `json:"description,omitzero"`
	// Unique identifier for the configuration option.
	Id SessionConfigId `json:"id"`
	// Human-readable label for the option.
	Name string `json:"name"`
	// The set of selectable options.
	Options SessionConfigSelectOptions `json:"options"`
	Type    string                     `json:"type"`
}

A session configuration option selector and its current state. Single-value selector (dropdown).

type SessionConfigOptionUpdate

type SessionConfigOptionUpdate struct {
	// The _meta property is reserved by ACP to allow clients and agents to attach additional
	// metadata to their interactions. Implementations MUST NOT make assumptions about values at
	// these keys.
	//
	// See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v1/draft/extensibility)
	Meta map[string]any `json:"_meta,omitempty"`
	// The full set of configuration options and their current values.
	ConfigOptions []SessionConfigOption `json:"configOptions"`
	SessionUpdate string                `json:"sessionUpdate"`
}

Session configuration options have been updated.

type SessionConfigOptionsCapabilities

type SessionConfigOptionsCapabilities struct {
	// The _meta property is reserved by ACP to allow clients and agents to attach additional
	// metadata to their interactions. Implementations MUST NOT make assumptions about values at
	// these keys.
	//
	// See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v1/draft/extensibility)
	Meta map[string]any `json:"_meta,omitempty"`
	// Whether the client supports boolean session configuration options.
	//
	// Optional. Omitted or 'null' both mean the client does not advertise support.
	// Supplying '{}' means agents may include 'type: "boolean"' entries in
	// 'configOptions', and the client may send 'session/set_config_option'
	// requests with 'type: "boolean"' and a boolean 'value'.
	Boolean *BooleanConfigOptionCapabilities `json:"boolean,omitzero"`
}

Session configuration option capabilities supported by the client.

type SessionConfigSelect

type SessionConfigSelect struct {
	// The currently selected value.
	CurrentValue SessionConfigValueId `json:"currentValue"`
	// The set of selectable options.
	Options SessionConfigSelectOptions `json:"options"`
}

A single-value selector (dropdown) session configuration option payload.

type SessionConfigSelectGroup

type SessionConfigSelectGroup struct {
	// The _meta property is reserved by ACP to allow clients and agents to attach additional
	// metadata to their interactions. Implementations MUST NOT make assumptions about values at
	// these keys.
	//
	// See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v1/draft/extensibility)
	Meta map[string]any `json:"_meta,omitempty"`
	// Unique identifier for this group.
	Group SessionConfigGroupId `json:"group"`
	// Human-readable label for this group.
	Name string `json:"name"`
	// The set of option values in this group.
	Options []SessionConfigSelectOption `json:"options"`
}

A group of possible values for a session configuration option.

type SessionConfigSelectOption

type SessionConfigSelectOption struct {
	// The _meta property is reserved by ACP to allow clients and agents to attach additional
	// metadata to their interactions. Implementations MUST NOT make assumptions about values at
	// these keys.
	//
	// See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v1/draft/extensibility)
	Meta map[string]any `json:"_meta,omitempty"`
	// Optional description for this option value.
	Description *string `json:"description,omitzero"`
	// Human-readable label for this option value.
	Name string `json:"name"`
	// Unique identifier for this option value.
	Value SessionConfigValueId `json:"value"`
}

A possible value for a session configuration option.

type SessionConfigSelectOptions

type SessionConfigSelectOptions struct {
	// A flat list of options with no grouping.
	Ungrouped *SessionConfigSelectOptionsUngrouped `json:"-"`
	// A list of options grouped under headers.
	Grouped *SessionConfigSelectOptionsGrouped `json:"-"`
}

func (SessionConfigSelectOptions) MarshalJSONTo

func (u SessionConfigSelectOptions) MarshalJSONTo(enc *jsontext.Encoder) error

func (*SessionConfigSelectOptions) UnmarshalJSONFrom

func (u *SessionConfigSelectOptions) UnmarshalJSONFrom(dec *jsontext.Decoder) error

type SessionConfigSelectOptionsGrouped

type SessionConfigSelectOptionsGrouped []SessionConfigSelectGroup

A list of options grouped under headers.

type SessionConfigSelectOptionsUngrouped

type SessionConfigSelectOptionsUngrouped []SessionConfigSelectOption

Possible values for a session configuration option. A flat list of options with no grouping.

type SessionConfigValueId

type SessionConfigValueId string

Unique identifier for a session configuration option value.

type SessionCurrentModeUpdate

type SessionCurrentModeUpdate struct {
	// The _meta property is reserved by ACP to allow clients and agents to attach additional
	// metadata to their interactions. Implementations MUST NOT make assumptions about values at
	// these keys.
	//
	// See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v1/draft/extensibility)
	Meta map[string]any `json:"_meta,omitempty"`
	// The ID of the current mode
	CurrentModeId SessionModeId `json:"currentModeId"`
	SessionUpdate string        `json:"sessionUpdate"`
}

The current mode of the session has changed

See protocol docs: [Session Modes](https://agentclientprotocol.com/protocol/v1/draft/session-modes)

type SessionDeleteCapabilities

type SessionDeleteCapabilities struct {
	// The _meta property is reserved by ACP to allow clients and agents to attach additional
	// metadata to their interactions. Implementations MUST NOT make assumptions about values at
	// these keys.
	//
	// See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v1/draft/extensibility)
	Meta map[string]any `json:"_meta,omitempty"`
}

Capabilities for the 'session/delete' method.

Supplying '{}' means the agent supports deleting sessions from 'session/list'.

type SessionForkCapabilities

type SessionForkCapabilities struct {
	// The _meta property is reserved by ACP to allow clients and agents to attach additional
	// metadata to their interactions. Implementations MUST NOT make assumptions about values at
	// these keys.
	//
	// See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v1/draft/extensibility)
	Meta map[string]any `json:"_meta,omitempty"`
}

**UNSTABLE**

This capability is not part of the spec yet, and may be removed or changed at any point.

Capabilities for the 'session/fork' method.

Supplying '{}' means the agent supports forking sessions.

type SessionId

type SessionId string

A unique identifier for a conversation session between a client and agent.

Each session has its own context, conversation history, and state, so one agent can run several independent sessions.

See protocol docs: [Session ID](https://agentclientprotocol.com/protocol/v1/draft/session-setup#session-id)

type SessionInfo

type SessionInfo struct {
	// The _meta property is reserved by ACP to allow clients and agents to attach additional
	// metadata to their interactions. Implementations MUST NOT make assumptions about values at
	// these keys.
	//
	// See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v1/draft/extensibility)
	Meta map[string]any `json:"_meta,omitempty"`
	// Additional workspace roots reported for this session. Each path must be absolute.
	//
	// When present, this is the complete ordered additional-root list reported
	// by the Agent. Omitted and empty values are equivalent: the response
	// reports no additional roots.
	AdditionalDirectories []string `json:"additionalDirectories,omitempty"`
	// **UNSTABLE**
	//
	// This capability is not part of the spec yet, and may be removed or changed at any point.
	//
	// Whether the session is archived.
	//
	// Optional. Omitted and 'null' are equivalent and mean the archive state is not reported.
	// Agents that advertise the 'sessionCapabilities.archive' capability MUST include it on every listed session.
	Archived *bool `json:"archived,omitzero"`
	// The working directory for this session. Must be an absolute path.
	Cwd string `json:"cwd"`
	// Unique identifier for the session
	SessionId SessionId `json:"sessionId"`
	// Human-readable title for the session
	Title *string `json:"title,omitzero"`
	// ISO 8601 timestamp of last activity
	UpdatedAt *string `json:"updatedAt,omitzero"`
}

Information about a session returned by session/list

type SessionInfoUpdate

type SessionInfoUpdate struct {
	// The _meta property is reserved by ACP to allow clients and agents to attach additional
	// metadata to their interactions. Implementations MUST NOT make assumptions about values at
	// these keys.
	//
	// See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v1/draft/extensibility)
	Meta map[string]any `json:"_meta,omitempty"`
	// Human-readable title for the session. Set to null to clear.
	Title *string `json:"title,omitzero"`
	// ISO 8601 timestamp of last activity. Set to null to clear.
	UpdatedAt *string `json:"updatedAt,omitzero"`
}

Update to session metadata. All fields are optional to support partial updates.

Agents send this notification to update session information like title or custom metadata. Clients can use it to keep session titles and state current.

type SessionListCapabilities

type SessionListCapabilities struct {
	// The _meta property is reserved by ACP to allow clients and agents to attach additional
	// metadata to their interactions. Implementations MUST NOT make assumptions about values at
	// these keys.
	//
	// See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v1/draft/extensibility)
	Meta map[string]any `json:"_meta,omitempty"`
}

Capabilities for the 'session/list' method.

Supplying '{}' means the agent supports listing sessions.

type SessionMessage

type SessionMessage struct {
	// Omitted leaves metadata unchanged. 'null' removes it.
	//
	// Implementations MUST NOT make assumptions about values in '_meta'.
	Meta map[string]any `json:"_meta,omitempty"`
	// Omitted leaves content unchanged. 'null' or '[]' clears it.
	// A non-empty array replaces all content.
	Content []ContentBlock `json:"content,omitempty"`
	// Identifier of this message within the enclosing session's transcript.
	MessageId MessageId `json:"messageId"`
	// On an outgoing view, the 'messageId' of the same message's incoming view in the
	// recipient's transcript.
	//
	// Omitted leaves the stored value unchanged. 'null' clears it. A value replaces it. It can arrive
	// after the message starts streaming.
	RecipientMessageId *MessageId `json:"recipientMessageId,omitzero"`
	// The receiving session.
	//
	// Omitted leaves the stored value unchanged. 'null' clears it. A value replaces it.
	RecipientSessionId *SessionId `json:"recipientSessionId,omitzero"`
	// On an incoming view, the 'messageId' of the same message's outgoing view in the
	// sender's transcript.
	//
	// Omitted leaves the stored value unchanged. 'null' clears it. A value replaces it. It can arrive
	// after the message starts streaming.
	SenderMessageId *MessageId `json:"senderMessageId,omitzero"`
	// The sending session.
	//
	// Omitted leaves the stored value unchanged. 'null' clears it. A value replaces it.
	SenderSessionId *SessionId `json:"senderSessionId,omitzero"`
}

**UNSTABLE**

This capability is not part of the spec yet, and may be removed or changed at any point.

An upsert for an inter-session message.

type SessionMessageChunk

type SessionMessageChunk struct {
	// Optional and nullable chunk-scoped metadata. Omitted or 'null' means none.
	//
	// Implementations MUST NOT make assumptions about values in '_meta'.
	Meta map[string]any `json:"_meta,omitempty"`
	// A single content block appended to the message.
	Content ContentBlock `json:"content"`
	// Identifier of this message within the enclosing session's transcript.
	MessageId MessageId `json:"messageId"`
}

**UNSTABLE**

This capability is not part of the spec yet, and may be removed or changed at any point.

A streamed content block of an inter-session message.

A chunk carries only content. The message's participants and references come from 'session_message' upserts, which can arrive before, between, or after its chunks.

type SessionMode

type SessionMode struct {
	// The _meta property is reserved by ACP to allow clients and agents to attach additional
	// metadata to their interactions. Implementations MUST NOT make assumptions about values at
	// these keys.
	//
	// See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v1/draft/extensibility)
	Meta map[string]any `json:"_meta,omitempty"`
	// Optional human-readable details shown with this protocol object.
	Description *string `json:"description,omitzero"`
	// Stable identifier used to refer to this protocol object in later messages.
	Id SessionModeId `json:"id"`
	// Human-readable name shown for this protocol object.
	Name string `json:"name"`
}

A mode the agent can operate in.

See protocol docs: [Session Modes](https://agentclientprotocol.com/protocol/v1/draft/session-modes)

type SessionModeId

type SessionModeId string

Unique identifier for a Session Mode.

type SessionModeState

type SessionModeState struct {
	// The _meta property is reserved by ACP to allow clients and agents to attach additional
	// metadata to their interactions. Implementations MUST NOT make assumptions about values at
	// these keys.
	//
	// See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v1/draft/extensibility)
	Meta map[string]any `json:"_meta,omitempty"`
	// The set of modes that the Agent can operate in
	AvailableModes []SessionMode `json:"availableModes"`
	// The current mode the Agent is in.
	CurrentModeId SessionModeId `json:"currentModeId"`
}

The set of modes and the one currently active.

type SessionNotification

type SessionNotification struct {
	// The _meta property is reserved by ACP to allow clients and agents to attach additional
	// metadata to their interactions. Implementations MUST NOT make assumptions about values at
	// these keys.
	//
	// See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v1/draft/extensibility)
	Meta map[string]any `json:"_meta,omitempty"`
	// The ID of the session this update pertains to.
	SessionId SessionId `json:"sessionId"`
	// The actual update content.
	Update SessionUpdate `json:"update"`
}

Notification containing a session update from the agent.

Used to stream real-time progress and results during prompt processing.

See protocol docs: [Agent Reports Output](https://agentclientprotocol.com/protocol/v1/draft/prompt-turn#3-agent-reports-output)

func (*SessionNotification) Validate

func (v *SessionNotification) Validate() error

type SessionOptionsCapabilities

type SessionOptionsCapabilities struct {
	// The _meta property is reserved by ACP to allow clients and agents to attach additional
	// metadata to their interactions. Implementations MUST NOT make assumptions about values at
	// these keys.
	//
	// See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v1/draft/extensibility)
	Meta map[string]any `json:"_meta,omitempty"`
}

**UNSTABLE**

This capability is not part of the spec yet, and may be removed or changed at any point.

Capabilities for the 'session/options' method.

Supplying '{}' means the agent supports 'session/options' and accepts initial config option values on session setup requests.

type SessionPlanUpdate

type SessionPlanUpdate struct {
	// The _meta property is reserved by ACP to allow clients and agents to attach additional
	// metadata to their interactions. Implementations MUST NOT make assumptions about values at
	// these keys.
	//
	// See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v1/draft/extensibility)
	Meta map[string]any `json:"_meta,omitempty"`
	// The updated plan content.
	Plan          PlanUpdateContent `json:"plan"`
	SessionUpdate string            `json:"sessionUpdate"`
}

**UNSTABLE**

This capability is not part of the spec yet, and may be removed or changed at any point.

A content update for a plan identified by ID.

type SessionReference

type SessionReference struct {
	// The _meta property is reserved by ACP to allow clients and agents to attach additional
	// metadata to their interactions. Implementations MUST NOT make assumptions about values at
	// these keys.
	//
	// See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v1/draft/extensibility)
	Meta map[string]any `json:"_meta,omitempty"`
	// The referenced session.
	SessionId SessionId `json:"sessionId"`
}

**UNSTABLE**

This capability is not part of the spec yet, and may be removed or changed at any point.

A display-only reference to another session that this tool call operates on, such as a subagent it created, delegated to, or is waiting on.

The referenced session must already be known to the Client through ordinary session setup or a 'subagent_update' announcement. The reference does not establish ownership, grant any Client-initiated controls, or report that the referenced session received or finished any work.

type SessionResumeCapabilities

type SessionResumeCapabilities struct {
	// The _meta property is reserved by ACP to allow clients and agents to attach additional
	// metadata to their interactions. Implementations MUST NOT make assumptions about values at
	// these keys.
	//
	// See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v1/draft/extensibility)
	Meta map[string]any `json:"_meta,omitempty"`
}

Capabilities for the 'session/resume' method.

Supplying '{}' means the agent supports resuming sessions.

type SessionSessionInfoUpdate

type SessionSessionInfoUpdate struct {
	// The _meta property is reserved by ACP to allow clients and agents to attach additional
	// metadata to their interactions. Implementations MUST NOT make assumptions about values at
	// these keys.
	//
	// See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v1/draft/extensibility)
	Meta          map[string]any `json:"_meta,omitempty"`
	SessionUpdate string         `json:"sessionUpdate"`
	// Human-readable title for the session. Set to null to clear.
	Title *string `json:"title,omitzero"`
	// ISO 8601 timestamp of last activity. Set to null to clear.
	UpdatedAt *string `json:"updatedAt,omitzero"`
}

Session metadata has been updated (title, timestamps, custom metadata)

type SessionStatusCapabilities

type SessionStatusCapabilities struct {
	// The _meta property is reserved by ACP to allow clients and agents to attach additional
	// metadata to their interactions. Implementations MUST NOT make assumptions about values at
	// these keys.
	//
	// See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v1/draft/extensibility)
	Meta map[string]any `json:"_meta,omitempty"`
}

**UNSTABLE**

This capability is not part of the spec yet, and may be removed or changed at any point.

Capabilities for the 'session/status' method.

Supplying '{}' means the agent supports checking session status.

type SessionSubagentUpdate

type SessionSubagentUpdate struct {
	// The _meta property is reserved by ACP to allow clients and agents to attach additional
	// metadata to their interactions. Implementations MUST NOT make assumptions about values at
	// these keys.
	//
	// See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v1/draft/extensibility)
	// Omitted means unchanged. 'null' removes the metadata.
	Meta map[string]any `json:"_meta,omitempty"`
	// Additional workspace roots for the child. Each path must be absolute.
	//
	// Optional and nullable. Omitted means unchanged. 'null' clears the
	// reported value. While unset, the child inherits its immediate parent's
	// effective additional directories, independently of 'cwd'. A concrete
	// array replaces the whole list. '[]' reports no additional directories.
	// Clients use these values for the child's root set.
	AdditionalDirectories []string `json:"additionalDirectories,omitempty"`
	// Client-initiated session mutations permitted for this subagent session.
	//
	// Omitted means unchanged. 'null' clears the capability set and disables
	// child mutations. If never supplied, no session mutations are permitted.
	// Read-only operations retain their normal protocol semantics and capability
	// requirements. A concrete object replaces the whole capability set.
	Capabilities *SubagentSessionCapabilities `json:"capabilities,omitzero"`
	// The child's working directory. Must be an absolute path.
	//
	// Optional and nullable. Omitted means unchanged. 'null' clears the
	// reported value. While unset, the child inherits its immediate parent's
	// effective working directory. Clients use this value for the child's
	// root set and as the default terminal working directory.
	Cwd *string `json:"cwd,omitzero"`
	// The parent's human-readable description of the child's role or purpose.
	//
	// Omitted means unchanged. 'null' clears it. If unset, the Client chooses
	// a fallback presentation. This is current display metadata, not the
	// history of instructions sent to the child.
	Description *string `json:"description,omitzero"`
	// The opaque session ID identifying the child in all ACP messages.
	SessionId     SessionId `json:"sessionId"`
	SessionUpdate string    `json:"sessionUpdate"`
	// Current state snapshot for the child session.
	//
	// Omitted means unchanged. 'null' clears the current activity without
	// asserting idle or sending an 'unknown' snapshot. A concrete state
	// replaces the previous state object wholesale. If never supplied, the
	// current activity is unset/unconfirmed.
	State *StateUpdate `json:"state,omitzero"`
	// The parent's human-readable display title for this child. It need not be unique.
	//
	// Omitted means unchanged. 'null' clears it. If unset, the Client chooses
	// a fallback presentation.
	Title *string `json:"title,omitzero"`
}

**UNSTABLE**

This capability is not part of the spec yet, and may be removed or changed at any point.

Announces a child session created and owned by this session, or updates that ownership association's metadata.

type SessionSystemPromptCapabilities

type SessionSystemPromptCapabilities struct {
	// The _meta property is reserved by ACP to allow clients and agents to attach additional
	// metadata to their interactions. Implementations MUST NOT make assumptions about values at
	// these keys.
	//
	// See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v1/draft/extensibility)
	Meta map[string]any `json:"_meta,omitempty"`
	// Delivery modes the agent supports in addition to 'append'.
	//
	// Optional. Omitted or 'null' both mean the agent supports only 'append'.
	Mode *SessionSystemPromptModeCapabilities `json:"mode,omitzero"`
}

Capabilities for client-provided system prompts.

Supplying '{}' means the agent supports 'systemPrompt' on session lifecycle requests in 'append' mode.

type SessionSystemPromptModeCapabilities

type SessionSystemPromptModeCapabilities struct {
	// The _meta property is reserved by ACP to allow clients and agents to attach additional
	// metadata to their interactions. Implementations MUST NOT make assumptions about values at
	// these keys.
	//
	// See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v1/draft/extensibility)
	Meta map[string]any `json:"_meta,omitempty"`
	// Whether the agent supports 'override' mode.
	//
	// Optional. Omitted or 'null' both mean the agent does not advertise support.
	// Supplying '{}' means the agent supports replacing its built-in default
	// instructions with the client-provided system prompt.
	Override *SessionSystemPromptOverrideCapabilities `json:"override,omitzero"`
}

System prompt delivery modes the agent supports in addition to 'append'.

'append' has no entry because every agent advertising 'sessionCapabilities.systemPrompt' supports it.

type SessionSystemPromptOverrideCapabilities

type SessionSystemPromptOverrideCapabilities struct {
	// The _meta property is reserved by ACP to allow clients and agents to attach additional
	// metadata to their interactions. Implementations MUST NOT make assumptions about values at
	// these keys.
	//
	// See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v1/draft/extensibility)
	Meta map[string]any `json:"_meta,omitempty"`
}

Capabilities for the 'override' system prompt mode.

Supplying '{}' means the agent supports replacing its built-in default instructions with the client-provided system prompt.

type SessionTitleCapabilities

type SessionTitleCapabilities struct {
	// The _meta property is reserved by ACP to allow clients and agents to attach additional
	// metadata to their interactions. Implementations MUST NOT make assumptions about values at
	// these keys.
	//
	// See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v1/draft/extensibility)
	Meta map[string]any `json:"_meta,omitempty"`
}

**UNSTABLE**

This capability is not part of the spec yet, and may be removed or changed at any point.

Capabilities for Client-set session titles.

Supplying '{}' means the agent supports 'session/set_title'. Agents report titles through 'session/list' and 'session_info_update' without this capability.

type SessionToolCallUpdate

type SessionToolCallUpdate struct {
	// The _meta property is reserved by ACP to allow clients and agents to attach additional
	// metadata to their interactions. Implementations MUST NOT make assumptions about values at
	// these keys.
	//
	// See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v1/draft/extensibility)
	Meta map[string]any `json:"_meta,omitempty"`
	// Replace the content collection.
	Content []ToolCallContent `json:"content,omitempty"`
	// Update the tool kind.
	Kind *ToolKind `json:"kind,omitzero"`
	// Replace the locations collection.
	Locations []ToolCallLocation `json:"locations,omitempty"`
	// Update the programmatic name of the tool being invoked.
	//
	// This field is optional. Omitting it or sending 'null' both mean that
	// the existing name is left unchanged.
	Name *string `json:"name,omitzero"`
	// Update the raw input.
	RawInput any `json:"rawInput,omitzero"`
	// Update the raw output.
	RawOutput     any    `json:"rawOutput,omitzero"`
	SessionUpdate string `json:"sessionUpdate"`
	// Update the execution status.
	Status *ToolCallStatus `json:"status,omitzero"`
	// Update the human-readable title.
	Title *string `json:"title,omitzero"`
	// The ID of the tool call being updated.
	ToolCallId ToolCallId `json:"toolCallId"`
}

Update on the status or results of a tool call.

type SessionUpdate

type SessionUpdate struct {
	// A chunk of the user's message being streamed.
	UserMessageChunk *SessionUpdateUserMessageChunk `json:"-"`
	// A chunk of the agent's response being streamed.
	AgentMessageChunk *SessionUpdateAgentMessageChunk `json:"-"`
	// A chunk of the agent's internal reasoning being streamed.
	AgentThoughtChunk *SessionUpdateAgentThoughtChunk `json:"-"`
	// Notification that a new tool call has been initiated.
	ToolCall *SessionUpdateToolCall `json:"-"`
	// Update on the status or results of a tool call.
	ToolCallUpdate *SessionToolCallUpdate `json:"-"`
	// The agent's execution plan for complex tasks.
	// See protocol docs: [Agent Plan](https://agentclientprotocol.com/protocol/v1/draft/agent-plan)
	Plan *SessionUpdatePlan `json:"-"`
	// **UNSTABLE**
	//
	// This capability is not part of the spec yet, and may be removed or changed at any point.
	//
	// A content update for a plan identified by ID.
	PlanUpdate *SessionPlanUpdate `json:"-"`
	// **UNSTABLE**
	//
	// This capability is not part of the spec yet, and may be removed or changed at any point.
	//
	// Removal notice for a plan identified by ID.
	PlanRemoved *SessionUpdatePlanRemoved `json:"-"`
	// Available commands are ready or have changed
	AvailableCommandsUpdate *SessionAvailableCommandsUpdate `json:"-"`
	// The current mode of the session has changed
	//
	// See protocol docs: [Session Modes](https://agentclientprotocol.com/protocol/v1/draft/session-modes)
	CurrentModeUpdate *SessionCurrentModeUpdate `json:"-"`
	// Session configuration options have been updated.
	ConfigOptionUpdate *SessionConfigOptionUpdate `json:"-"`
	// Session metadata has been updated (title, timestamps, custom metadata)
	SessionInfoUpdate *SessionSessionInfoUpdate `json:"-"`
	// Context window and cost update for the session.
	UsageUpdate *SessionUsageUpdate `json:"-"`
	// Information for the user that is not part of session history.
	//
	// Agents MUST only send this update when the Client advertised
	// the 'session.notices' Client capability.
	Notice *SessionUpdateNotice `json:"-"`
	// A context compaction has been created or updated.
	//
	// Agents MUST only send this update when the Client advertised
	// the 'session.compaction' Client capability.
	CompactionUpdate *SessionCompactionUpdate `json:"-"`
	// A content block appended to a context compaction's retained summary.
	//
	// Agents MUST only send this update when the Client advertised
	// the 'session.compaction' Client capability.
	CompactionSummaryChunk *SessionUpdateCompactionSummaryChunk `json:"-"`
	// **UNSTABLE**
	//
	// This capability is not part of the spec yet, and may be removed or changed at any point.
	//
	// Announces a child session created and owned by this session, or updates
	// that ownership association's metadata.
	SubagentUpdate *SessionSubagentUpdate `json:"-"`
	// **UNSTABLE**
	//
	// This capability is not part of the spec yet, and may be removed or changed at any point.
	//
	// A message upsert observed in this session's transcript, sent to or
	// received from another session.
	SessionMessage *SessionUpdateSessionMessage `json:"-"`
	// **UNSTABLE**
	//
	// This capability is not part of the spec yet, and may be removed or changed at any point.
	//
	// One content block appended to a sent or received session message.
	SessionMessageChunk *SessionUpdateSessionMessageChunk `json:"-"`
}

func (SessionUpdate) MarshalJSONTo

func (u SessionUpdate) MarshalJSONTo(enc *jsontext.Encoder) error

func (*SessionUpdate) UnmarshalJSONFrom

func (u *SessionUpdate) UnmarshalJSONFrom(dec *jsontext.Decoder) error

func (*SessionUpdate) Validate

func (u *SessionUpdate) Validate() error

type SessionUpdateAgentMessageChunk

type SessionUpdateAgentMessageChunk struct {
	// The _meta property is reserved by ACP to allow clients and agents to attach additional
	// metadata to their interactions. Implementations MUST NOT make assumptions about values at
	// these keys.
	//
	// See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v1/draft/extensibility)
	Meta map[string]any `json:"_meta,omitempty"`
	// A single item of content
	Content ContentBlock `json:"content"`
	// A unique identifier for the message this chunk belongs to.
	//
	// All chunks belonging to the same message share the same 'messageId'.
	// A change in 'messageId' indicates a new message has started.
	MessageId     *MessageId `json:"messageId,omitzero"`
	SessionUpdate string     `json:"sessionUpdate"`
}

A chunk of the agent's response being streamed.

type SessionUpdateAgentThoughtChunk

type SessionUpdateAgentThoughtChunk struct {
	// The _meta property is reserved by ACP to allow clients and agents to attach additional
	// metadata to their interactions. Implementations MUST NOT make assumptions about values at
	// these keys.
	//
	// See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v1/draft/extensibility)
	Meta map[string]any `json:"_meta,omitempty"`
	// A single item of content
	Content ContentBlock `json:"content"`
	// A unique identifier for the message this chunk belongs to.
	//
	// All chunks belonging to the same message share the same 'messageId'.
	// A change in 'messageId' indicates a new message has started.
	MessageId     *MessageId `json:"messageId,omitzero"`
	SessionUpdate string     `json:"sessionUpdate"`
}

A chunk of the agent's internal reasoning being streamed.

type SessionUpdateCompactionSummaryChunk

type SessionUpdateCompactionSummaryChunk struct {
	// Metadata scoped to this chunk. Omission and 'null' both mean absent.
	Meta map[string]any `json:"_meta,omitempty"`
	// ID of the compaction whose summary receives this content.
	CompactionId CompactionId `json:"compactionId"`
	// One content block to append.
	Content       ContentBlock `json:"content"`
	SessionUpdate string       `json:"sessionUpdate"`
}

A content block appended to a context compaction's retained summary.

Agents MUST only send this update when the Client advertised the 'session.compaction' Client capability.

type SessionUpdateNotice

type SessionUpdateNotice struct {
	// Metadata scoped to this notice.
	//
	// Omitted and 'null' are equivalent and mean no metadata was supplied.
	Meta map[string]any `json:"_meta,omitempty"`
	// Optional plain-text detail or guidance.
	//
	// Omitted and 'null' are equivalent and mean no description was supplied.
	Description   *string `json:"description,omitzero"`
	SessionUpdate string  `json:"sessionUpdate"`
	// Presentation severity hint.
	Severity NoticeSeverity `json:"severity"`
	// Required non-empty plain-text title that can stand alone.
	Title string `json:"title"`
}

Information for the user that is not part of session history.

Agents MUST only send this update when the Client advertised the 'session.notices' Client capability.

type SessionUpdatePlan

type SessionUpdatePlan struct {
	// The _meta property is reserved by ACP to allow clients and agents to attach additional
	// metadata to their interactions. Implementations MUST NOT make assumptions about values at
	// these keys.
	//
	// See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v1/draft/extensibility)
	Meta map[string]any `json:"_meta,omitempty"`
	// The list of tasks to be accomplished.
	//
	// When updating a plan, the agent must send a complete list of all entries
	// with their current status. The client replaces the entire plan with each update.
	Entries       []PlanEntry `json:"entries"`
	SessionUpdate string      `json:"sessionUpdate"`
}

The agent's execution plan for complex tasks. See protocol docs: [Agent Plan](https://agentclientprotocol.com/protocol/v1/draft/agent-plan)

type SessionUpdatePlanRemoved

type SessionUpdatePlanRemoved struct {
	// The _meta property is reserved by ACP to allow clients and agents to attach additional
	// metadata to their interactions. Implementations MUST NOT make assumptions about values at
	// these keys.
	//
	// See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v1/draft/extensibility)
	Meta map[string]any `json:"_meta,omitempty"`
	// The plan ID to remove.
	PlanId        PlanId `json:"planId"`
	SessionUpdate string `json:"sessionUpdate"`
}

**UNSTABLE**

This capability is not part of the spec yet, and may be removed or changed at any point.

Removal notice for a plan identified by ID.

type SessionUpdateSessionMessage

type SessionUpdateSessionMessage struct {
	// Omitted leaves metadata unchanged. 'null' removes it.
	//
	// Implementations MUST NOT make assumptions about values in '_meta'.
	Meta map[string]any `json:"_meta,omitempty"`
	// Omitted leaves content unchanged. 'null' or '[]' clears it.
	// A non-empty array replaces all content.
	Content []ContentBlock `json:"content,omitempty"`
	// Identifier of this message within the enclosing session's transcript.
	MessageId MessageId `json:"messageId"`
	// On an outgoing view, the 'messageId' of the same message's incoming view in the
	// recipient's transcript.
	//
	// Omitted leaves the stored value unchanged. 'null' clears it. A value replaces it. It can arrive
	// after the message starts streaming.
	RecipientMessageId *MessageId `json:"recipientMessageId,omitzero"`
	// The receiving session.
	//
	// Omitted leaves the stored value unchanged. 'null' clears it. A value replaces it.
	RecipientSessionId *SessionId `json:"recipientSessionId,omitzero"`
	// On an incoming view, the 'messageId' of the same message's outgoing view in the
	// sender's transcript.
	//
	// Omitted leaves the stored value unchanged. 'null' clears it. A value replaces it. It can arrive
	// after the message starts streaming.
	SenderMessageId *MessageId `json:"senderMessageId,omitzero"`
	// The sending session.
	//
	// Omitted leaves the stored value unchanged. 'null' clears it. A value replaces it.
	SenderSessionId *SessionId `json:"senderSessionId,omitzero"`
	SessionUpdate   string     `json:"sessionUpdate"`
}

**UNSTABLE**

This capability is not part of the spec yet, and may be removed or changed at any point.

A message upsert observed in this session's transcript, sent to or received from another session.

type SessionUpdateSessionMessageChunk

type SessionUpdateSessionMessageChunk struct {
	// Optional and nullable chunk-scoped metadata. Omitted or 'null' means none.
	//
	// Implementations MUST NOT make assumptions about values in '_meta'.
	Meta map[string]any `json:"_meta,omitempty"`
	// A single content block appended to the message.
	Content ContentBlock `json:"content"`
	// Identifier of this message within the enclosing session's transcript.
	MessageId     MessageId `json:"messageId"`
	SessionUpdate string    `json:"sessionUpdate"`
}

**UNSTABLE**

This capability is not part of the spec yet, and may be removed or changed at any point.

One content block appended to a sent or received session message.

type SessionUpdateToolCall

type SessionUpdateToolCall struct {
	// The _meta property is reserved by ACP to allow clients and agents to attach additional
	// metadata to their interactions. Implementations MUST NOT make assumptions about values at
	// these keys.
	//
	// See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v1/draft/extensibility)
	Meta map[string]any `json:"_meta,omitempty"`
	// Content produced by the tool call.
	Content []ToolCallContent `json:"content,omitempty"`
	// The category of tool being invoked.
	// Helps clients choose appropriate icons and UI treatment.
	Kind ToolKind `json:"kind,omitzero"`
	// File locations affected by this tool call.
	// Enables "follow-along" features in clients.
	Locations []ToolCallLocation `json:"locations,omitempty"`
	// Programmatic name of the tool being invoked.
	//
	// This field is optional. Omitting it or sending 'null' both mean that no
	// tool name is available.
	Name *string `json:"name,omitzero"`
	// Raw input parameters sent to the tool.
	RawInput any `json:"rawInput,omitzero"`
	// Raw output returned by the tool.
	RawOutput     any    `json:"rawOutput,omitzero"`
	SessionUpdate string `json:"sessionUpdate"`
	// Current execution status of the tool call.
	Status ToolCallStatus `json:"status,omitzero"`
	// Human-readable title describing what the tool is doing.
	Title string `json:"title"`
	// Unique identifier for this tool call within the session.
	ToolCallId ToolCallId `json:"toolCallId"`
}

Notification that a new tool call has been initiated.

type SessionUpdateUserMessageChunk

type SessionUpdateUserMessageChunk struct {
	// The _meta property is reserved by ACP to allow clients and agents to attach additional
	// metadata to their interactions. Implementations MUST NOT make assumptions about values at
	// these keys.
	//
	// See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v1/draft/extensibility)
	Meta map[string]any `json:"_meta,omitempty"`
	// A single item of content
	Content ContentBlock `json:"content"`
	// A unique identifier for the message this chunk belongs to.
	//
	// All chunks belonging to the same message share the same 'messageId'.
	// A change in 'messageId' indicates a new message has started.
	MessageId     *MessageId `json:"messageId,omitzero"`
	SessionUpdate string     `json:"sessionUpdate"`
}

Different types of updates that can be sent during session processing.

These updates provide real-time feedback about the agent's progress.

See protocol docs: [Agent Reports Output](https://agentclientprotocol.com/protocol/v1/draft/prompt-turn#3-agent-reports-output) A chunk of the user's message being streamed.

type SessionUsageUpdate

type SessionUsageUpdate struct {
	// The _meta property is reserved by ACP to allow clients and agents to attach additional
	// metadata to their interactions. Implementations MUST NOT make assumptions about values at
	// these keys.
	//
	// See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v1/draft/extensibility)
	Meta map[string]any `json:"_meta,omitempty"`
	// Cumulative session cost (optional).
	Cost          *Cost  `json:"cost,omitzero"`
	SessionUpdate string `json:"sessionUpdate"`
	// Total context window size in tokens.
	Size int `json:"size"`
	// Tokens currently in context.
	Used int `json:"used"`
}

Context window and cost update for the session.

type SetSessionConfigOptionBoolean

type SetSessionConfigOptionBoolean struct {
	// The _meta property is reserved by ACP to allow clients and agents to attach additional
	// metadata to their interactions. Implementations MUST NOT make assumptions about values at
	// these keys.
	//
	// See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v1/draft/extensibility)
	Meta map[string]any `json:"_meta,omitempty"`
	// The ID of the configuration option to set.
	ConfigId SessionConfigId `json:"configId"`
	// The ID of the session to set the configuration option for.
	SessionId SessionId `json:"sessionId"`
	Type      string    `json:"type"`
	// The boolean value.
	Value bool `json:"value"`
}

Request parameters for setting a session configuration option. A boolean value ('type: "boolean"').

type SetSessionConfigOptionRequest

type SetSessionConfigOptionRequest struct {
	// A boolean value ('type: "boolean"').
	Boolean *SetSessionConfigOptionBoolean `json:"-"`
	// A 'SessionConfigValueId' string value.
	//
	// This is the default when 'type' is absent on the wire. Unknown 'type'
	// values with string payloads also gracefully deserialize into this
	// variant.
	ValueId *SetSessionConfigOptionValueId `json:"-"`
}

func (SetSessionConfigOptionRequest) MarshalJSONTo

func (u SetSessionConfigOptionRequest) MarshalJSONTo(enc *jsontext.Encoder) error

func (*SetSessionConfigOptionRequest) UnmarshalJSONFrom

func (u *SetSessionConfigOptionRequest) UnmarshalJSONFrom(dec *jsontext.Decoder) error

func (*SetSessionConfigOptionRequest) Validate

func (v *SetSessionConfigOptionRequest) Validate() error

type SetSessionConfigOptionResponse

type SetSessionConfigOptionResponse struct {
	// The _meta property is reserved by ACP to allow clients and agents to attach additional
	// metadata to their interactions. Implementations MUST NOT make assumptions about values at
	// these keys.
	//
	// See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v1/draft/extensibility)
	Meta map[string]any `json:"_meta,omitempty"`
	// The full set of configuration options and their current values.
	ConfigOptions []SessionConfigOption `json:"configOptions"`
}

Response to 'session/set_config_option' method.

func (*SetSessionConfigOptionResponse) Validate

func (v *SetSessionConfigOptionResponse) Validate() error

type SetSessionConfigOptionValueId

type SetSessionConfigOptionValueId struct {
	// The _meta property is reserved by ACP to allow clients and agents to attach additional
	// metadata to their interactions. Implementations MUST NOT make assumptions about values at
	// these keys.
	//
	// See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v1/draft/extensibility)
	Meta map[string]any `json:"_meta,omitempty"`
	// The ID of the configuration option to set.
	ConfigId SessionConfigId `json:"configId"`
	// The ID of the session to set the configuration option for.
	SessionId SessionId `json:"sessionId"`
	// The value ID.
	Value SessionConfigValueId `json:"value"`
}

A 'SessionConfigValueId' string value.

This is the default when 'type' is absent on the wire. Unknown 'type' values with string payloads also gracefully deserialize into this variant.

type SetSessionModeRequest

type SetSessionModeRequest struct {
	// The _meta property is reserved by ACP to allow clients and agents to attach additional
	// metadata to their interactions. Implementations MUST NOT make assumptions about values at
	// these keys.
	//
	// See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v1/draft/extensibility)
	Meta map[string]any `json:"_meta,omitempty"`
	// The ID of the mode to set.
	ModeId SessionModeId `json:"modeId"`
	// The ID of the session to set the mode for.
	SessionId SessionId `json:"sessionId"`
}

Request parameters for setting a session mode.

func (*SetSessionModeRequest) Validate

func (v *SetSessionModeRequest) Validate() error

type SetSessionModeResponse

type SetSessionModeResponse struct {
	// The _meta property is reserved by ACP to allow clients and agents to attach additional
	// metadata to their interactions. Implementations MUST NOT make assumptions about values at
	// these keys.
	//
	// See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v1/draft/extensibility)
	Meta map[string]any `json:"_meta,omitempty"`
}

Response to 'session/set_mode' method.

func (*SetSessionModeResponse) Validate

func (v *SetSessionModeResponse) Validate() error

type StateUpdate

type StateUpdate struct {
	// Foreground work is in progress.
	Running *StateUpdateRunning `json:"-"`
	// The child is ready to process another prompt.
	Idle *StateUpdateIdle `json:"-"`
	// Foreground work is blocked on user action.
	RequiresAction *StateUpdateRequiresAction `json:"-"`
	// The Agent cannot currently determine foreground activity.
	//
	// This replaces previously confirmed activity without ending the work or session.
	Unknown *StateUpdateUnknown `json:"-"`
	// Custom or future state.
	//
	// Values beginning with '_' are reserved for implementation-specific
	// extensions. Other unknown values are reserved for future ACP variants.
	Other *StateUpdateOther `json:"-"`
}

func (StateUpdate) MarshalJSONTo

func (u StateUpdate) MarshalJSONTo(enc *jsontext.Encoder) error

func (*StateUpdate) UnmarshalJSONFrom

func (u *StateUpdate) UnmarshalJSONFrom(dec *jsontext.Decoder) error

type StateUpdateIdle

type StateUpdateIdle struct {
	// The _meta property is reserved by ACP for additional metadata.
	// Implementations MUST NOT make assumptions about values at these keys.
	// Optional. Omitted and 'null' mean no metadata for this state snapshot.
	Meta map[string]any `json:"_meta,omitempty"`
	// The failure, as a JSON-RPC error object.
	//
	// Optional. Omitted or 'null' both mean the agent is not reporting failure details.
	// Agents SHOULD include it.
	Error *Error `json:"error,omitzero"`
	State string `json:"state"`
	// Why foreground work stopped. The value selects one of this type's variants, which may add fields of their own.
	//
	// Optional. Omitted or 'null' both mean the agent is not reporting a stop reason; a malformed value is treated the same way.
	//
	// See protocol docs: [Current work state](https://agentclientprotocol.com/rfds/subagents#current-work-state)
	StopReason *string `json:"stopReason,omitzero"`
	// **UNSTABLE** Token usage for completed foreground work.
	//
	// Optional. Omitted or 'null' means not reported.
	Usage *Usage `json:"usage,omitzero"`
}

The child is ready to process another prompt.

type StateUpdateOther

type StateUpdateOther struct {
	// Unrecognized state discriminator.
	State string `json:"state"`
}

Custom or future state.

Values beginning with '_' are reserved for implementation-specific extensions. Other unknown values are reserved for future ACP variants.

type StateUpdateRequiresAction

type StateUpdateRequiresAction struct {
	// The _meta property is reserved by ACP for additional metadata.
	// Implementations MUST NOT make assumptions about values at these keys.
	// Optional. Omitted and 'null' mean no metadata for this state snapshot.
	Meta  map[string]any `json:"_meta,omitempty"`
	State string         `json:"state"`
}

Foreground work is blocked on user action.

type StateUpdateRunning

type StateUpdateRunning struct {
	// The _meta property is reserved by ACP for additional metadata.
	// Implementations MUST NOT make assumptions about values at these keys.
	// Optional. Omitted and 'null' mean no metadata for this state snapshot.
	Meta  map[string]any `json:"_meta,omitempty"`
	State string         `json:"state"`
}

**UNSTABLE**

This capability is not part of the spec yet, and may be removed or changed at any point.

Current foreground-work state of a reusable child session.

Each update is a whole-object snapshot. Idle does not terminate the child. The parent can message it again, transitioning it back to running. Background activity may still emit other session updates while idle. Foreground work is in progress.

type StateUpdateUnknown

type StateUpdateUnknown struct {
	// The _meta property is reserved by ACP for additional metadata.
	// Implementations MUST NOT make assumptions about values at these keys.
	// Optional. Omitted and 'null' mean no metadata for this state snapshot.
	Meta  map[string]any `json:"_meta,omitempty"`
	State string         `json:"state"`
}

The Agent cannot currently determine foreground activity.

This replaces previously confirmed activity without ending the work or session.

type StopReason

type StopReason string

Reasons why an agent stops processing a prompt turn.

See protocol docs: [Stop Reasons](https://agentclientprotocol.com/protocol/v1/draft/prompt-turn#stop-reasons)

const (
	StopReasonEndTurn         StopReason = "end_turn"
	StopReasonMaxTokens       StopReason = "max_tokens"
	StopReasonMaxTurnRequests StopReason = "max_turn_requests"
	StopReasonRefusal         StopReason = "refusal"
	StopReasonCancelled       StopReason = "cancelled"
)

type StringFormat

type StringFormat string

String format types for string properties in elicitation schemas.

const (
	StringFormatEmail    StringFormat = "email"
	StringFormatUri      StringFormat = "uri"
	StringFormatDate     StringFormat = "date"
	StringFormatDateTime StringFormat = "date-time"
)

type StringMultiSelectItems

type StringMultiSelectItems struct {
	// The _meta property is reserved by ACP to allow clients and agents to attach additional
	// metadata to their interactions. Implementations MUST NOT make assumptions about values at
	// these keys.
	//
	// Optional. Omitted and 'null' are equivalent and mean no metadata.
	//
	// See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v1/extensibility)
	Meta map[string]any `json:"_meta,omitempty"`
	// Allowed enum values.
	Enum []string `json:"enum"`
}

String item schema for multi-select enum properties.

type StringPropertySchema

type StringPropertySchema struct {
	// The _meta property is reserved by ACP to allow clients and agents to attach additional
	// metadata to their interactions. Implementations MUST NOT make assumptions about values at
	// these keys.
	//
	// Optional. Omitted and 'null' are equivalent and mean no metadata.
	//
	// See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v1/extensibility)
	Meta map[string]any `json:"_meta,omitempty"`
	// Default value.
	//
	// Optional. Omitted and 'null' are equivalent and mean no default value is provided.
	Default *string `json:"default,omitzero"`
	// Human-readable description.
	//
	// Optional. Omitted and 'null' are equivalent and mean no description is provided.
	Description *string `json:"description,omitzero"`
	// Enum values for untitled single-select enums.
	// Optional. Omitted and 'null' are equivalent and mean no untitled single-select choices are
	// declared by 'enum'.
	Enum []string `json:"enum,omitempty"`
	// String format.
	//
	// Optional. Omitted and 'null' are equivalent and mean there is no format constraint.
	Format *StringFormat `json:"format,omitzero"`
	// Maximum string length.
	//
	// Optional. Omitted and 'null' are equivalent and mean there is no maximum length constraint.
	MaxLength *int `json:"maxLength,omitzero"`
	// Minimum string length.
	//
	// Optional. Omitted and 'null' are equivalent and mean there is no minimum length constraint.
	MinLength *int `json:"minLength,omitzero"`
	// Titled enum options for titled single-select enums.
	// Optional. Omitted and 'null' are equivalent and mean no titled single-select choices are
	// declared by 'oneOf'.
	OneOf []EnumOption `json:"oneOf,omitempty"`
	// Pattern the string must match.
	//
	// Optional. Omitted and 'null' are equivalent and mean there is no pattern constraint.
	Pattern *string `json:"pattern,omitzero"`
	// Optional title for the property.
	//
	// Optional. Omitted and 'null' are equivalent and mean no title is provided.
	Title *string `json:"title,omitzero"`
}

Schema for string properties in an elicitation form.

When 'enum' or 'oneOf' is set, this represents a single-select enum with '"type": "string"'.

type SubagentCapabilities

type SubagentCapabilities struct {
	// The _meta property is reserved by ACP to allow clients and agents to attach additional
	// metadata to their interactions. Implementations MUST NOT make assumptions about values at
	// these keys.
	Meta map[string]any `json:"_meta,omitempty"`
}

**UNSTABLE**

This capability is not part of the spec yet, and may be removed or changed at any point.

Capability marker for exposing reusable child sessions as restricted ACP sessions.

Supplying '{}' advertises support for child association and state updates, session-directed messages, and restricted-session semantics. The client must advertise this capability before the agent sends subagent updates or session-directed messages.

type SubagentSessionCapabilities

type SubagentSessionCapabilities struct {
	// The _meta property is reserved by ACP to allow clients and agents to attach additional
	// metadata to their interactions. Implementations MUST NOT make assumptions about values at
	// these keys.
	Meta map[string]any `json:"_meta,omitempty"`
	// Permits the client to cancel this child's current work without ending
	// the session. Omitted or 'null' means unsupported. An object (including
	// '{}') means supported.
	Cancel *SessionCancelCapabilities `json:"cancel,omitzero"`
}

**UNSTABLE**

This capability is not part of the spec yet, and may be removed or changed at any point.

Client-initiated session mutations permitted for a specific subagent session.

A mutation requires an explicit per-child capability. Support for the method on ordinary sessions does not grant support on a child.

type SubagentUpdate

type SubagentUpdate struct {
	// The _meta property is reserved by ACP to allow clients and agents to attach additional
	// metadata to their interactions. Implementations MUST NOT make assumptions about values at
	// these keys.
	//
	// See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v1/draft/extensibility)
	// Omitted means unchanged. 'null' removes the metadata.
	Meta map[string]any `json:"_meta,omitempty"`
	// Additional workspace roots for the child. Each path must be absolute.
	//
	// Optional and nullable. Omitted means unchanged. 'null' clears the
	// reported value. While unset, the child inherits its immediate parent's
	// effective additional directories, independently of 'cwd'. A concrete
	// array replaces the whole list. '[]' reports no additional directories.
	// Clients use these values for the child's root set.
	AdditionalDirectories []string `json:"additionalDirectories,omitempty"`
	// Client-initiated session mutations permitted for this subagent session.
	//
	// Omitted means unchanged. 'null' clears the capability set and disables
	// child mutations. If never supplied, no session mutations are permitted.
	// Read-only operations retain their normal protocol semantics and capability
	// requirements. A concrete object replaces the whole capability set.
	Capabilities *SubagentSessionCapabilities `json:"capabilities,omitzero"`
	// The child's working directory. Must be an absolute path.
	//
	// Optional and nullable. Omitted means unchanged. 'null' clears the
	// reported value. While unset, the child inherits its immediate parent's
	// effective working directory. Clients use this value for the child's
	// root set and as the default terminal working directory.
	Cwd *string `json:"cwd,omitzero"`
	// The parent's human-readable description of the child's role or purpose.
	//
	// Omitted means unchanged. 'null' clears it. If unset, the Client chooses
	// a fallback presentation. This is current display metadata, not the
	// history of instructions sent to the child.
	Description *string `json:"description,omitzero"`
	// The opaque session ID identifying the child in all ACP messages.
	SessionId SessionId `json:"sessionId"`
	// Current state snapshot for the child session.
	//
	// Omitted means unchanged. 'null' clears the current activity without
	// asserting idle or sending an 'unknown' snapshot. A concrete state
	// replaces the previous state object wholesale. If never supplied, the
	// current activity is unset/unconfirmed.
	State *StateUpdate `json:"state,omitzero"`
	// The parent's human-readable display title for this child. It need not be unique.
	//
	// Omitted means unchanged. 'null' clears it. If unset, the Client chooses
	// a fallback presentation.
	Title *string `json:"title,omitzero"`
}

**UNSTABLE**

This capability is not part of the spec yet, and may be removed or changed at any point.

Notification that the enclosing parent session created and owns a child session.

Later updates modify the existing association's metadata, not its ownership.

Sent on the immediate parent session. The first update for an unknown 'sessionId' announces the child and MUST be sent before any live child traffic or live message naming the child as sender or recipient. Parents may message and reuse an announced child across multiple operations. Child events are delivered automatically on the same connection. No child load, resume, or subscription is needed.

Only the subagent session ID is required. Omitted patch fields keep their previous values. 'null' clears them. Clearing capabilities disables child mutations. Clearing state leaves current activity unset/unconfirmed: it does not imply idle, stop work, or create an 'unknown' state snapshot. A concrete state replaces the entire previous state object, not the session. The title and description provide the parent's display metadata for the child. They do not replace the content of individual messages or operations. 'cwd' and 'additionalDirectories' report where the Agent placed the child. While unset, each inherits the immediate parent's effective value.

type SystemPrompt

type SystemPrompt struct {
	// The _meta property is reserved by ACP to allow clients and agents to attach additional
	// metadata to their interactions. Implementations MUST NOT make assumptions about values at
	// these keys.
	//
	// See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v1/draft/extensibility)
	Meta map[string]any `json:"_meta,omitempty"`
	// The system prompt content.
	//
	// Agents advertising the capability MUST accept 'text' content blocks.
	// Clients MUST NOT send other content block types until a future
	// capability allows them, and Agents MUST return an error for content
	// blocks they do not support.
	//
	// Clients MUST NOT send an empty array. Agents MAY reject one with
	// '-32602' without creating, loading, or resuming the session.
	Content []ContentBlock `json:"content"`
	// How the Agent combines 'content' with its own instructions.
	//
	// Required. Agents MUST return an error for a mode they do not support rather than
	// treating it as 'append' or 'override'.
	Mode SystemPromptMode `json:"mode"`
}

Client-provided system-level instructions for a session.

Clients MUST only send this when the Agent advertises 'sessionCapabilities.systemPrompt'. Agents that cannot apply it, for example because of an unadvertised mode or an unsupported content block type, MUST return an error instead of creating, loading, or resuming the session.

type SystemPromptMode

type SystemPromptMode string

How the Agent combines a client-provided system prompt with its own instructions.

Unknown modes are preserved so they can be stored, proxied, or forwarded. An Agent MUST return an error for a mode it does not support rather than treating it as 'append' or 'override'.

const (
	SystemPromptModeAppend   SystemPromptMode = "append"
	SystemPromptModeOverride SystemPromptMode = "override"
)

type Terminal

type Terminal struct {
	// The _meta property is reserved by ACP to allow clients and agents to attach additional
	// metadata to their interactions. Implementations MUST NOT make assumptions about values at
	// these keys.
	//
	// See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v1/draft/extensibility)
	Meta map[string]any `json:"_meta,omitempty"`
	// Identifier of the terminal instance to embed in the content stream.
	TerminalId TerminalId `json:"terminalId"`
}

Embed a terminal created with 'terminal/create' by its id.

The terminal must be added before calling 'terminal/release'.

See protocol docs: Terminal(https://agentclientprotocol.com/protocol/v1/draft/terminals)

type TerminalExitStatus

type TerminalExitStatus struct {
	// The _meta property is reserved by ACP to allow clients and agents to attach additional
	// metadata to their interactions. Implementations MUST NOT make assumptions about values at
	// these keys.
	//
	// See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v1/draft/extensibility)
	Meta map[string]any `json:"_meta,omitempty"`
	// The process exit code (may be null if terminated by signal).
	ExitCode *int `json:"exitCode,omitzero"`
	// The signal that terminated the process (may be null if exited normally).
	Signal *string `json:"signal,omitzero"`
}

Exit status of a terminal command.

type TerminalId

type TerminalId string

Typed identifier used for terminal values on the wire.

type TerminalOutputRequest

type TerminalOutputRequest struct {
	// The _meta property is reserved by ACP to allow clients and agents to attach additional
	// metadata to their interactions. Implementations MUST NOT make assumptions about values at
	// these keys.
	//
	// See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v1/draft/extensibility)
	Meta map[string]any `json:"_meta,omitempty"`
	// The session ID for this request.
	SessionId SessionId `json:"sessionId"`
	// The ID of the terminal to get output from.
	TerminalId TerminalId `json:"terminalId"`
}

Request to get the current output and status of a terminal.

func (*TerminalOutputRequest) Validate

func (v *TerminalOutputRequest) Validate() error

type TerminalOutputResponse

type TerminalOutputResponse struct {
	// The _meta property is reserved by ACP to allow clients and agents to attach additional
	// metadata to their interactions. Implementations MUST NOT make assumptions about values at
	// these keys.
	//
	// See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v1/draft/extensibility)
	Meta map[string]any `json:"_meta,omitempty"`
	// Exit status if the command has completed.
	ExitStatus *TerminalExitStatus `json:"exitStatus,omitzero"`
	// The terminal output captured so far.
	Output string `json:"output"`
	// Whether the output was truncated due to byte limits.
	Truncated bool `json:"truncated"`
}

Response containing the terminal output and exit status.

func (*TerminalOutputResponse) Validate

func (v *TerminalOutputResponse) Validate() error

type TextContent

type TextContent struct {
	// The _meta property is reserved by ACP to allow clients and agents to attach additional
	// metadata to their interactions. Implementations MUST NOT make assumptions about values at
	// these keys.
	//
	// See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v1/draft/extensibility)
	Meta map[string]any `json:"_meta,omitempty"`
	// Optional annotations that help clients decide how to display or route this content.
	Annotations *Annotations `json:"annotations,omitzero"`
	// Text payload carried by this content block.
	Text string `json:"text"`
}

Text provided to or from an LLM.

type TextResourceContents

type TextResourceContents struct {
	// The _meta property is reserved by ACP to allow clients and agents to attach additional
	// metadata to their interactions. Implementations MUST NOT make assumptions about values at
	// these keys.
	//
	// See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v1/draft/extensibility)
	Meta map[string]any `json:"_meta,omitempty"`
	// MIME type describing the encoded media payload.
	MimeType *string `json:"mimeType,omitzero"`
	// Text payload carried by this content block.
	Text string `json:"text"`
	// URI associated with this resource or media payload.
	Uri string `json:"uri"`
}

Text-based resource contents.

type TitledMultiSelectItems

type TitledMultiSelectItems struct {
	// The _meta property is reserved by ACP to allow clients and agents to attach additional
	// metadata to their interactions. Implementations MUST NOT make assumptions about values at
	// these keys.
	//
	// Optional. Omitted and 'null' are equivalent and mean no metadata.
	//
	// See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v1/extensibility)
	Meta map[string]any `json:"_meta,omitempty"`
	// Titled enum options.
	AnyOf []EnumOption `json:"anyOf"`
}

Items definition for titled multi-select enum properties.

type ToolCall

type ToolCall struct {
	// The _meta property is reserved by ACP to allow clients and agents to attach additional
	// metadata to their interactions. Implementations MUST NOT make assumptions about values at
	// these keys.
	//
	// See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v1/draft/extensibility)
	Meta map[string]any `json:"_meta,omitempty"`
	// Content produced by the tool call.
	Content []ToolCallContent `json:"content,omitempty"`
	// The category of tool being invoked.
	// Helps clients choose appropriate icons and UI treatment.
	Kind ToolKind `json:"kind,omitzero"`
	// File locations affected by this tool call.
	// Enables "follow-along" features in clients.
	Locations []ToolCallLocation `json:"locations,omitempty"`
	// Programmatic name of the tool being invoked.
	//
	// This field is optional. Omitting it or sending 'null' both mean that no
	// tool name is available.
	Name *string `json:"name,omitzero"`
	// Raw input parameters sent to the tool.
	RawInput any `json:"rawInput,omitzero"`
	// Raw output returned by the tool.
	RawOutput any `json:"rawOutput,omitzero"`
	// Current execution status of the tool call.
	Status ToolCallStatus `json:"status,omitzero"`
	// Human-readable title describing what the tool is doing.
	Title string `json:"title"`
	// Unique identifier for this tool call within the session.
	ToolCallId ToolCallId `json:"toolCallId"`
}

Represents a tool call that the language model has requested.

Tool calls are actions that the agent executes on behalf of the language model, such as reading files, executing code, or fetching data from external sources.

See protocol docs: [Tool Calls](https://agentclientprotocol.com/protocol/v1/draft/tool-calls)

type ToolCallContent

type ToolCallContent struct {
	// Standard content block (text, images, resources).
	Content *ToolCallContentContent `json:"-"`
	// File modification shown as a diff.
	Diff *ToolCallContentDiff `json:"-"`
	// Embed a terminal created with 'terminal/create' by its id.
	//
	// The terminal must be added before calling 'terminal/release'.
	//
	// See protocol docs: [Terminal](https://agentclientprotocol.com/protocol/v1/draft/terminals)
	Terminal *ToolCallContentTerminal `json:"-"`
	// **UNSTABLE**
	//
	// This capability is not part of the spec yet, and may be removed or changed at any point.
	//
	// A display-only reference to another session, such as a subagent.
	Session *ToolCallContentSession `json:"-"`
}

func (ToolCallContent) MarshalJSONTo

func (u ToolCallContent) MarshalJSONTo(enc *jsontext.Encoder) error

func (*ToolCallContent) UnmarshalJSONFrom

func (u *ToolCallContent) UnmarshalJSONFrom(dec *jsontext.Decoder) error

func (*ToolCallContent) Validate

func (u *ToolCallContent) Validate() error

type ToolCallContentContent

type ToolCallContentContent struct {
	// The _meta property is reserved by ACP to allow clients and agents to attach additional
	// metadata to their interactions. Implementations MUST NOT make assumptions about values at
	// these keys.
	//
	// See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v1/draft/extensibility)
	Meta map[string]any `json:"_meta,omitempty"`
	// The actual content block.
	Content ContentBlock `json:"content"`
	Type    string       `json:"type"`
}

Content produced by a tool call.

Tool calls can produce different types of content including standard content blocks (text, images) or file diffs.

See protocol docs: Content(https://agentclientprotocol.com/protocol/v1/draft/tool-calls#content) Standard content block (text, images, resources).

type ToolCallContentDiff

type ToolCallContentDiff struct {
	// The _meta property is reserved by ACP to allow clients and agents to attach additional
	// metadata to their interactions. Implementations MUST NOT make assumptions about values at
	// these keys.
	//
	// See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v1/draft/extensibility)
	Meta map[string]any `json:"_meta,omitempty"`
	// The new content after modification.
	NewText string `json:"newText"`
	// The original content (omitted or 'null' for new files).
	OldText *string `json:"oldText,omitzero"`
	// The absolute file path being modified.
	Path string `json:"path"`
	Type string `json:"type"`
}

File modification shown as a diff.

type ToolCallContentSession

type ToolCallContentSession struct {
	// The _meta property is reserved by ACP to allow clients and agents to attach additional
	// metadata to their interactions. Implementations MUST NOT make assumptions about values at
	// these keys.
	//
	// See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v1/draft/extensibility)
	Meta map[string]any `json:"_meta,omitempty"`
	// The referenced session.
	SessionId SessionId `json:"sessionId"`
	Type      string    `json:"type"`
}

**UNSTABLE**

This capability is not part of the spec yet, and may be removed or changed at any point.

A display-only reference to another session, such as a subagent.

type ToolCallContentTerminal

type ToolCallContentTerminal struct {
	// The _meta property is reserved by ACP to allow clients and agents to attach additional
	// metadata to their interactions. Implementations MUST NOT make assumptions about values at
	// these keys.
	//
	// See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v1/draft/extensibility)
	Meta map[string]any `json:"_meta,omitempty"`
	// Identifier of the terminal instance to embed in the content stream.
	TerminalId TerminalId `json:"terminalId"`
	Type       string     `json:"type"`
}

Embed a terminal created with 'terminal/create' by its id.

The terminal must be added before calling 'terminal/release'.

See protocol docs: Terminal(https://agentclientprotocol.com/protocol/v1/draft/terminals)

type ToolCallId

type ToolCallId string

Unique identifier for a tool call within a session.

type ToolCallLocation

type ToolCallLocation struct {
	// The _meta property is reserved by ACP to allow clients and agents to attach additional
	// metadata to their interactions. Implementations MUST NOT make assumptions about values at
	// these keys.
	//
	// See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v1/draft/extensibility)
	Meta map[string]any `json:"_meta,omitempty"`
	// Optional 1-based line number within the file.
	Line *int `json:"line,omitzero"`
	// The absolute file path being accessed or modified.
	Path string `json:"path"`
}

A file location being accessed or modified by a tool.

Enables clients to implement "follow-along" features that track which files the agent is working with in real-time.

See protocol docs: [Following the Agent](https://agentclientprotocol.com/protocol/v1/draft/tool-calls#following-the-agent)

type ToolCallStatus

type ToolCallStatus string

Execution status of a tool call.

Tool calls progress through different statuses during their lifecycle.

See protocol docs: [Status](https://agentclientprotocol.com/protocol/v1/draft/tool-calls#status)

const (
	ToolCallStatusPending    ToolCallStatus = "pending"
	ToolCallStatusInProgress ToolCallStatus = "in_progress"
	ToolCallStatusCompleted  ToolCallStatus = "completed"
	ToolCallStatusFailed     ToolCallStatus = "failed"
)

type ToolCallUpdate

type ToolCallUpdate struct {
	// The _meta property is reserved by ACP to allow clients and agents to attach additional
	// metadata to their interactions. Implementations MUST NOT make assumptions about values at
	// these keys.
	//
	// See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v1/draft/extensibility)
	Meta map[string]any `json:"_meta,omitempty"`
	// Replace the content collection.
	Content []ToolCallContent `json:"content,omitempty"`
	// Update the tool kind.
	Kind *ToolKind `json:"kind,omitzero"`
	// Replace the locations collection.
	Locations []ToolCallLocation `json:"locations,omitempty"`
	// Update the programmatic name of the tool being invoked.
	//
	// This field is optional. Omitting it or sending 'null' both mean that
	// the existing name is left unchanged.
	Name *string `json:"name,omitzero"`
	// Update the raw input.
	RawInput any `json:"rawInput,omitzero"`
	// Update the raw output.
	RawOutput any `json:"rawOutput,omitzero"`
	// Update the execution status.
	Status *ToolCallStatus `json:"status,omitzero"`
	// Update the human-readable title.
	Title *string `json:"title,omitzero"`
	// The ID of the tool call being updated.
	ToolCallId ToolCallId `json:"toolCallId"`
}

An update to an existing tool call.

Used to report progress and results as tools execute. All fields except the tool call ID are optional - only changed fields need to be included.

See protocol docs: [Updating](https://agentclientprotocol.com/protocol/v1/draft/tool-calls#updating)

func (*ToolCallUpdate) Validate

func (t *ToolCallUpdate) Validate() error

type ToolKind

type ToolKind string

Categories of tools that can be invoked.

Tool kinds help clients choose appropriate icons and optimize how they display tool execution progress.

See protocol docs: [Creating](https://agentclientprotocol.com/protocol/v1/draft/tool-calls#creating)

const (
	ToolKindRead       ToolKind = "read"
	ToolKindEdit       ToolKind = "edit"
	ToolKindDelete     ToolKind = "delete"
	ToolKindMove       ToolKind = "move"
	ToolKindSearch     ToolKind = "search"
	ToolKindExecute    ToolKind = "execute"
	ToolKindThink      ToolKind = "think"
	ToolKindFetch      ToolKind = "fetch"
	ToolKindSwitchMode ToolKind = "switch_mode"
	ToolKindOther      ToolKind = "other"
)

type UnknownStateUpdate

type UnknownStateUpdate struct {
	// The _meta property is reserved by ACP for additional metadata.
	// Implementations MUST NOT make assumptions about values at these keys.
	// Optional. Omitted and 'null' mean no metadata for this state snapshot.
	Meta map[string]any `json:"_meta,omitempty"`
}

**UNSTABLE**

This capability is not part of the spec yet, and may be removed or changed at any point.

The Agent cannot currently determine foreground activity.

Report this when activity becomes unobservable, not merely because the child has been quiet. The Client MUST stop presenting the previous state as confirmed current activity, but may retain it as last known. A later state replaces this snapshot normally.

This is not a task outcome or session closure. It does not cancel work, resolve pending requests, or revoke capabilities. Capabilities are updated separately.

type UnstableAnnotations

type UnstableAnnotations struct {
	// The _meta property is reserved by ACP to allow clients and agents to attach additional
	// metadata to their interactions. Implementations MUST NOT make assumptions about values at
	// these keys.
	//
	// See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v1/draft/extensibility)
	Meta map[string]any `json:"_meta,omitempty"`
	// Intended recipients for this content, such as the user or assistant.
	Audience []Role `json:"audience,omitempty"`
	// Timestamp indicating when the underlying resource was last modified.
	LastModified *string `json:"lastModified,omitzero"`
	// Relative importance of this content when clients choose what to surface.
	Priority *float64 `json:"priority,omitzero"`
}

Optional annotations for the client. The client can use annotations to inform how objects are used or displayed

type UnstableArchiveSessionRequest

type UnstableArchiveSessionRequest struct {
	// The _meta property is reserved by ACP to allow clients and agents to attach additional
	// metadata to their interactions. Implementations MUST NOT make assumptions about values at
	// these keys.
	//
	// See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v1/draft/extensibility)
	Meta map[string]any `json:"_meta,omitempty"`
	// The ID of the session to archive.
	SessionId UnstableSessionId `json:"sessionId"`
}

**UNSTABLE**

This capability is not part of the spec yet, and may be removed or changed at any point.

Request parameters for archiving a session.

Only available if the Agent supports the 'sessionCapabilities.archive' capability.

Archiving hides the session from default 'session/list' results. It keeps the session ID and saved history. If the session is active, the Agent MUST cancel any ongoing work and free the session's resources as if 'session/close' had been called, then archive it. Archiving an archived session succeeds. A session that does not exist gets '-32002'.

func (*UnstableArchiveSessionRequest) Validate

func (v *UnstableArchiveSessionRequest) Validate() error

type UnstableArchiveSessionResponse

type UnstableArchiveSessionResponse struct {
	// The _meta property is reserved by ACP to allow clients and agents to attach additional
	// metadata to their interactions. Implementations MUST NOT make assumptions about values at
	// these keys.
	//
	// See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v1/draft/extensibility)
	Meta map[string]any `json:"_meta,omitempty"`
}

**UNSTABLE**

This capability is not part of the spec yet, and may be removed or changed at any point.

Response from archiving a session.

func (*UnstableArchiveSessionResponse) Validate

func (v *UnstableArchiveSessionResponse) Validate() error

type UnstableAudioContent

type UnstableAudioContent struct {
	// The _meta property is reserved by ACP to allow clients and agents to attach additional
	// metadata to their interactions. Implementations MUST NOT make assumptions about values at
	// these keys.
	//
	// See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v1/draft/extensibility)
	Meta map[string]any `json:"_meta,omitempty"`
	// Optional annotations that help clients decide how to display or route this content.
	Annotations *UnstableAnnotations `json:"annotations,omitzero"`
	// Base64-encoded media payload.
	Data string `json:"data"`
	// MIME type describing the encoded media payload.
	MimeType string `json:"mimeType"`
}

Audio provided to or from an LLM.

type UnstableAuthAccount

type UnstableAuthAccount struct {
	// The _meta property is reserved by ACP to allow clients and agents to attach additional
	// metadata to their interactions. Implementations MUST NOT make assumptions about values at
	// these keys.
	//
	// See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v1/draft/extensibility)
	Meta map[string]any `json:"_meta,omitempty"`
	// Whether the agent currently uses this account by default.
	//
	// Several accounts MAY be active, for example one per provider.
	//
	// Optional. Omitted and 'null' are equivalent and mean the agent does not indicate whether this account is in effect.
	Active *bool `json:"active,omitzero"`
	// Short text shown with the label, such as the credential source, for example
	// 'API key helper'. MUST NOT contain credentials.
	//
	// Optional. Omitted and 'null' are equivalent and mean no description is reported.
	Description *string `json:"description,omitzero"`
	// Email address of the user.
	//
	// Optional. Omitted and 'null' are equivalent and mean no email is reported.
	Email *string `json:"email,omitzero"`
	// Human-readable name for the account, suitable for display on its own,
	// for example 'Claude Max', 'OpenAI API key', or 'Vertex AI'.
	Label string `json:"label"`
	// Display name of the user, such as a username or full name.
	//
	// Optional. Omitted and 'null' are equivalent and mean no name is reported.
	Name *string `json:"name,omitzero"`
	// Display name of the organization, team, or workspace the account is using.
	//
	// Optional. Omitted and 'null' are equivalent and mean no organization is reported.
	Organization *string `json:"organization,omitzero"`
}

**UNSTABLE**

This capability is not part of the spec yet, and may be removed or changed at any point.

An account or credential the agent has configured, such as a signed-in user account or an API key.

All fields are display information only. Clients MUST NOT use them as stable account identifiers, and SHOULD NOT log them or send them elsewhere, such as to telemetry.

type UnstableAuthState

type UnstableAuthState string

**UNSTABLE**

This capability is not part of the spec yet, and may be removed or changed at any point.

The agent's overall authentication state.

const (
	UnstableAuthStateAuthenticated   UnstableAuthState = "authenticated"
	UnstableAuthStateUnauthenticated UnstableAuthState = "unauthenticated"
	UnstableAuthStateNotRequired     UnstableAuthState = "not_required"
	UnstableAuthStateUnknown         UnstableAuthState = "unknown"
)

type UnstableAuthStatusRequest

type UnstableAuthStatusRequest struct {
	// The _meta property is reserved by ACP to allow clients and agents to attach additional
	// metadata to their interactions. Implementations MUST NOT make assumptions about values at
	// these keys.
	//
	// See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v1/draft/extensibility)
	Meta map[string]any `json:"_meta,omitempty"`
}

**UNSTABLE**

This capability is not part of the spec yet, and may be removed or changed at any point.

Request parameters for the 'auth/status' method.

Queries the agent's current authentication state without changing it.

Agents MUST NOT reject it with 'auth_required' ('-32000'), since Clients call it to learn whether authentication is required.

func (*UnstableAuthStatusRequest) Validate

func (v *UnstableAuthStatusRequest) Validate() error

type UnstableAuthStatusResponse

type UnstableAuthStatusResponse struct {
	// The _meta property is reserved by ACP to allow clients and agents to attach additional
	// metadata to their interactions. Implementations MUST NOT make assumptions about values at
	// these keys.
	//
	// See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v1/draft/extensibility)
	Meta map[string]any `json:"_meta,omitempty"`
	// The accounts the agent has configured, for display.
	//
	// Optional. Omitted and empty are equivalent and mean no accounts are reported.
	// Agents that hold credentials for several providers or accounts SHOULD list each
	// of them and mark the ones in effect with 'active'.
	Accounts []UnstableAuthAccount `json:"accounts,omitempty"`
	// Whether the agent can start sessions without the user signing in first.
	//
	// Clients use this field to decide whether sign-in is needed. Clients MUST treat
	// values they do not recognize as 'unknown'.
	State UnstableAuthState `json:"state"`
}

**UNSTABLE**

This capability is not part of the spec yet, and may be removed or changed at any point.

Response to the 'auth/status' method.

func (*UnstableAuthStatusResponse) Validate

func (v *UnstableAuthStatusResponse) Validate() error

type UnstableAuthStatusUpdateNotification

type UnstableAuthStatusUpdateNotification struct {
	// The _meta property is reserved by ACP to allow clients and agents to attach additional
	// metadata to their interactions. Implementations MUST NOT make assumptions about values at
	// these keys.
	//
	// See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v1/draft/extensibility)
	Meta map[string]any `json:"_meta,omitempty"`
	// The accounts the agent has configured, for display.
	//
	// Optional. Omitted and empty are equivalent and mean no accounts are reported.
	// Agents that hold credentials for several providers or accounts SHOULD list each
	// of them and mark the ones in effect with 'active'.
	Accounts []UnstableAuthAccount `json:"accounts,omitempty"`
	// Whether the agent can start sessions without the user signing in first.
	//
	// Clients use this field to decide whether sign-in is needed. Clients MUST treat
	// values they do not recognize as 'unknown'.
	State UnstableAuthState `json:"state"`
}

**UNSTABLE**

This capability is not part of the spec yet, and may be removed or changed at any point.

Notification sent by the agent when its authentication status changes.

Carries the same fields as the 'auth/status' response. Agents that advertise the 'auth.status' capability MAY send it at any time after 'initialize', and SHOULD only send it when the reported status differs from the last one sent on the connection.

func (*UnstableAuthStatusUpdateNotification) Validate

type UnstableBlobResourceContents

type UnstableBlobResourceContents struct {
	// The _meta property is reserved by ACP to allow clients and agents to attach additional
	// metadata to their interactions. Implementations MUST NOT make assumptions about values at
	// these keys.
	//
	// See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v1/draft/extensibility)
	Meta map[string]any `json:"_meta,omitempty"`
	// Base64-encoded bytes for a binary resource payload.
	Blob string `json:"blob"`
	// MIME type describing the encoded media payload.
	MimeType *string `json:"mimeType,omitzero"`
	// URI associated with this resource or media payload.
	Uri string `json:"uri"`
}

Binary resource contents.

type UnstableContentBlock

type UnstableContentBlock struct {
	// Text content. May be plain text or formatted with Markdown.
	//
	// All agents MUST support text content blocks in prompts.
	// Clients SHOULD render this text as Markdown.
	Text *UnstableContentBlockText `json:"-"`
	// Images for visual context or analysis.
	//
	// Requires the 'image' prompt capability when included in prompts.
	Image *UnstableContentBlockImage `json:"-"`
	// Audio data for transcription or analysis.
	//
	// Requires the 'audio' prompt capability when included in prompts.
	Audio *UnstableContentBlockAudio `json:"-"`
	// References to resources that the agent can access.
	//
	// All agents MUST support resource links in prompts.
	ResourceLink *UnstableContentBlockResourceLink `json:"-"`
	// Complete resource contents embedded directly in the message.
	//
	// Preferred for including context as it avoids extra round-trips.
	//
	// Requires the 'embeddedContext' prompt capability when included in prompts.
	Resource *UnstableContentBlockResource `json:"-"`
}

func NewUnstableContentBlockAudio

func NewUnstableContentBlockAudio(data string, mimeType string) UnstableContentBlock

NewUnstableContentBlockAudio constructs a UnstableContentBlock using the 'audio' variant.

func NewUnstableContentBlockImage

func NewUnstableContentBlockImage(data string, mimeType string) UnstableContentBlock

NewUnstableContentBlockImage constructs a UnstableContentBlock using the 'image' variant.

func NewUnstableContentBlockResource

func NewUnstableContentBlockResource(resource UnstableEmbeddedResourceResource) UnstableContentBlock

NewUnstableContentBlockResource constructs a UnstableContentBlock using the 'resource' variant.

func NewUnstableContentBlockResourceLink(name string, uri string) UnstableContentBlock

NewUnstableContentBlockResourceLink constructs a UnstableContentBlock using the 'resource_link' variant.

func NewUnstableContentBlockText

func NewUnstableContentBlockText(text string) UnstableContentBlock

NewUnstableContentBlockText constructs a UnstableContentBlock using the 'text' variant.

func (UnstableContentBlock) MarshalJSONTo

func (u UnstableContentBlock) MarshalJSONTo(enc *jsontext.Encoder) error

func (*UnstableContentBlock) UnmarshalJSONFrom

func (u *UnstableContentBlock) UnmarshalJSONFrom(dec *jsontext.Decoder) error

func (*UnstableContentBlock) Validate

func (u *UnstableContentBlock) Validate() error

type UnstableContentBlockAudio

type UnstableContentBlockAudio struct {
	// The _meta property is reserved by ACP to allow clients and agents to attach additional
	// metadata to their interactions. Implementations MUST NOT make assumptions about values at
	// these keys.
	//
	// See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v1/draft/extensibility)
	Meta map[string]any `json:"_meta,omitempty"`
	// Optional annotations that help clients decide how to display or route this content.
	Annotations *UnstableAnnotations `json:"annotations,omitzero"`
	// Base64-encoded media payload.
	Data string `json:"data"`
	// MIME type describing the encoded media payload.
	MimeType string `json:"mimeType"`
	Type     string `json:"type"`
}

Audio data for transcription or analysis.

Requires the 'audio' prompt capability when included in prompts.

type UnstableContentBlockImage

type UnstableContentBlockImage struct {
	// The _meta property is reserved by ACP to allow clients and agents to attach additional
	// metadata to their interactions. Implementations MUST NOT make assumptions about values at
	// these keys.
	//
	// See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v1/draft/extensibility)
	Meta map[string]any `json:"_meta,omitempty"`
	// Optional annotations that help clients decide how to display or route this content.
	Annotations *UnstableAnnotations `json:"annotations,omitzero"`
	// Base64-encoded media payload.
	Data string `json:"data"`
	// MIME type describing the encoded media payload.
	MimeType string `json:"mimeType"`
	Type     string `json:"type"`
	// URI associated with this resource or media payload.
	Uri *string `json:"uri,omitzero"`
}

Images for visual context or analysis.

Requires the 'image' prompt capability when included in prompts.

type UnstableContentBlockResource

type UnstableContentBlockResource struct {
	// The _meta property is reserved by ACP to allow clients and agents to attach additional
	// metadata to their interactions. Implementations MUST NOT make assumptions about values at
	// these keys.
	//
	// See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v1/draft/extensibility)
	Meta map[string]any `json:"_meta,omitempty"`
	// Optional annotations that help clients decide how to display or route this content.
	Annotations *UnstableAnnotations `json:"annotations,omitzero"`
	// Embedded resource payload, either text or binary data.
	Resource UnstableEmbeddedResourceResource `json:"resource"`
	Type     string                           `json:"type"`
}

Complete resource contents embedded directly in the message.

Preferred for including context as it avoids extra round-trips.

Requires the 'embeddedContext' prompt capability when included in prompts.

type UnstableContentBlockResourceLink struct {
	// The _meta property is reserved by ACP to allow clients and agents to attach additional
	// metadata to their interactions. Implementations MUST NOT make assumptions about values at
	// these keys.
	//
	// See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v1/draft/extensibility)
	Meta map[string]any `json:"_meta,omitempty"`
	// Optional annotations that help clients decide how to display or route this content.
	Annotations *UnstableAnnotations `json:"annotations,omitzero"`
	// Optional human-readable details shown with this protocol object.
	Description *string `json:"description,omitzero"`
	// MIME type describing the encoded media payload.
	MimeType *string `json:"mimeType,omitzero"`
	// Human-readable name shown for this protocol object.
	Name string `json:"name"`
	// Optional size of the linked resource in bytes, if known.
	Size *int `json:"size,omitzero"`
	// Optional display title for end-user UI.
	Title *string `json:"title,omitzero"`
	Type  string  `json:"type"`
	// URI associated with this resource or media payload.
	Uri string `json:"uri"`
}

References to resources that the agent can access.

All agents MUST support resource links in prompts.

type UnstableContentBlockText

type UnstableContentBlockText struct {
	// The _meta property is reserved by ACP to allow clients and agents to attach additional
	// metadata to their interactions. Implementations MUST NOT make assumptions about values at
	// these keys.
	//
	// See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v1/draft/extensibility)
	Meta map[string]any `json:"_meta,omitempty"`
	// Optional annotations that help clients decide how to display or route this content.
	Annotations *UnstableAnnotations `json:"annotations,omitzero"`
	// Text payload carried by this content block.
	Text string `json:"text"`
	Type string `json:"type"`
}

Content blocks represent displayable information in the Agent Client Protocol.

Content blocks appear in: - User prompts sent via 'session/prompt' - Language model output streamed through 'session/update' notifications - Progress updates and results from tool calls

This structure is compatible with the Model Context Protocol (MCP), so agents can forward content from MCP tool outputs without transformation.

See protocol docs: Content(https://agentclientprotocol.com/protocol/v1/draft/content) Text content. May be plain text or formatted with Markdown.

All agents MUST support text content blocks in prompts. Clients SHOULD render this text as Markdown.

type UnstableDisableProviderRequest

type UnstableDisableProviderRequest struct {
	// The _meta property is reserved by ACP to allow clients and agents to attach additional
	// metadata to their interactions. Implementations MUST NOT make assumptions about values at
	// these keys.
	//
	// See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v1/draft/extensibility)
	Meta map[string]any `json:"_meta,omitempty"`
	// Provider ID to disable.
	ProviderId UnstableProviderId `json:"providerId"`
}

**UNSTABLE**

This capability is not part of the spec yet, and may be removed or changed at any point.

Request parameters for 'providers/disable'.

func (*UnstableDisableProviderRequest) Validate

func (v *UnstableDisableProviderRequest) Validate() error

type UnstableDisableProviderResponse

type UnstableDisableProviderResponse struct {
	// The _meta property is reserved by ACP to allow clients and agents to attach additional
	// metadata to their interactions. Implementations MUST NOT make assumptions about values at
	// these keys.
	//
	// See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v1/draft/extensibility)
	Meta map[string]any `json:"_meta,omitempty"`
}

**UNSTABLE**

This capability is not part of the spec yet, and may be removed or changed at any point.

Response to 'providers/disable'.

func (*UnstableDisableProviderResponse) Validate

func (v *UnstableDisableProviderResponse) Validate() error

type UnstableEmbeddedResource

type UnstableEmbeddedResource struct {
	// The _meta property is reserved by ACP to allow clients and agents to attach additional
	// metadata to their interactions. Implementations MUST NOT make assumptions about values at
	// these keys.
	//
	// See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v1/draft/extensibility)
	Meta map[string]any `json:"_meta,omitempty"`
	// Optional annotations that help clients decide how to display or route this content.
	Annotations *UnstableAnnotations `json:"annotations,omitzero"`
	// Embedded resource payload, either text or binary data.
	Resource UnstableEmbeddedResourceResource `json:"resource"`
}

The contents of a resource, embedded into a prompt or tool call result.

type UnstableEmbeddedResourceResource

type UnstableEmbeddedResourceResource struct {
	// Text resource contents embedded directly in the message.
	TextResourceContents *UnstableTextResourceContents `json:"-"`
	// Binary resource contents embedded directly in the message.
	BlobResourceContents *UnstableBlobResourceContents `json:"-"`
}

Resource content that can be embedded in a message.

func (UnstableEmbeddedResourceResource) MarshalJSONTo

func (*UnstableEmbeddedResourceResource) UnmarshalJSONFrom

func (u *UnstableEmbeddedResourceResource) UnmarshalJSONFrom(dec *jsontext.Decoder) error

type UnstableEnvVariable

type UnstableEnvVariable struct {
	// The _meta property is reserved by ACP to allow clients and agents to attach additional
	// metadata to their interactions. Implementations MUST NOT make assumptions about values at
	// these keys.
	//
	// See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v1/draft/extensibility)
	Meta map[string]any `json:"_meta,omitempty"`
	// The name of the environment variable.
	Name string `json:"name"`
	// The value to set for the environment variable.
	Value string `json:"value"`
}

An environment variable to set when launching an MCP server.

type UnstableForkSessionRequest

type UnstableForkSessionRequest struct {
	// The _meta property is reserved by ACP to allow clients and agents to attach additional
	// metadata to their interactions. Implementations MUST NOT make assumptions about values at
	// these keys.
	//
	// See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v1/draft/extensibility)
	Meta map[string]any `json:"_meta,omitempty"`
	// Additional workspace roots to activate for this session. Each path must be absolute.
	//
	// When omitted or empty, no additional roots are activated. When non-empty,
	// this is the complete resulting additional-root list for the forked
	// session.
	AdditionalDirectories []string `json:"additionalDirectories,omitempty"`
	// The working directory for this session. Must be an absolute path.
	Cwd string `json:"cwd"`
	// List of MCP servers to connect to for this session.
	McpServers []UnstableMcpServer `json:"mcpServers,omitempty"`
	// The ID of the session to fork.
	SessionId UnstableSessionId `json:"sessionId"`
	// System-level instructions for the forked session.
	//
	// Optional. Omitted and 'null' are equivalent. The Agent may then keep a
	// system prompt it stored with the source session or use its default
	// instructions. Clients MUST only send this when the Agent advertises
	// 'sessionCapabilities.systemPrompt', and SHOULD send the same value they used
	// for the source session.
	SystemPrompt *UnstableSystemPrompt `json:"systemPrompt,omitzero"`
}

**UNSTABLE**

This capability is not part of the spec yet, and may be removed or changed at any point.

Request parameters for forking an existing session.

Creates a new session based on the context of an existing one, allowing operations like generating summaries without affecting the original session's history.

Only available if the Agent supports the 'session.fork' capability.

func (*UnstableForkSessionRequest) Validate

func (v *UnstableForkSessionRequest) Validate() error

type UnstableForkSessionResponse

type UnstableForkSessionResponse struct {
	// The _meta property is reserved by ACP to allow clients and agents to attach additional
	// metadata to their interactions. Implementations MUST NOT make assumptions about values at
	// these keys.
	//
	// See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v1/draft/extensibility)
	Meta map[string]any `json:"_meta,omitempty"`
	// Initial session configuration options if supported by the Agent.
	ConfigOptions []UnstableSessionConfigOption `json:"configOptions,omitempty"`
	// Initial mode state if supported by the Agent
	//
	// See protocol docs: [Session Modes](https://agentclientprotocol.com/protocol/v1/draft/session-modes)
	Modes *UnstableSessionModeState `json:"modes,omitzero"`
	// Unique identifier for the newly created forked session.
	SessionId UnstableSessionId `json:"sessionId"`
}

**UNSTABLE**

This capability is not part of the spec yet, and may be removed or changed at any point.

Response from forking an existing session.

func (*UnstableForkSessionResponse) Validate

func (v *UnstableForkSessionResponse) Validate() error

type UnstableHttpHeader

type UnstableHttpHeader struct {
	// The _meta property is reserved by ACP to allow clients and agents to attach additional
	// metadata to their interactions. Implementations MUST NOT make assumptions about values at
	// these keys.
	//
	// See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v1/draft/extensibility)
	Meta map[string]any `json:"_meta,omitempty"`
	// The name of the HTTP header.
	Name string `json:"name"`
	// The value to set for the HTTP header.
	Value string `json:"value"`
}

An HTTP header to set when making requests to the MCP server.

type UnstableImageContent

type UnstableImageContent struct {
	// The _meta property is reserved by ACP to allow clients and agents to attach additional
	// metadata to their interactions. Implementations MUST NOT make assumptions about values at
	// these keys.
	//
	// See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v1/draft/extensibility)
	Meta map[string]any `json:"_meta,omitempty"`
	// Optional annotations that help clients decide how to display or route this content.
	Annotations *UnstableAnnotations `json:"annotations,omitzero"`
	// Base64-encoded media payload.
	Data string `json:"data"`
	// MIME type describing the encoded media payload.
	MimeType string `json:"mimeType"`
	// URI associated with this resource or media payload.
	Uri *string `json:"uri,omitzero"`
}

An image provided to or from an LLM.

type UnstableListProvidersRequest

type UnstableListProvidersRequest struct {
	// The _meta property is reserved by ACP to allow clients and agents to attach additional
	// metadata to their interactions. Implementations MUST NOT make assumptions about values at
	// these keys.
	//
	// See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v1/draft/extensibility)
	Meta map[string]any `json:"_meta,omitempty"`
}

**UNSTABLE**

This capability is not part of the spec yet, and may be removed or changed at any point.

Request parameters for 'providers/list'.

func (*UnstableListProvidersRequest) Validate

func (v *UnstableListProvidersRequest) Validate() error

type UnstableListProvidersResponse

type UnstableListProvidersResponse struct {
	// The _meta property is reserved by ACP to allow clients and agents to attach additional
	// metadata to their interactions. Implementations MUST NOT make assumptions about values at
	// these keys.
	//
	// See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v1/draft/extensibility)
	Meta map[string]any `json:"_meta,omitempty"`
	// Configurable providers with current routing info suitable for UI display.
	Providers []UnstableProviderInfo `json:"providers"`
}

**UNSTABLE**

This capability is not part of the spec yet, and may be removed or changed at any point.

Response to 'providers/list'.

func (*UnstableListProvidersResponse) Validate

func (v *UnstableListProvidersResponse) Validate() error

type UnstableLlmProtocol

type UnstableLlmProtocol string

**UNSTABLE**

This capability is not part of the spec yet, and may be removed or changed at any point.

Well-known API protocol identifiers for LLM providers.

Agents and clients MUST handle unknown protocol identifiers gracefully.

Protocol names beginning with '_' are free for custom use, like other ACP extension methods. Protocol names that do not begin with '_' are reserved for the ACP spec.

const (
	UnstableLlmProtocolAnthropic UnstableLlmProtocol = "anthropic"
	UnstableLlmProtocolOpenai    UnstableLlmProtocol = "openai"
	UnstableLlmProtocolAzure     UnstableLlmProtocol = "azure"
	UnstableLlmProtocolVertex    UnstableLlmProtocol = "vertex"
	UnstableLlmProtocolBedrock   UnstableLlmProtocol = "bedrock"
)

type UnstableMcpError

type UnstableMcpError struct {
	// Inner MCP error code. Never an ACP error code.
	Code int `json:"code"`
	// Optional error data. Explicit null is retained.
	Data any `json:"data,omitzero"`
	// Inner MCP error message.
	Message string `json:"message"`
}

**UNSTABLE**

An inner MCP error, distinct from an outer ACP binding or runtime error.

'code' and 'message' are required and non-null. 'data' is optional. Explicit 'null' is preserved separately from an omitted key.

type UnstableMcpRequestId

type UnstableMcpRequestId string

**UNSTABLE**

This capability is not part of the spec yet, and may be removed or changed at any point.

Identifies an inner MCP request active against a server on this ACP connection.

Generated by the caller and preserved unchanged by proxies. This is distinct from the outer ACP JSON-RPC request ID.

type UnstableMcpServer

type UnstableMcpServer struct {
	// HTTP transport configuration
	//
	// Only available when the Agent capabilities indicate 'mcp_capabilities.http' is 'true'.
	Http *UnstableMcpServerHttpInline `json:"-"`
	// SSE transport configuration
	//
	// Only available when the Agent capabilities indicate 'mcp_capabilities.sse' is 'true'.
	Sse *UnstableMcpServerSseInline `json:"-"`
	// **UNSTABLE**
	//
	// This capability is not part of the spec yet, and may be removed or changed at any point.
	//
	// ACP transport configuration
	//
	// Only available when the Agent capabilities indicate 'mcp_capabilities.acp' is 'true'.
	// The MCP server is provided by an ACP component and communicates over the ACP channel.
	Acp *UnstableMcpServerAcpInline `json:"-"`
	// Stdio transport configuration
	//
	// All Agents MUST support this transport.
	Stdio *UnstableMcpServerStdio `json:"-"`
}

func (UnstableMcpServer) MarshalJSONTo

func (u UnstableMcpServer) MarshalJSONTo(enc *jsontext.Encoder) error

func (*UnstableMcpServer) UnmarshalJSONFrom

func (u *UnstableMcpServer) UnmarshalJSONFrom(dec *jsontext.Decoder) error

type UnstableMcpServerAcp

type UnstableMcpServerAcp struct {
	// The _meta property is reserved by ACP to allow clients and agents to attach additional
	// metadata to their interactions. Implementations MUST NOT make assumptions about values at
	// these keys.
	//
	// See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v1/draft/extensibility)
	Meta map[string]any `json:"_meta,omitempty"`
	// Human-readable name identifying this MCP server.
	Name string `json:"name"`
	// Unique identifier for this MCP server, generated by the component providing it.
	//
	// Providers MUST NOT reuse an ID for multiple ACP-transport MCP servers that are visible
	// on the same ACP connection.
	ServerId UnstableMcpServerAcpId `json:"serverId"`
}

**UNSTABLE**

This capability is not part of the spec yet, and may be removed or changed at any point.

ACP transport configuration for MCP.

The MCP server is provided by an ACP component and communicates over the ACP channel using 'mcp/message'.

type UnstableMcpServerAcpId

type UnstableMcpServerAcpId string

**UNSTABLE**

This capability is not part of the spec yet, and may be removed or changed at any point.

Unique identifier for an MCP server using the ACP transport.

The value is opaque and generated by the ACP component providing the MCP server. It is used by 'mcp/message' to route requests to the component that declared the server.

type UnstableMcpServerAcpInline

type UnstableMcpServerAcpInline struct {
	// The _meta property is reserved by ACP to allow clients and agents to attach additional
	// metadata to their interactions. Implementations MUST NOT make assumptions about values at
	// these keys.
	//
	// See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v1/draft/extensibility)
	Meta map[string]any `json:"_meta,omitempty"`
	// Human-readable name identifying this MCP server.
	Name string `json:"name"`
	// Unique identifier for this MCP server, generated by the component providing it.
	//
	// Providers MUST NOT reuse an ID for multiple ACP-transport MCP servers that are visible
	// on the same ACP connection.
	ServerId UnstableMcpServerAcpId `json:"serverId"`
	Type     string                 `json:"type"`
}

**UNSTABLE**

This capability is not part of the spec yet, and may be removed or changed at any point.

ACP transport configuration

Only available when the Agent capabilities indicate 'mcp_capabilities.acp' is 'true'. The MCP server is provided by an ACP component and communicates over the ACP channel.

type UnstableMcpServerHttp

type UnstableMcpServerHttp struct {
	// The _meta property is reserved by ACP to allow clients and agents to attach additional
	// metadata to their interactions. Implementations MUST NOT make assumptions about values at
	// these keys.
	//
	// See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v1/draft/extensibility)
	Meta map[string]any `json:"_meta,omitempty"`
	// HTTP headers to set when making requests to the MCP server.
	Headers []UnstableHttpHeader `json:"headers"`
	// Human-readable name identifying this MCP server.
	Name string `json:"name"`
	// URL to the MCP server.
	Url string `json:"url"`
}

HTTP transport configuration for MCP.

type UnstableMcpServerHttpInline

type UnstableMcpServerHttpInline struct {
	// The _meta property is reserved by ACP to allow clients and agents to attach additional
	// metadata to their interactions. Implementations MUST NOT make assumptions about values at
	// these keys.
	//
	// See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v1/draft/extensibility)
	Meta map[string]any `json:"_meta,omitempty"`
	// HTTP headers to set when making requests to the MCP server.
	Headers []UnstableHttpHeader `json:"headers"`
	// Human-readable name identifying this MCP server.
	Name string `json:"name"`
	Type string `json:"type"`
	// URL to the MCP server.
	Url string `json:"url"`
}

Configuration for connecting to an MCP (Model Context Protocol) server.

MCP servers provide tools and context that the agent can use when processing prompts.

See protocol docs: [MCP Servers](https://agentclientprotocol.com/protocol/v1/draft/session-setup#mcp-servers) HTTP transport configuration

Only available when the Agent capabilities indicate 'mcp_capabilities.http' is 'true'.

type UnstableMcpServerSse

type UnstableMcpServerSse struct {
	// The _meta property is reserved by ACP to allow clients and agents to attach additional
	// metadata to their interactions. Implementations MUST NOT make assumptions about values at
	// these keys.
	//
	// See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v1/draft/extensibility)
	Meta map[string]any `json:"_meta,omitempty"`
	// HTTP headers to set when making requests to the MCP server.
	Headers []UnstableHttpHeader `json:"headers"`
	// Human-readable name identifying this MCP server.
	Name string `json:"name"`
	// URL to the MCP server.
	Url string `json:"url"`
}

SSE transport configuration for MCP.

type UnstableMcpServerSseInline

type UnstableMcpServerSseInline struct {
	// The _meta property is reserved by ACP to allow clients and agents to attach additional
	// metadata to their interactions. Implementations MUST NOT make assumptions about values at
	// these keys.
	//
	// See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v1/draft/extensibility)
	Meta map[string]any `json:"_meta,omitempty"`
	// HTTP headers to set when making requests to the MCP server.
	Headers []UnstableHttpHeader `json:"headers"`
	// Human-readable name identifying this MCP server.
	Name string `json:"name"`
	Type string `json:"type"`
	// URL to the MCP server.
	Url string `json:"url"`
}

SSE transport configuration

Only available when the Agent capabilities indicate 'mcp_capabilities.sse' is 'true'.

type UnstableMcpServerStdio

type UnstableMcpServerStdio struct {
	// The _meta property is reserved by ACP to allow clients and agents to attach additional
	// metadata to their interactions. Implementations MUST NOT make assumptions about values at
	// these keys.
	//
	// See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v1/draft/extensibility)
	Meta map[string]any `json:"_meta,omitempty"`
	// Command-line arguments to pass to the MCP server.
	Args []string `json:"args"`
	// Absolute path to the MCP server executable.
	Command string `json:"command"`
	// Environment variables to set when launching the MCP server.
	Env []UnstableEnvVariable `json:"env"`
	// Human-readable name identifying this MCP server.
	Name string `json:"name"`
}

Stdio transport configuration for MCP.

type UnstableMessageMcpError

type UnstableMessageMcpError struct {
	// Optional ACP carrier metadata.
	Meta map[string]any `json:"_meta,omitempty"`
	// Required, non-null MCP error object.
	Error UnstableMcpError `json:"error"`
}

A structured inner MCP error.

type UnstableMessageMcpNotification

type UnstableMessageMcpNotification struct {
	// The _meta property is reserved by ACP to allow clients and agents to attach additional
	// metadata to their interactions. Implementations MUST NOT make assumptions about values at
	// these keys.
	//
	// See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v1/draft/extensibility)
	Meta map[string]any `json:"_meta,omitempty"`
	// The inner MCP method name.
	Method string `json:"method"`
	// Optional inner MCP params.
	//
	// If omitted or set to 'null', the inner MCP message has no params.
	Params map[string]any `json:"params,omitempty"`
	// The identifier of the active inner MCP request.
	RequestId UnstableMcpRequestId `json:"requestId"`
	// The declared ACP MCP server handling the associated request.
	ServerId UnstableMcpServerAcpId `json:"serverId"`
}

**UNSTABLE**

This capability is not part of the spec yet, and may be removed or changed at any point.

Notification parameters for 'mcp/message'.

Sent by the provider to the consumer for an active request (including subscription acknowledgements and updates). The outer envelope has no 'id'.

func (*UnstableMessageMcpNotification) Validate

func (v *UnstableMessageMcpNotification) Validate() error

type UnstableMessageMcpRequest

type UnstableMessageMcpRequest struct {
	// The _meta property is reserved by ACP to allow clients and agents to attach additional
	// metadata to their interactions. Implementations MUST NOT make assumptions about values at
	// these keys.
	//
	// See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v1/draft/extensibility)
	Meta map[string]any `json:"_meta,omitempty"`
	// The inner MCP method name.
	Method string `json:"method"`
	// Optional inner MCP params.
	//
	// If omitted or set to 'null', the inner MCP message has no params.
	Params map[string]any `json:"params,omitempty"`
	// The caller-generated identifier for the inner MCP request.
	RequestId UnstableMcpRequestId `json:"requestId"`
	// The declared ACP MCP server receiving this request.
	ServerId UnstableMcpServerAcpId `json:"serverId"`
}

**UNSTABLE**

This capability is not part of the spec yet, and may be removed or changed at any point.

Request parameters for 'mcp/message'.

func (*UnstableMessageMcpRequest) Validate

func (v *UnstableMessageMcpRequest) Validate() error

type UnstableMessageMcpResponse

type UnstableMessageMcpResponse struct {
	// An opaque inner MCP result.
	Result *UnstableMessageMcpResult `json:"-"`
	// A structured inner MCP error.
	Error *UnstableMessageMcpError `json:"-"`
}

func (UnstableMessageMcpResponse) MarshalJSONTo

func (u UnstableMessageMcpResponse) MarshalJSONTo(enc *jsontext.Encoder) error

func (*UnstableMessageMcpResponse) UnmarshalJSONFrom

func (u *UnstableMessageMcpResponse) UnmarshalJSONFrom(dec *jsontext.Decoder) error

type UnstableMessageMcpResult

type UnstableMessageMcpResult struct {
	// Optional ACP carrier metadata.
	Meta map[string]any `json:"_meta,omitempty"`
	// Required, even if JSON null.
	Result any `json:"result"`
}

**UNSTABLE**

The successful outer ACP 'mcp/message' response carries exactly one inner MCP outcome: an opaque result (including JSON null), or an MCP error. Outer ACP errors are reserved for binding and runtime failures.

Both branches require their carrier key. An error must be a non-null object. Unknown outer fields are ignored. Inner result and error fields are preserved. Carrier '_meta' is optional. Null or invalid values are treated as absent. Senders must include exactly one outcome. Receivers prefer 'result' if both are present. An opaque inner MCP result.

type UnstableProviderCurrentConfig

type UnstableProviderCurrentConfig struct {
	// The _meta property is reserved by ACP to allow clients and agents to attach additional
	// metadata to their interactions. Implementations MUST NOT make assumptions about values at
	// these keys.
	//
	// See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v1/draft/extensibility)
	Meta map[string]any `json:"_meta,omitempty"`
	// Protocol currently used by this provider.
	ApiType UnstableLlmProtocol `json:"apiType"`
	// Base URL currently used by this provider.
	BaseUrl string `json:"baseUrl"`
}

**UNSTABLE**

This capability is not part of the spec yet, and may be removed or changed at any point.

Current effective non-secret routing configuration for a provider.

type UnstableProviderId

type UnstableProviderId string

**UNSTABLE**

This capability is not part of the spec yet, and may be removed or changed at any point.

Unique identifier for a configurable LLM provider.

type UnstableProviderInfo

type UnstableProviderInfo struct {
	// The _meta property is reserved by ACP to allow clients and agents to attach additional
	// metadata to their interactions. Implementations MUST NOT make assumptions about values at
	// these keys.
	//
	// See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v1/draft/extensibility)
	Meta map[string]any `json:"_meta,omitempty"`
	// Current effective non-secret routing config.
	// Null or omitted means provider is disabled.
	Current *UnstableProviderCurrentConfig `json:"current,omitzero"`
	// Provider identifier, for example "main" or "openai".
	ProviderId UnstableProviderId `json:"providerId"`
	// Whether this provider is mandatory and cannot be disabled via 'providers/disable'.
	// If true, clients must not call 'providers/disable' for this provider ID.
	Required bool `json:"required"`
	// Supported protocol types for this provider.
	Supported []UnstableLlmProtocol `json:"supported"`
}

**UNSTABLE**

This capability is not part of the spec yet, and may be removed or changed at any point.

Information about a configurable LLM provider.

type UnstableResourceLink struct {
	// The _meta property is reserved by ACP to allow clients and agents to attach additional
	// metadata to their interactions. Implementations MUST NOT make assumptions about values at
	// these keys.
	//
	// See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v1/draft/extensibility)
	Meta map[string]any `json:"_meta,omitempty"`
	// Optional annotations that help clients decide how to display or route this content.
	Annotations *UnstableAnnotations `json:"annotations,omitzero"`
	// Optional human-readable details shown with this protocol object.
	Description *string `json:"description,omitzero"`
	// MIME type describing the encoded media payload.
	MimeType *string `json:"mimeType,omitzero"`
	// Human-readable name shown for this protocol object.
	Name string `json:"name"`
	// Optional size of the linked resource in bytes, if known.
	Size *int `json:"size,omitzero"`
	// Optional display title for end-user UI.
	Title *string `json:"title,omitzero"`
	// URI associated with this resource or media payload.
	Uri string `json:"uri"`
}

A resource that the server is capable of reading, included in a prompt or tool call result.

type UnstableSessionConfigOption

type UnstableSessionConfigOption struct {
	// Single-value selector (dropdown).
	Select *UnstableSessionConfigOptionSelect `json:"-"`
	// Boolean on/off toggle.
	Boolean *UnstableSessionConfigOptionBoolean `json:"-"`
}

func NewUnstableSessionConfigOptionBoolean

func NewUnstableSessionConfigOptionBoolean(currentValue bool) UnstableSessionConfigOption

NewUnstableSessionConfigOptionBoolean constructs a UnstableSessionConfigOption using the 'boolean' variant.

func NewUnstableSessionConfigOptionSelect

func NewUnstableSessionConfigOptionSelect(currentValue SessionConfigValueId, options UnstableSessionConfigSelectOptions) UnstableSessionConfigOption

NewUnstableSessionConfigOptionSelect constructs a UnstableSessionConfigOption using the 'select' variant.

func (UnstableSessionConfigOption) MarshalJSONTo

func (u UnstableSessionConfigOption) MarshalJSONTo(enc *jsontext.Encoder) error

func (*UnstableSessionConfigOption) UnmarshalJSONFrom

func (u *UnstableSessionConfigOption) UnmarshalJSONFrom(dec *jsontext.Decoder) error

func (*UnstableSessionConfigOption) Validate

func (u *UnstableSessionConfigOption) Validate() error

type UnstableSessionConfigOptionBoolean

type UnstableSessionConfigOptionBoolean struct {
	// The _meta property is reserved by ACP to allow clients and agents to attach additional
	// metadata to their interactions. Implementations MUST NOT make assumptions about values at
	// these keys.
	//
	// See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v1/draft/extensibility)
	Meta map[string]any `json:"_meta,omitempty"`
	// Optional semantic category for this option (UX only).
	Category *SessionConfigOptionCategory `json:"category,omitzero"`
	// The current value of the boolean option.
	CurrentValue bool `json:"currentValue"`
	// Optional description for the Client to display to the user.
	Description *string `json:"description,omitzero"`
	// Unique identifier for the configuration option.
	Id SessionConfigId `json:"id"`
	// Human-readable label for the option.
	Name string `json:"name"`
	Type string `json:"type"`
}

Boolean on/off toggle.

type UnstableSessionConfigOptionSelect

type UnstableSessionConfigOptionSelect struct {
	// The _meta property is reserved by ACP to allow clients and agents to attach additional
	// metadata to their interactions. Implementations MUST NOT make assumptions about values at
	// these keys.
	//
	// See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v1/draft/extensibility)
	Meta map[string]any `json:"_meta,omitempty"`
	// Optional semantic category for this option (UX only).
	Category *SessionConfigOptionCategory `json:"category,omitzero"`
	// The currently selected value.
	CurrentValue SessionConfigValueId `json:"currentValue"`
	// Optional description for the Client to display to the user.
	Description *string `json:"description,omitzero"`
	// Unique identifier for the configuration option.
	Id SessionConfigId `json:"id"`
	// Human-readable label for the option.
	Name string `json:"name"`
	// The set of selectable options.
	Options UnstableSessionConfigSelectOptions `json:"options"`
	Type    string                             `json:"type"`
}

A session configuration option selector and its current state. Single-value selector (dropdown).

type UnstableSessionConfigSelect

type UnstableSessionConfigSelect struct {
	// The currently selected value.
	CurrentValue SessionConfigValueId `json:"currentValue"`
	// The set of selectable options.
	Options UnstableSessionConfigSelectOptions `json:"options"`
}

A single-value selector (dropdown) session configuration option payload.

type UnstableSessionConfigSelectGroup

type UnstableSessionConfigSelectGroup struct {
	// The _meta property is reserved by ACP to allow clients and agents to attach additional
	// metadata to their interactions. Implementations MUST NOT make assumptions about values at
	// these keys.
	//
	// See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v1/draft/extensibility)
	Meta map[string]any `json:"_meta,omitempty"`
	// Unique identifier for this group.
	Group SessionConfigGroupId `json:"group"`
	// Human-readable label for this group.
	Name string `json:"name"`
	// The set of option values in this group.
	Options []UnstableSessionConfigSelectOption `json:"options"`
}

A group of possible values for a session configuration option.

type UnstableSessionConfigSelectOption

type UnstableSessionConfigSelectOption struct {
	// The _meta property is reserved by ACP to allow clients and agents to attach additional
	// metadata to their interactions. Implementations MUST NOT make assumptions about values at
	// these keys.
	//
	// See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v1/draft/extensibility)
	Meta map[string]any `json:"_meta,omitempty"`
	// Optional description for this option value.
	Description *string `json:"description,omitzero"`
	// Human-readable label for this option value.
	Name string `json:"name"`
	// Unique identifier for this option value.
	Value SessionConfigValueId `json:"value"`
}

A possible value for a session configuration option.

type UnstableSessionConfigSelectOptions

type UnstableSessionConfigSelectOptions struct {
	// A flat list of options with no grouping.
	Ungrouped *UnstableSessionConfigSelectOptionsUngrouped `json:"-"`
	// A list of options grouped under headers.
	Grouped *UnstableSessionConfigSelectOptionsGrouped `json:"-"`
}

func (UnstableSessionConfigSelectOptions) MarshalJSONTo

func (*UnstableSessionConfigSelectOptions) UnmarshalJSONFrom

func (u *UnstableSessionConfigSelectOptions) UnmarshalJSONFrom(dec *jsontext.Decoder) error

type UnstableSessionConfigSelectOptionsGrouped

type UnstableSessionConfigSelectOptionsGrouped []UnstableSessionConfigSelectGroup

A list of options grouped under headers.

type UnstableSessionConfigSelectOptionsUngrouped

type UnstableSessionConfigSelectOptionsUngrouped []UnstableSessionConfigSelectOption

Possible values for a session configuration option. A flat list of options with no grouping.

type UnstableSessionId

type UnstableSessionId string

A unique identifier for a conversation session between a client and agent.

Each session has its own context, conversation history, and state, so one agent can run several independent sessions.

See protocol docs: [Session ID](https://agentclientprotocol.com/protocol/v1/draft/session-setup#session-id)

type UnstableSessionMode

type UnstableSessionMode struct {
	// The _meta property is reserved by ACP to allow clients and agents to attach additional
	// metadata to their interactions. Implementations MUST NOT make assumptions about values at
	// these keys.
	//
	// See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v1/draft/extensibility)
	Meta map[string]any `json:"_meta,omitempty"`
	// Optional human-readable details shown with this protocol object.
	Description *string `json:"description,omitzero"`
	// Stable identifier used to refer to this protocol object in later messages.
	Id SessionModeId `json:"id"`
	// Human-readable name shown for this protocol object.
	Name string `json:"name"`
}

A mode the agent can operate in.

See protocol docs: [Session Modes](https://agentclientprotocol.com/protocol/v1/draft/session-modes)

type UnstableSessionModeState

type UnstableSessionModeState struct {
	// The _meta property is reserved by ACP to allow clients and agents to attach additional
	// metadata to their interactions. Implementations MUST NOT make assumptions about values at
	// these keys.
	//
	// See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v1/draft/extensibility)
	Meta map[string]any `json:"_meta,omitempty"`
	// The set of modes that the Agent can operate in
	AvailableModes []UnstableSessionMode `json:"availableModes"`
	// The current mode the Agent is in.
	CurrentModeId SessionModeId `json:"currentModeId"`
}

The set of modes and the one currently active.

type UnstableSessionOptionsRequest

type UnstableSessionOptionsRequest struct {
	// The _meta property is reserved by ACP to allow clients and agents to attach additional
	// metadata to their interactions. Implementations MUST NOT make assumptions about values at
	// these keys.
	//
	// See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v1/draft/extensibility)
	Meta map[string]any `json:"_meta,omitempty"`
	// Additional workspace roots to resolve options for. Each path must be absolute.
	//
	// Optional. Omitted and 'null' are equivalent to an empty list.
	AdditionalDirectories []string `json:"additionalDirectories,omitempty"`
	// The working directory to resolve options for. Must be an absolute path.
	Cwd string `json:"cwd"`
	// The session to resolve options for.
	//
	// Optional. Omitted and 'null' are equivalent and mean a new session. When present,
	// the Agent returns what 'session/load' or 'session/resume' with the same 'cwd' and
	// 'additionalDirectories' would return, with the same 'cwd' rules. A session the
	// Agent does not know gets '-32002'.
	// Clients MUST only send this when the Agent supports 'session/load' ('loadSession')
	// or 'session/resume' ('sessionCapabilities.resume').
	SessionId *UnstableSessionId `json:"sessionId,omitzero"`
}

**UNSTABLE**

This capability is not part of the spec yet, and may be removed or changed at any point.

Request parameters for 'session/options', which returns the config options a session would start with, without creating or resuming a session.

Only available if the Agent supports the 'sessionCapabilities.options' capability.

'session/options' MUST NOT create or resume a session, send 'session/update' notifications, add an entry to 'session/list', or change an existing session. Agents SHOULD NOT connect to MCP servers to answer it.

func (*UnstableSessionOptionsRequest) Validate

func (v *UnstableSessionOptionsRequest) Validate() error

type UnstableSessionOptionsResponse

type UnstableSessionOptionsResponse struct {
	// The _meta property is reserved by ACP to allow clients and agents to attach additional
	// metadata to their interactions. Implementations MUST NOT make assumptions about values at
	// these keys.
	//
	// See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v1/draft/extensibility)
	Meta map[string]any `json:"_meta,omitempty"`
	// The config options the session would start with, with the same rules as on
	// 'NewSessionResponse'.
	//
	// Optional. Omitted, 'null', or empty means no config options are advertised.
	ConfigOptions []UnstableSessionConfigOption `json:"configOptions,omitempty"`
	// The mode state the session would start with, if the Agent supports modes.
	//
	// See protocol docs: [Session Modes](https://agentclientprotocol.com/protocol/v1/draft/session-modes)
	Modes *UnstableSessionModeState `json:"modes,omitzero"`
}

**UNSTABLE**

This capability is not part of the spec yet, and may be removed or changed at any point.

Response from 'session/options'.

The result is a snapshot. The options a session actually starts with are the ones in the session setup response.

Agents only return 'type: "boolean"' options when the Client advertises 'sessionCapabilities.configOptions.boolean'.

func (*UnstableSessionOptionsResponse) Validate

func (v *UnstableSessionOptionsResponse) Validate() error

type UnstableSessionStatus

type UnstableSessionStatus string

**UNSTABLE**

This capability is not part of the spec yet, and may be removed or changed at any point.

Whether the Agent has a session in memory, as reported by 'session/status'.

const (
	UnstableSessionStatusOpen  UnstableSessionStatus = "open"
	UnstableSessionStatusSaved UnstableSessionStatus = "saved"
)

type UnstableSessionStatusRequest

type UnstableSessionStatusRequest struct {
	// The _meta property is reserved by ACP to allow clients and agents to attach additional
	// metadata to their interactions. Implementations MUST NOT make assumptions about values at
	// these keys.
	//
	// See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v1/draft/extensibility)
	Meta map[string]any `json:"_meta,omitempty"`
	// The ID of the session to check.
	SessionId UnstableSessionId `json:"sessionId"`
}

**UNSTABLE**

This capability is not part of the spec yet, and may be removed or changed at any point.

Request parameters for checking the status of a session.

Only available if the Agent supports the 'sessionCapabilities.status' capability.

'session/status' MUST NOT have side effects. The Agent does not load, resume, create, close, or change the session, and does not attach the requesting connection to it. A session the Agent does not know gets '-32002' with the requested 'sessionId' in 'data'.

func (*UnstableSessionStatusRequest) Validate

func (v *UnstableSessionStatusRequest) Validate() error

type UnstableSessionStatusResponse

type UnstableSessionStatusResponse struct {
	// The _meta property is reserved by ACP to allow clients and agents to attach additional
	// metadata to their interactions. Implementations MUST NOT make assumptions about values at
	// these keys.
	//
	// See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v1/draft/extensibility)
	Meta map[string]any `json:"_meta,omitempty"`
	// Whether the Agent has the session in memory.
	//
	// Required. Clients MUST treat a value they do not recognize as 'saved'.
	Status UnstableSessionStatus `json:"status"`
}

**UNSTABLE**

This capability is not part of the spec yet, and may be removed or changed at any point.

Response from checking the status of a session.

The result is a snapshot. A session reported 'open' may be closed or evicted before the Client's next request.

func (*UnstableSessionStatusResponse) Validate

func (v *UnstableSessionStatusResponse) Validate() error

type UnstableSetProviderRequest

type UnstableSetProviderRequest struct {
	// The _meta property is reserved by ACP to allow clients and agents to attach additional
	// metadata to their interactions. Implementations MUST NOT make assumptions about values at
	// these keys.
	//
	// See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v1/draft/extensibility)
	Meta map[string]any `json:"_meta,omitempty"`
	// Protocol type for this provider.
	ApiType UnstableLlmProtocol `json:"apiType"`
	// Base URL for requests sent through this provider.
	BaseUrl string `json:"baseUrl"`
	// Full headers map for this provider.
	// May include authorization, routing, or other integration-specific headers.
	Headers map[string]any `json:"headers,omitempty"`
	// Provider ID to configure.
	ProviderId UnstableProviderId `json:"providerId"`
}

**UNSTABLE**

This capability is not part of the spec yet, and may be removed or changed at any point.

Request parameters for 'providers/set'.

Replaces the full configuration for one provider ID.

func (*UnstableSetProviderRequest) Validate

func (v *UnstableSetProviderRequest) Validate() error

type UnstableSetProviderResponse

type UnstableSetProviderResponse struct {
	// The _meta property is reserved by ACP to allow clients and agents to attach additional
	// metadata to their interactions. Implementations MUST NOT make assumptions about values at
	// these keys.
	//
	// See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v1/draft/extensibility)
	Meta map[string]any `json:"_meta,omitempty"`
}

**UNSTABLE**

This capability is not part of the spec yet, and may be removed or changed at any point.

Response to 'providers/set'.

func (*UnstableSetProviderResponse) Validate

func (v *UnstableSetProviderResponse) Validate() error

type UnstableSetSessionTitleRequest

type UnstableSetSessionTitleRequest struct {
	// The _meta property is reserved by ACP to allow clients and agents to attach additional
	// metadata to their interactions. Implementations MUST NOT make assumptions about values at
	// these keys.
	//
	// See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v1/draft/extensibility)
	Meta map[string]any `json:"_meta,omitempty"`
	// The ID of the session to retitle.
	SessionId UnstableSessionId `json:"sessionId"`
	// The new title for the session.
	//
	// Required and non-null. Omission and explicit 'null' are both invalid. The Agent MAY
	// normalize the title before storing it, for example by trimming whitespace or
	// truncating it. The Agent rejects a title that fails its validation, including one
	// that is empty after normalization, with '-32602'.
	Title string `json:"title"`
}

**UNSTABLE**

This capability is not part of the spec yet, and may be removed or changed at any point.

Request parameters for setting the title of a session.

Only available if the Agent supports the 'sessionCapabilities.title' capability.

The session does not need to be active on the connection. Any session the Agent would return from 'session/list' can be retitled. A session that does not exist gets '-32002'.

The Agent responds only after it has stored the title. After a successful response, the Agent SHOULD NOT replace the title with one it generates automatically.

func (*UnstableSetSessionTitleRequest) Validate

func (v *UnstableSetSessionTitleRequest) Validate() error

type UnstableSetSessionTitleResponse

type UnstableSetSessionTitleResponse struct {
	// The _meta property is reserved by ACP to allow clients and agents to attach additional
	// metadata to their interactions. Implementations MUST NOT make assumptions about values at
	// these keys.
	//
	// See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v1/draft/extensibility)
	Meta map[string]any `json:"_meta,omitempty"`
	// The title the Agent stored.
	//
	// This differs from the requested title if the Agent normalized it. Clients SHOULD
	// display this value rather than the one they sent.
	Title string `json:"title"`
}

**UNSTABLE**

This capability is not part of the spec yet, and may be removed or changed at any point.

Response from setting the title of a session.

func (*UnstableSetSessionTitleResponse) Validate

func (v *UnstableSetSessionTitleResponse) Validate() error

type UnstableSystemPrompt

type UnstableSystemPrompt struct {
	// The _meta property is reserved by ACP to allow clients and agents to attach additional
	// metadata to their interactions. Implementations MUST NOT make assumptions about values at
	// these keys.
	//
	// See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v1/draft/extensibility)
	Meta map[string]any `json:"_meta,omitempty"`
	// The system prompt content.
	//
	// Agents advertising the capability MUST accept 'text' content blocks.
	// Clients MUST NOT send other content block types until a future
	// capability allows them, and Agents MUST return an error for content
	// blocks they do not support.
	//
	// Clients MUST NOT send an empty array. Agents MAY reject one with
	// '-32602' without creating, loading, or resuming the session.
	Content []UnstableContentBlock `json:"content"`
	// How the Agent combines 'content' with its own instructions.
	//
	// Required. Agents MUST return an error for a mode they do not support rather than
	// treating it as 'append' or 'override'.
	Mode SystemPromptMode `json:"mode"`
}

Client-provided system-level instructions for a session.

Clients MUST only send this when the Agent advertises 'sessionCapabilities.systemPrompt'. Agents that cannot apply it, for example because of an unadvertised mode or an unsupported content block type, MUST return an error instead of creating, loading, or resuming the session.

type UnstableTextContent

type UnstableTextContent struct {
	// The _meta property is reserved by ACP to allow clients and agents to attach additional
	// metadata to their interactions. Implementations MUST NOT make assumptions about values at
	// these keys.
	//
	// See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v1/draft/extensibility)
	Meta map[string]any `json:"_meta,omitempty"`
	// Optional annotations that help clients decide how to display or route this content.
	Annotations *UnstableAnnotations `json:"annotations,omitzero"`
	// Text payload carried by this content block.
	Text string `json:"text"`
}

Text provided to or from an LLM.

type UnstableTextResourceContents

type UnstableTextResourceContents struct {
	// The _meta property is reserved by ACP to allow clients and agents to attach additional
	// metadata to their interactions. Implementations MUST NOT make assumptions about values at
	// these keys.
	//
	// See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v1/draft/extensibility)
	Meta map[string]any `json:"_meta,omitempty"`
	// MIME type describing the encoded media payload.
	MimeType *string `json:"mimeType,omitzero"`
	// Text payload carried by this content block.
	Text string `json:"text"`
	// URI associated with this resource or media payload.
	Uri string `json:"uri"`
}

Text-based resource contents.

type UnstableUnarchiveSessionRequest

type UnstableUnarchiveSessionRequest struct {
	// The _meta property is reserved by ACP to allow clients and agents to attach additional
	// metadata to their interactions. Implementations MUST NOT make assumptions about values at
	// these keys.
	//
	// See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v1/draft/extensibility)
	Meta map[string]any `json:"_meta,omitempty"`
	// The ID of the session to unarchive.
	SessionId UnstableSessionId `json:"sessionId"`
}

**UNSTABLE**

This capability is not part of the spec yet, and may be removed or changed at any point.

Request parameters for unarchiving a session.

Only available if the Agent supports the 'sessionCapabilities.archive' capability.

Unarchiving returns the session to default 'session/list' results with the same ID and saved history. It never loads or resumes the session. Clients that want to continue an archived session SHOULD unarchive it before calling 'session/load' or 'session/resume'. Unarchiving a session that is not archived succeeds. A session that does not exist gets '-32002'.

func (*UnstableUnarchiveSessionRequest) Validate

func (v *UnstableUnarchiveSessionRequest) Validate() error

type UnstableUnarchiveSessionResponse

type UnstableUnarchiveSessionResponse struct {
	// The _meta property is reserved by ACP to allow clients and agents to attach additional
	// metadata to their interactions. Implementations MUST NOT make assumptions about values at
	// these keys.
	//
	// See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v1/draft/extensibility)
	Meta map[string]any `json:"_meta,omitempty"`
}

**UNSTABLE**

This capability is not part of the spec yet, and may be removed or changed at any point.

Response from unarchiving a session.

func (*UnstableUnarchiveSessionResponse) Validate

type UnstructuredCommandInput

type UnstructuredCommandInput struct {
	// The _meta property is reserved by ACP to allow clients and agents to attach additional
	// metadata to their interactions. Implementations MUST NOT make assumptions about values at
	// these keys.
	//
	// See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v1/draft/extensibility)
	Meta map[string]any `json:"_meta,omitempty"`
	// A hint to display when the input hasn't been provided yet
	Hint string `json:"hint"`
}

All text that was typed after the command name is provided as input.

type Usage

type Usage struct {
	// The _meta property is reserved by ACP to allow clients and agents to attach additional
	// metadata to their interactions. Implementations MUST NOT make assumptions about values at
	// these keys.
	//
	// See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v1/draft/extensibility)
	Meta map[string]any `json:"_meta,omitempty"`
	// Total cache read tokens.
	CachedReadTokens *int `json:"cachedReadTokens,omitzero"`
	// Total cache write tokens.
	CachedWriteTokens *int `json:"cachedWriteTokens,omitzero"`
	// Total input tokens across all turns.
	InputTokens int `json:"inputTokens"`
	// Total output tokens across all turns.
	OutputTokens int `json:"outputTokens"`
	// Total thought/reasoning tokens
	ThoughtTokens *int `json:"thoughtTokens,omitzero"`
	// Sum of all token types across session.
	TotalTokens int `json:"totalTokens"`
}

**UNSTABLE**

This capability is not part of the spec yet, and may be removed or changed at any point.

Token usage information for a prompt turn.

type UsageUpdate

type UsageUpdate struct {
	// The _meta property is reserved by ACP to allow clients and agents to attach additional
	// metadata to their interactions. Implementations MUST NOT make assumptions about values at
	// these keys.
	//
	// See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v1/draft/extensibility)
	Meta map[string]any `json:"_meta,omitempty"`
	// Cumulative session cost (optional).
	Cost *Cost `json:"cost,omitzero"`
	// Total context window size in tokens.
	Size int `json:"size"`
	// Tokens currently in context.
	Used int `json:"used"`
}

Context window and cost update for a session.

type WaitForTerminalExitRequest

type WaitForTerminalExitRequest struct {
	// The _meta property is reserved by ACP to allow clients and agents to attach additional
	// metadata to their interactions. Implementations MUST NOT make assumptions about values at
	// these keys.
	//
	// See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v1/draft/extensibility)
	Meta map[string]any `json:"_meta,omitempty"`
	// The session ID for this request.
	SessionId SessionId `json:"sessionId"`
	// The ID of the terminal to wait for.
	TerminalId TerminalId `json:"terminalId"`
}

Request to wait for a terminal command to exit.

func (*WaitForTerminalExitRequest) Validate

func (v *WaitForTerminalExitRequest) Validate() error

type WaitForTerminalExitResponse

type WaitForTerminalExitResponse struct {
	// The _meta property is reserved by ACP to allow clients and agents to attach additional
	// metadata to their interactions. Implementations MUST NOT make assumptions about values at
	// these keys.
	//
	// See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v1/draft/extensibility)
	Meta map[string]any `json:"_meta,omitempty"`
	// The process exit code (may be null if terminated by signal).
	ExitCode *int `json:"exitCode,omitzero"`
	// The signal that terminated the process (may be null if exited normally).
	Signal *string `json:"signal,omitzero"`
}

Response containing the exit status of a terminal command.

func (*WaitForTerminalExitResponse) Validate

func (v *WaitForTerminalExitResponse) Validate() error

type WriteTextFileRequest

type WriteTextFileRequest struct {
	// The _meta property is reserved by ACP to allow clients and agents to attach additional
	// metadata to their interactions. Implementations MUST NOT make assumptions about values at
	// these keys.
	//
	// See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v1/draft/extensibility)
	Meta map[string]any `json:"_meta,omitempty"`
	// The text content to write to the file.
	Content string `json:"content"`
	// Absolute path to the file to write.
	Path string `json:"path"`
	// The session ID for this request.
	SessionId SessionId `json:"sessionId"`
}

Request to write content to a text file.

Only available if the client supports the 'fs.writeTextFile' capability.

func (*WriteTextFileRequest) Validate

func (v *WriteTextFileRequest) Validate() error

type WriteTextFileResponse

type WriteTextFileResponse struct {
	// The _meta property is reserved by ACP to allow clients and agents to attach additional
	// metadata to their interactions. Implementations MUST NOT make assumptions about values at
	// these keys.
	//
	// See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v1/draft/extensibility)
	Meta map[string]any `json:"_meta,omitempty"`
}

Response to 'fs/write_text_file'

func (*WriteTextFileResponse) Validate

func (v *WriteTextFileResponse) Validate() error

Directories

Path Synopsis
Package acptest drives an ACP agent from a test, one raw JSON line at a time, as a client that this repository did not write would.
Package acptest drives an ACP agent from a test, one raw JSON line at a time, as a client that this repository did not write would.
v2
Package acp implements the in-development v2 of the Agent Client Protocol.
Package acp implements the in-development v2 of the Agent Client Protocol.
acptest
Package acptest drives an ACP v2 agent from a test, one raw JSON line at a time, as a client that this repository did not write would.
Package acptest drives an ACP v2 agent from a test, one raw JSON line at a time, as a client that this repository did not write would.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
⌂ 换网址