Documentation
¶
Overview ¶
Package acp provides Go types and connection plumbing for the Agent Client Protocol (ACP). It contains generated dispatchers, outbound helpers, shared request/response types, and related utilities used by agents and clients to communicate over ACP.
Example (Agent) ¶
Example_agent wires the Agent to stdio so an external client can connect via this process' stdin/stdout.
package main
import (
"context"
"encoding/json"
"os"
)
// agentExample mirrors the go/example/agent flow in a compact form.
// It streams a short message, demonstrates a tool call + permission,
// then ends the turn.
type agentExample struct{ conn *AgentSideConnection }
var _ Agent = (*agentExample)(nil)
// SetSessionMode implements Agent.
func (a *agentExample) SetSessionMode(ctx context.Context, params SetSessionModeRequest) (SetSessionModeResponse, error) {
return SetSessionModeResponse{}, nil
}
// ListSessions implements Agent.
func (a *agentExample) ListSessions(ctx context.Context, params ListSessionsRequest) (ListSessionsResponse, error) {
return ListSessionsResponse{}, nil
}
// ResumeSession implements Agent.
func (a *agentExample) ResumeSession(ctx context.Context, params ResumeSessionRequest) (ResumeSessionResponse, error) {
return ResumeSessionResponse{}, nil
}
// CloseSession implements Agent.
func (a *agentExample) CloseSession(ctx context.Context, params CloseSessionRequest) (CloseSessionResponse, error) {
return CloseSessionResponse{}, nil
}
// DeleteSession implements Agent.
func (a *agentExample) DeleteSession(ctx context.Context, params DeleteSessionRequest) (DeleteSessionResponse, error) {
return DeleteSessionResponse{}, nil
}
// SetSessionConfigOption implements Agent.
func (a *agentExample) SetSessionConfigOption(ctx context.Context, params SetSessionConfigOptionRequest) (SetSessionConfigOptionResponse, error) {
return SetSessionConfigOptionResponse{}, nil
}
// Logout implements Agent.
func (a *agentExample) Logout(ctx context.Context, params LogoutRequest) (LogoutResponse, error) {
return LogoutResponse{}, nil
}
func (a *agentExample) SetAgentConnection(c *AgentSideConnection) { a.conn = c }
func (agentExample) Authenticate(ctx context.Context, _ AuthenticateRequest) (AuthenticateResponse, error) {
return AuthenticateResponse{}, nil
}
func (agentExample) Initialize(ctx context.Context, _ InitializeRequest) (InitializeResponse, error) {
return InitializeResponse{
ProtocolVersion: ProtocolVersionNumber,
AgentCapabilities: AgentCapabilities{LoadSession: false},
}, nil
}
func (agentExample) Cancel(ctx context.Context, _ CancelNotification) error { return nil }
func (agentExample) NewSession(ctx context.Context, _ NewSessionRequest) (NewSessionResponse, error) {
return NewSessionResponse{SessionId: SessionId("sess_demo")}, nil
}
func (a *agentExample) Prompt(ctx context.Context, p PromptRequest) (PromptResponse, error) {
// Stream an initial agent message.
_ = a.conn.SessionUpdate(ctx, SessionNotification{
SessionId: p.SessionId,
Update: UpdateAgentMessageText("I'll help you with that."),
})
// Announce a tool call.
_ = a.conn.SessionUpdate(ctx, SessionNotification{
SessionId: p.SessionId,
Update: StartToolCall(
ToolCallId("call_1"),
"Modifying configuration",
WithStartKind(ToolKindEdit),
WithStartStatus(ToolCallStatusPending),
WithStartLocations([]ToolCallLocation{{Path: "/project/config.json"}}),
WithStartRawInput(map[string]any{"path": "/project/config.json"}),
),
})
// Ask the client for permission to proceed with the change.
resp, _ := a.conn.RequestPermission(ctx, RequestPermissionRequest{
SessionId: p.SessionId,
ToolCall: ToolCallUpdate{
ToolCallId: ToolCallId("call_1"),
Title: PatchSet("Modifying configuration"),
Kind: PatchSet(ToolKindEdit),
Status: PatchSet(ToolCallStatusPending),
Locations: PatchSet([]ToolCallLocation{{Path: "/project/config.json"}}),
RawInput: PatchSet(json.RawMessage(`{"path":"/project/config.json"}`)),
},
Options: []PermissionOption{
{Kind: PermissionOptionKindAllowOnce, Name: "Allow", OptionId: PermissionOptionId("allow")},
{Kind: PermissionOptionKindRejectOnce, Name: "Reject", OptionId: PermissionOptionId("reject")},
},
})
if resp.Outcome.Selected != nil && string(resp.Outcome.Selected.OptionId) == "allow" {
// Mark tool call completed and stream a final message.
_ = a.conn.SessionUpdate(ctx, SessionNotification{
SessionId: p.SessionId,
Update: UpdateToolCall(
ToolCallId("call_1"),
WithUpdateStatus(ToolCallStatusCompleted),
WithUpdateRawOutput(map[string]any{"success": true}),
),
})
_ = a.conn.SessionUpdate(ctx, SessionNotification{
SessionId: p.SessionId,
Update: UpdateAgentMessageText("Done."),
})
}
return PromptResponse{StopReason: StopReasonEndTurn}, nil
}
// Example_agent wires the Agent to stdio so an external client
// can connect via this process' stdin/stdout.
func main() {
ag := &agentExample{}
asc := NewAgentSideConnection(ag, os.Stdout, os.Stdin)
ag.SetAgentConnection(asc)
// In a real program, block until the peer disconnects:
// <-asc.Done()
}
Output:
Example (Client) ¶
package main
import (
"context"
"fmt"
"os"
"os/exec"
"path/filepath"
"strings"
)
// clientExample mirrors go/example/client in a compact form: prints
// streamed updates, handles simple file ops, and picks the first
// permission option.
type clientExample struct{}
var _ Client = (*clientExample)(nil)
func (clientExample) RequestPermission(ctx context.Context, p RequestPermissionRequest) (RequestPermissionResponse, error) {
if len(p.Options) == 0 {
return RequestPermissionResponse{
Outcome: RequestPermissionOutcome{
Cancelled: &RequestPermissionOutcomeCancelled{},
},
}, nil
}
return RequestPermissionResponse{
Outcome: RequestPermissionOutcome{
Selected: &RequestPermissionOutcomeSelected{OptionId: p.Options[0].OptionId},
},
}, nil
}
func (clientExample) SessionUpdate(ctx context.Context, n SessionNotification) error {
u := n.Update
switch {
case u.AgentMessageChunk != nil:
c := u.AgentMessageChunk.Content
if c.Text != nil {
fmt.Print(c.Text.Text)
}
case u.ToolCall != nil:
title := u.ToolCall.Title
fmt.Printf("\n[tool] %s (%s)\n", title, u.ToolCall.Status)
case u.ToolCallUpdate != nil:
if status, ok := u.ToolCallUpdate.Status.Value(); ok {
fmt.Printf("\n[tool] %s -> %s\n", u.ToolCallUpdate.ToolCallId, status)
}
}
return nil
}
func (clientExample) WriteTextFile(ctx context.Context, p WriteTextFileRequest) (WriteTextFileResponse, error) {
if !filepath.IsAbs(p.Path) {
return WriteTextFileResponse{}, fmt.Errorf("path must be absolute: %s", p.Path)
}
if dir := filepath.Dir(p.Path); dir != "" {
_ = os.MkdirAll(dir, 0o755)
}
return WriteTextFileResponse{}, os.WriteFile(p.Path, []byte(p.Content), 0o644)
}
func (clientExample) ReadTextFile(ctx context.Context, p ReadTextFileRequest) (ReadTextFileResponse, error) {
if !filepath.IsAbs(p.Path) {
return ReadTextFileResponse{}, fmt.Errorf("path must be absolute: %s", p.Path)
}
b, err := os.ReadFile(p.Path)
if err != nil {
return ReadTextFileResponse{}, err
}
content := string(b)
if p.Line != nil || p.Limit != nil {
lines := strings.Split(content, "\n")
start := 0
if p.Line != nil && *p.Line > 0 {
start = int(min(*p.Line-1, int64(len(lines))))
}
end := len(lines)
if p.Limit != nil && *p.Limit > 0 {
end = start + int(min(*p.Limit, int64(end-start)))
}
content = strings.Join(lines[start:end], "\n")
}
return ReadTextFileResponse{Content: content}, nil
}
// Terminal interface implementations (minimal stubs for examples)
func (clientExample) CreateTerminal(ctx context.Context, p CreateTerminalRequest) (CreateTerminalResponse, error) {
// Return a dummy terminal id
return CreateTerminalResponse{TerminalId: "t-1"}, nil
}
func (clientExample) KillTerminal(ctx context.Context, p KillTerminalRequest) (KillTerminalResponse, error) {
return KillTerminalResponse{}, nil
}
func (clientExample) ReleaseTerminal(ctx context.Context, p ReleaseTerminalRequest) (ReleaseTerminalResponse, error) {
return ReleaseTerminalResponse{}, nil
}
func (clientExample) TerminalOutput(ctx context.Context, p TerminalOutputRequest) (TerminalOutputResponse, error) {
// Provide non-empty output to satisfy validation
return TerminalOutputResponse{Output: "ok", Truncated: false}, nil
}
func (clientExample) WaitForTerminalExit(ctx context.Context, p WaitForTerminalExitRequest) (WaitForTerminalExitResponse, error) {
return WaitForTerminalExitResponse{}, nil
}
// Example_client launches the Go agent example, negotiates protocol,
// opens a session, and sends a simple prompt.
// CreateElicitation answers as a client without elicitation support: it does
// not advertise the elicitation capability, so an agent should not ask.
func (clientExample) CreateElicitation(ctx context.Context, p CreateElicitationRequest) (CreateElicitationResponse, error) {
return CreateElicitationResponse{}, NewMethodNotFound(ClientMethodElicitationCreate)
}
func (clientExample) CompleteElicitation(ctx context.Context, p CompleteElicitationNotification) error {
return nil
}
func main() {
ctx := context.Background()
cmd := exec.Command("go", "run", "./example/agent")
stdin, _ := cmd.StdinPipe()
stdout, _ := cmd.StdoutPipe()
_ = cmd.Start()
conn := NewClientSideConnection(clientExample{}, stdin, stdout)
_, _ = conn.Initialize(ctx, InitializeRequest{
ProtocolVersion: ProtocolVersionNumber,
ClientCapabilities: ClientCapabilities{
Fs: FileSystemCapabilities{
ReadTextFile: true,
WriteTextFile: true,
},
Terminal: true,
},
})
sess, _ := conn.NewSession(ctx, NewSessionRequest{
Cwd: "/",
McpServers: []McpServer{},
})
_, _ = conn.Prompt(ctx, PromptRequest{
SessionId: sess.SessionId,
Prompt: []ContentBlock{TextBlock("Hello, agent!")},
})
_ = cmd.Process.Kill()
}
Output:
Example (Gemini) ¶
package main
import (
"context"
"fmt"
"os/exec"
)
// geminiClient mirrors go/example/gemini in brief: prints text chunks and
// selects the first permission option. File ops are no-ops here.
type geminiClient struct{}
var _ Client = (*geminiClient)(nil)
func (geminiClient) RequestPermission(ctx context.Context, p RequestPermissionRequest) (RequestPermissionResponse, error) {
if len(p.Options) == 0 {
return RequestPermissionResponse{Outcome: RequestPermissionOutcome{Cancelled: &RequestPermissionOutcomeCancelled{}}}, nil
}
return RequestPermissionResponse{Outcome: RequestPermissionOutcome{Selected: &RequestPermissionOutcomeSelected{OptionId: p.Options[0].OptionId}}}, nil
}
func (geminiClient) SessionUpdate(ctx context.Context, n SessionNotification) error {
if n.Update.AgentMessageChunk != nil {
c := n.Update.AgentMessageChunk.Content
if c.Text != nil {
fmt.Print(c.Text.Text)
}
}
return nil
}
func (geminiClient) ReadTextFile(ctx context.Context, _ ReadTextFileRequest) (ReadTextFileResponse, error) {
return ReadTextFileResponse{}, nil
}
func (geminiClient) WriteTextFile(ctx context.Context, _ WriteTextFileRequest) (WriteTextFileResponse, error) {
return WriteTextFileResponse{}, nil
}
// Terminal interface implementations (minimal stubs for examples)
func (geminiClient) CreateTerminal(ctx context.Context, p CreateTerminalRequest) (CreateTerminalResponse, error) {
return CreateTerminalResponse{TerminalId: "t-1"}, nil
}
func (geminiClient) KillTerminal(ctx context.Context, p KillTerminalRequest) (KillTerminalResponse, error) {
return KillTerminalResponse{}, nil
}
func (geminiClient) ReleaseTerminal(ctx context.Context, p ReleaseTerminalRequest) (ReleaseTerminalResponse, error) {
return ReleaseTerminalResponse{}, nil
}
func (geminiClient) TerminalOutput(ctx context.Context, p TerminalOutputRequest) (TerminalOutputResponse, error) {
return TerminalOutputResponse{Output: "ok", Truncated: false}, nil
}
func (geminiClient) WaitForTerminalExit(ctx context.Context, p WaitForTerminalExitRequest) (WaitForTerminalExitResponse, error) {
return WaitForTerminalExitResponse{}, nil
}
// Example_gemini connects to a Gemini CLI speaking ACP over stdio,
// then initializes, opens a session, and sends a prompt.
func (geminiClient) CreateElicitation(ctx context.Context, p CreateElicitationRequest) (CreateElicitationResponse, error) {
return CreateElicitationResponse{}, NewMethodNotFound(ClientMethodElicitationCreate)
}
func (geminiClient) CompleteElicitation(ctx context.Context, p CompleteElicitationNotification) error {
return nil
}
func main() {
ctx := context.Background()
cmd := exec.Command("gemini", "--experimental-acp")
stdin, _ := cmd.StdinPipe()
stdout, _ := cmd.StdoutPipe()
_ = cmd.Start()
conn := NewClientSideConnection(geminiClient{}, stdin, stdout)
_, _ = conn.Initialize(ctx, InitializeRequest{
ProtocolVersion: ProtocolVersionNumber,
ClientCapabilities: ClientCapabilities{
Fs: FileSystemCapabilities{
ReadTextFile: true,
WriteTextFile: true,
},
Terminal: true,
},
})
sess, _ := conn.NewSession(ctx, NewSessionRequest{
Cwd: "/",
McpServers: []McpServer{},
})
_, _ = conn.Prompt(ctx, PromptRequest{
SessionId: sess.SessionId,
Prompt: []ContentBlock{TextBlock("list files")},
})
}
Output:
Index ¶
- Constants
- Variables
- func Ptr[T any](v T) *T
- func SendRequest[T any](c *Connection, ctx context.Context, method string, params any) (T, error)
- type Agent
- type AgentAuthCapabilities
- type AgentCapabilities
- type AgentError
- type AgentLoader
- type AgentNotification
- type AgentRequest
- type AgentResponse
- type AgentResult
- type AgentSideConnection
- func (c *AgentSideConnection) CallExtension(ctx context.Context, method string, params any) (json.RawMessage, error)
- func (c *AgentSideConnection) CompleteElicitation(ctx context.Context, params CompleteElicitationNotification) error
- func (c *AgentSideConnection) CreateElicitation(ctx context.Context, params CreateElicitationRequest) (CreateElicitationResponse, error)
- func (c *AgentSideConnection) CreateTerminal(ctx context.Context, params CreateTerminalRequest) (CreateTerminalResponse, error)
- func (c *AgentSideConnection) Done() <-chan struct{}
- func (c *AgentSideConnection) KillTerminal(ctx context.Context, params KillTerminalRequest) (KillTerminalResponse, error)
- func (c *AgentSideConnection) NotifyExtension(ctx context.Context, method string, params any) error
- func (c *AgentSideConnection) ReadTextFile(ctx context.Context, params ReadTextFileRequest) (ReadTextFileResponse, error)
- func (c *AgentSideConnection) ReleaseTerminal(ctx context.Context, params ReleaseTerminalRequest) (ReleaseTerminalResponse, error)
- func (c *AgentSideConnection) RequestPermission(ctx context.Context, params RequestPermissionRequest) (RequestPermissionResponse, error)
- func (c *AgentSideConnection) SessionUpdate(ctx context.Context, params SessionNotification) error
- func (c *AgentSideConnection) SetLogger(l *slog.Logger)
- func (c *AgentSideConnection) TerminalOutput(ctx context.Context, params TerminalOutputRequest) (TerminalOutputResponse, error)
- func (c *AgentSideConnection) UnstableAuthStatusUpdate(ctx context.Context, params UnstableAuthStatusUpdateNotification) error
- func (c *AgentSideConnection) UnstableMessageMcp(ctx context.Context, params UnstableMessageMcpRequest) (UnstableMessageMcpResponse, error)
- func (c *AgentSideConnection) WaitForTerminalExit(ctx context.Context, params WaitForTerminalExitRequest) (WaitForTerminalExitResponse, error)
- func (c *AgentSideConnection) WriteTextFile(ctx context.Context, params WriteTextFileRequest) (WriteTextFileResponse, error)
- type AgentUnstableArchiveSession
- type AgentUnstableAuthStatus
- type AgentUnstableDisableProvider
- type AgentUnstableForkSession
- type AgentUnstableListProviders
- type AgentUnstableMessageMcp
- type AgentUnstableSessionOptions
- type AgentUnstableSessionStatus
- type AgentUnstableSetProvider
- type AgentUnstableSetSessionTitle
- type AgentUnstableUnarchiveSession
- type Annotations
- type AudioContent
- type AuthCapabilities
- type AuthMethod
- type AuthMethodAgent
- type AuthMethodId
- type AuthMethodTerminal
- type AuthMethodTerminalInline
- type AuthStatusCapabilities
- type AuthenticateRequest
- type AuthenticateResponse
- type AvailableCommand
- type AvailableCommandInput
- type AvailableCommandsUpdate
- type BlobResourceContents
- type BooleanConfigOptionCapabilities
- type BooleanPropertySchema
- type CancelNotification
- type CancelRequestNotification
- type Client
- type ClientCapabilities
- type ClientError
- type ClientNotification
- type ClientRequest
- type ClientResponse
- type ClientResult
- type ClientSessionCapabilities
- type ClientSideConnection
- func (c *ClientSideConnection) Authenticate(ctx context.Context, params AuthenticateRequest) (AuthenticateResponse, error)
- func (c *ClientSideConnection) CallExtension(ctx context.Context, method string, params any) (json.RawMessage, error)
- func (c *ClientSideConnection) Cancel(ctx context.Context, params CancelNotification) error
- func (c *ClientSideConnection) CloseSession(ctx context.Context, params CloseSessionRequest) (CloseSessionResponse, error)
- func (c *ClientSideConnection) DeleteSession(ctx context.Context, params DeleteSessionRequest) (DeleteSessionResponse, error)
- func (c *ClientSideConnection) Done() <-chan struct{}
- func (c *ClientSideConnection) Initialize(ctx context.Context, params InitializeRequest) (InitializeResponse, error)
- func (c *ClientSideConnection) ListSessions(ctx context.Context, params ListSessionsRequest) (ListSessionsResponse, error)
- func (c *ClientSideConnection) LoadSession(ctx context.Context, params LoadSessionRequest) (LoadSessionResponse, error)
- func (c *ClientSideConnection) Logout(ctx context.Context, params LogoutRequest) (LogoutResponse, error)
- func (c *ClientSideConnection) NewSession(ctx context.Context, params NewSessionRequest) (NewSessionResponse, error)
- func (c *ClientSideConnection) NotifyExtension(ctx context.Context, method string, params any) error
- func (c *ClientSideConnection) Prompt(ctx context.Context, params PromptRequest) (PromptResponse, error)
- func (c *ClientSideConnection) ResumeSession(ctx context.Context, params ResumeSessionRequest) (ResumeSessionResponse, error)
- func (c *ClientSideConnection) SetLogger(l *slog.Logger)
- func (c *ClientSideConnection) SetSessionConfigOption(ctx context.Context, params SetSessionConfigOptionRequest) (SetSessionConfigOptionResponse, error)
- func (c *ClientSideConnection) SetSessionMode(ctx context.Context, params SetSessionModeRequest) (SetSessionModeResponse, error)
- func (c *ClientSideConnection) UnstableArchiveSession(ctx context.Context, params UnstableArchiveSessionRequest) (UnstableArchiveSessionResponse, error)
- func (c *ClientSideConnection) UnstableAuthStatus(ctx context.Context, params UnstableAuthStatusRequest) (UnstableAuthStatusResponse, error)
- func (c *ClientSideConnection) UnstableDisableProvider(ctx context.Context, params UnstableDisableProviderRequest) (UnstableDisableProviderResponse, error)
- func (c *ClientSideConnection) UnstableForkSession(ctx context.Context, params UnstableForkSessionRequest) (UnstableForkSessionResponse, error)
- func (c *ClientSideConnection) UnstableListProviders(ctx context.Context, params UnstableListProvidersRequest) (UnstableListProvidersResponse, error)
- func (c *ClientSideConnection) UnstableMessageMcp(ctx context.Context, params UnstableMessageMcpNotification) error
- func (c *ClientSideConnection) UnstableSessionOptions(ctx context.Context, params UnstableSessionOptionsRequest) (UnstableSessionOptionsResponse, error)
- func (c *ClientSideConnection) UnstableSessionStatus(ctx context.Context, params UnstableSessionStatusRequest) (UnstableSessionStatusResponse, error)
- func (c *ClientSideConnection) UnstableSetProvider(ctx context.Context, params UnstableSetProviderRequest) (UnstableSetProviderResponse, error)
- func (c *ClientSideConnection) UnstableSetSessionTitle(ctx context.Context, params UnstableSetSessionTitleRequest) (UnstableSetSessionTitleResponse, error)
- func (c *ClientSideConnection) UnstableUnarchiveSession(ctx context.Context, params UnstableUnarchiveSessionRequest) (UnstableUnarchiveSessionResponse, error)
- type ClientUnstableAuthStatusUpdate
- type ClientUnstableMessageMcp
- type CloseSessionRequest
- type CloseSessionResponse
- type CompactionCapabilities
- type CompactionId
- type CompactionStatus
- type CompactionSummaryChunk
- type CompactionUpdate
- type CompleteElicitationNotification
- type ConfigOptionUpdate
- type Connection
- type Content
- type ContentBlock
- type ContentBlockAudio
- type ContentBlockImage
- type ContentBlockResource
- type ContentBlockResourceLink
- type ContentBlockText
- type ContentChunk
- type Cost
- type CreateElicitationAccept
- type CreateElicitationCancel
- type CreateElicitationDecline
- type CreateElicitationForm
- type CreateElicitationOther
- type CreateElicitationRequest
- type CreateElicitationResponse
- type CreateElicitationResponseOther
- type CreateElicitationUrl
- type CreateTerminalRequest
- type CreateTerminalResponse
- type CurrentModeUpdate
- type DeleteSessionRequest
- type DeleteSessionResponse
- type Diff
- type ElicitationAcceptAction
- type ElicitationCapabilities
- type ElicitationContentValue
- func NewElicitationContentValueBoolean(b bool) ElicitationContentValue
- func NewElicitationContentValueInteger(n int64) ElicitationContentValue
- func NewElicitationContentValueNumber(f float64) ElicitationContentValue
- func NewElicitationContentValueString(s string) ElicitationContentValue
- func NewElicitationContentValueStringArray(values ...string) ElicitationContentValue
- type ElicitationContentValueBoolean
- type ElicitationContentValueInteger
- type ElicitationContentValueNumber
- type ElicitationContentValueString
- type ElicitationContentValueStringArray
- type ElicitationFormCapabilities
- type ElicitationFormMode
- type ElicitationId
- type ElicitationPropertySchema
- type ElicitationPropertySchemaArray
- type ElicitationPropertySchemaBoolean
- type ElicitationPropertySchemaInteger
- type ElicitationPropertySchemaNumber
- type ElicitationPropertySchemaOther
- type ElicitationPropertySchemaString
- type ElicitationRequestScope
- type ElicitationSchema
- type ElicitationSchemaType
- type ElicitationSessionScope
- type ElicitationUrlCapabilities
- type ElicitationUrlMode
- type EmbeddedResource
- type EmbeddedResourceResource
- type EnumOption
- type EnvVariable
- type Error
- type ErrorCode
- type ErrorCodeAuthenticationRequired
- type ErrorCodeInternalError
- type ErrorCodeInvalidParams
- type ErrorCodeInvalidRequest
- type ErrorCodeMethodNotFound
- type ErrorCodeOther
- type ErrorCodeParseError
- type ErrorCodeRequestCancelled
- type ErrorCodeResourceNotFound
- type ErrorStopReason
- type ExtNotification
- type ExtRequest
- type ExtResponse
- type ExtensionMethodHandler
- type FileSystemCapabilities
- type HttpHeader
- type IdleStateUpdate
- type IdleStateUpdateCancelled
- type IdleStateUpdateEndTurn
- type IdleStateUpdateError
- type IdleStateUpdateMaxTokens
- type IdleStateUpdateMaxTurnRequests
- type IdleStateUpdateNone
- type IdleStateUpdateOther
- type IdleStateUpdateRefusal
- type ImageContent
- type Implementation
- type InitialSessionConfigOption
- type InitialSessionConfigOptionBoolean
- type InitialSessionConfigOptionValueId
- type InitializeRequest
- type InitializeResponse
- type IntegerPropertySchema
- type KillTerminalRequest
- type KillTerminalResponse
- type ListSessionsRequest
- type ListSessionsResponse
- type LoadSessionRequest
- type LoadSessionResponse
- type LogoutCapabilities
- type LogoutRequest
- type LogoutResponse
- type McpCapabilities
- type McpServer
- type McpServerAcp
- type McpServerAcpId
- type McpServerAcpInline
- type McpServerHttp
- type McpServerHttpInline
- type McpServerSse
- type McpServerSseInline
- type McpServerStdio
- type MessageId
- type Meta
- type MethodHandler
- type MultiSelectItems
- type MultiSelectItemsOther
- type MultiSelectItemsString
- type MultiSelectPropertySchema
- type NewSessionRequest
- type NewSessionResponse
- type Notice
- type NoticeCapabilities
- type NoticeSeverity
- type NumberPropertySchema
- type Patch
- type PermissionOption
- type PermissionOptionId
- type PermissionOptionKind
- type Plan
- type PlanCapabilities
- type PlanEntry
- type PlanEntryPriority
- type PlanEntryStatus
- type PlanId
- type PlanItems
- type PlanMarkdown
- type PlanRemoved
- type PlanUpdate
- type PlanUpdateContent
- type PlanUpdateContentItems
- type PlanUpdateContentMarkdown
- type PromptCapabilities
- type PromptRequest
- type PromptResponse
- type PromptSuggestion
- type PromptSuggestionsAudioCapabilities
- type PromptSuggestionsCapabilities
- type PromptSuggestionsEmbeddedContextCapabilities
- type PromptSuggestionsImageCapabilities
- type PromptSuggestionsUpdate
- type ProtocolVersion
- type ProvidersCapabilities
- type ReadTextFileRequest
- type ReadTextFileResponse
- type ReleaseTerminalRequest
- type ReleaseTerminalResponse
- type RequestError
- func NewAuthRequired(data any) *RequestError
- func NewInternalError(data any) *RequestError
- func NewInvalidParams(data any) *RequestError
- func NewInvalidRequest(data any) *RequestError
- func NewMethodNotFound(method string) *RequestError
- func NewParseError(data any) *RequestError
- func NewRequestCancelled(data any) *RequestError
- func NewRequestError(code int, message string, data any) *RequestError
- type RequestId
- type RequestIdNull
- type RequestIdNumber
- type RequestIdStr
- type RequestPermissionOutcome
- type RequestPermissionOutcomeCancelled
- type RequestPermissionOutcomeSelected
- type RequestPermissionRequest
- type RequestPermissionResponse
- type RequiresActionStateUpdate
- type ResourceLink
- type ResumeSessionRequest
- type ResumeSessionResponse
- type Role
- type RunningStateUpdate
- type SelectedPermissionOutcome
- type SessionAdditionalDirectoriesCapabilities
- type SessionArchiveCapabilities
- type SessionArchiveFilter
- type SessionAvailableCommandsUpdate
- type SessionCancelCapabilities
- type SessionCapabilities
- type SessionCloseCapabilities
- type SessionCompactionUpdate
- type SessionConfigBoolean
- type SessionConfigGroupId
- type SessionConfigId
- type SessionConfigOption
- type SessionConfigOptionBoolean
- type SessionConfigOptionCategory
- type SessionConfigOptionSelect
- type SessionConfigOptionUpdate
- type SessionConfigOptionsCapabilities
- type SessionConfigSelect
- type SessionConfigSelectGroup
- type SessionConfigSelectOption
- type SessionConfigSelectOptions
- type SessionConfigSelectOptionsGrouped
- type SessionConfigSelectOptionsUngrouped
- type SessionConfigValueId
- type SessionCurrentModeUpdate
- type SessionDeleteCapabilities
- type SessionForkCapabilities
- type SessionId
- type SessionInfo
- type SessionInfoUpdate
- type SessionListCapabilities
- type SessionMessage
- type SessionMessageChunk
- type SessionMode
- type SessionModeId
- type SessionModeState
- type SessionNotification
- type SessionOptionsCapabilities
- type SessionPlanUpdate
- type SessionPromptSuggestionsUpdate
- type SessionReference
- type SessionResumeCapabilities
- type SessionSessionInfoUpdate
- type SessionStatusCapabilities
- type SessionSubagentUpdate
- type SessionSystemPromptCapabilities
- type SessionSystemPromptModeCapabilities
- type SessionSystemPromptOverrideCapabilities
- type SessionTitleCapabilities
- type SessionToolCallUpdate
- type SessionUpdate
- func StartEditToolCall(id ToolCallId, title string, path string, content any, ...) SessionUpdate
- func StartReadToolCall(id ToolCallId, title string, path string, opts ...ToolCallStartOpt) SessionUpdate
- func StartToolCall(id ToolCallId, title string, opts ...ToolCallStartOpt) SessionUpdate
- func UpdateAgentMessage(content ContentBlock) SessionUpdate
- func UpdateAgentMessageText(text string) SessionUpdate
- func UpdateAgentThought(content ContentBlock) SessionUpdate
- func UpdateAgentThoughtText(text string) SessionUpdate
- func UpdatePlan(entries ...PlanEntry) SessionUpdate
- func UpdateToolCall(id ToolCallId, opts ...ToolCallUpdateOpt) SessionUpdate
- func UpdateUserMessage(content ContentBlock) SessionUpdate
- func UpdateUserMessageText(text string) SessionUpdate
- type SessionUpdateAgentMessageChunk
- type SessionUpdateAgentThoughtChunk
- type SessionUpdateCompactionSummaryChunk
- type SessionUpdateNotice
- type SessionUpdatePlan
- type SessionUpdatePlanRemoved
- type SessionUpdateSessionMessage
- type SessionUpdateSessionMessageChunk
- type SessionUpdateToolCall
- type SessionUpdateUserMessageChunk
- type SessionUsageUpdate
- type SetSessionConfigOptionBoolean
- type SetSessionConfigOptionRequest
- type SetSessionConfigOptionResponse
- type SetSessionConfigOptionValueId
- type SetSessionModeRequest
- type SetSessionModeResponse
- type StateUpdate
- type StateUpdateIdle
- type StateUpdateIdleCancelled
- type StateUpdateIdleEndTurn
- type StateUpdateIdleError
- type StateUpdateIdleMaxTokens
- type StateUpdateIdleMaxTurnRequests
- type StateUpdateIdleNone
- type StateUpdateIdleOther
- type StateUpdateIdleRefusal
- type StateUpdateOther
- type StateUpdateRequiresAction
- type StateUpdateRunning
- type StateUpdateUnknown
- type StopReason
- type StringFormat
- type StringMultiSelectItems
- type StringPropertySchema
- type SubagentCapabilities
- type SubagentSessionCapabilities
- type SubagentUpdate
- type SystemPrompt
- type SystemPromptMode
- type Terminal
- type TerminalExitStatus
- type TerminalId
- type TerminalOutputRequest
- type TerminalOutputResponse
- type TextContent
- type TextResourceContents
- type TitledMultiSelectItems
- type ToolCall
- type ToolCallContent
- type ToolCallContentContent
- type ToolCallContentDiff
- type ToolCallContentSession
- type ToolCallContentTerminal
- type ToolCallId
- type ToolCallLocation
- type ToolCallStartOpt
- func WithStartContent(c []ToolCallContent) ToolCallStartOpt
- func WithStartKind(k ToolKind) ToolCallStartOpt
- func WithStartLocations(l []ToolCallLocation) ToolCallStartOpt
- func WithStartName(n string) ToolCallStartOpt
- func WithStartRawInput(v any) ToolCallStartOpt
- func WithStartRawOutput(v any) ToolCallStartOpt
- func WithStartStatus(s ToolCallStatus) ToolCallStartOpt
- type ToolCallStatus
- type ToolCallUpdate
- type ToolCallUpdateOpt
- func WithUpdateContent(c []ToolCallContent) ToolCallUpdateOpt
- func WithUpdateKind(k ToolKind) ToolCallUpdateOpt
- func WithUpdateLocations(l []ToolCallLocation) ToolCallUpdateOpt
- func WithUpdateName(n string) ToolCallUpdateOpt
- func WithUpdateRawInput(v any) ToolCallUpdateOpt
- func WithUpdateRawOutput(v any) ToolCallUpdateOpt
- func WithUpdateStatus(s ToolCallStatus) ToolCallUpdateOpt
- func WithUpdateTitle(t string) ToolCallUpdateOpt
- type ToolKind
- type UnknownStateUpdate
- type UnstableArchiveSessionRequest
- type UnstableArchiveSessionResponse
- type UnstableAuthAccount
- type UnstableAuthState
- type UnstableAuthStatusRequest
- type UnstableAuthStatusResponse
- type UnstableAuthStatusUpdateNotification
- type UnstableDisableProviderRequest
- type UnstableDisableProviderResponse
- type UnstableForkSessionRequest
- type UnstableForkSessionResponse
- type UnstableListProvidersRequest
- type UnstableListProvidersResponse
- type UnstableLlmProtocol
- type UnstableMcpError
- type UnstableMcpRequestId
- type UnstableMessageMcpError
- type UnstableMessageMcpNotification
- type UnstableMessageMcpRequest
- type UnstableMessageMcpResponse
- type UnstableMessageMcpResult
- type UnstableProviderCurrentConfig
- type UnstableProviderId
- type UnstableProviderInfo
- type UnstableSessionOptionsRequest
- type UnstableSessionOptionsResponse
- type UnstableSessionStatus
- type UnstableSessionStatusRequest
- type UnstableSessionStatusResponse
- type UnstableSetProviderRequest
- type UnstableSetProviderResponse
- type UnstableSetSessionTitleRequest
- type UnstableSetSessionTitleResponse
- type UnstableUnarchiveSessionRequest
- type UnstableUnarchiveSessionResponse
- type UnstructuredCommandInput
- type Usage
- type UsageUpdate
- type WaitForTerminalExitRequest
- type WaitForTerminalExitResponse
- type WriteTextFileRequest
- type WriteTextFileResponse
Examples ¶
Constants ¶
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
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
const (
ProtocolMethodCancelRequest = "$/cancel_request"
)
Protocol method names, which either side can send
const ProtocolVersionNumber = 1
ProtocolVersionNumber is the ACP protocol version supported by this SDK.
const SchemaVersion = "1.32.0"
SchemaVersion is the ACP schema release that this SDK's generated code targets.
Variables ¶
var ErrMetaKeyNotFound = errors.New("acp: no such _meta key")
ErrMetaKeyNotFound is the error that Meta.Get wraps when the Meta has no value under the key. Test for it with errors.Is.
Functions ¶
func SendRequest ¶
SendRequest sends a JSON-RPC request and returns a typed result. For methods that do not return a result, use SendRequestNoResult instead.
SendRequest returns after the handlers of all notifications that arrived before the response have returned. A notification handler that makes a request on the same connection must pass its own ctx, or a ctx derived from it. While the handler runs, such a request waits only for the notifications before the handler's own. With any other ctx, such as context.Background(), the request waits for the handler that made it, so it returns only when ctx ends or the peer disconnects. The shorter wait applies to every goroutine that uses the handler's ctx while the handler runs: a goroutine that the handler starts and that needs the full wait must get a ctx that does not derive from the handler's ctx.
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/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/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/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)
}
Agent is the interface that every agent implements. Its methods are the stable agent methods of ACP schema 1.25.0. Every other agent method has its own optional interface, so a schema release never adds a method to Agent.
type AgentAuthCapabilities ¶ added in v0.11.7
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 Meta `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,omitempty"`
// **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,omitempty"`
}
Authentication-related capabilities supported by the agent.
func (*AgentAuthCapabilities) UnmarshalJSON ¶ added in v0.14.0
func (v *AgentAuthCapabilities) UnmarshalJSON(b []byte) error
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 Meta `json:"_meta,omitempty"`
// Authentication-related capabilities supported by the agent.
//
// Defaults to {} if unset.
Auth AgentAuthCapabilities `json:"auth,omitempty"`
// Whether the agent supports 'session/load'.
//
// Defaults to false if unset.
LoadSession bool `json:"loadSession,omitempty"`
// MCP capabilities supported by the agent.
//
// Defaults to {"acp":false,"http":false,"sse":false} if unset.
McpCapabilities McpCapabilities `json:"mcpCapabilities,omitempty"`
// Prompt capabilities supported by the agent.
//
// Defaults to {"audio":false,"embeddedContext":false,"image":false} if unset.
PromptCapabilities PromptCapabilities `json:"promptCapabilities,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.
//
// Optional. Omitted or 'null' both mean the agent does not advertise support.
// Supplying '{}' means the agent supports provider configuration methods.
Providers *ProvidersCapabilities `json:"providers,omitempty"`
// Session lifecycle and prompt capabilities advertised by the agent.
//
// Defaults to {} if unset.
SessionCapabilities SessionCapabilities `json:"sessionCapabilities,omitempty"`
}
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) MarshalJSON ¶
func (v AgentCapabilities) MarshalJSON() ([]byte, error)
func (*AgentCapabilities) UnmarshalJSON ¶
func (v *AgentCapabilities) UnmarshalJSON(b []byte) error
type AgentError ¶ added in v0.10.8
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 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 is the optional interface for the agent method "session/load". When the agent does not implement it, AgentSideConnection answers "session/load" with -32601 (method not found).
type AgentNotification ¶
type AgentNotification struct {
// The notification method name.
Method string `json:"method"`
// Method-specific notification parameters.
Params json.RawMessage `json:"params,omitempty"`
}
A JSON-RPC notification object.
func (*AgentNotification) Validate ¶ added in v0.10.8
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 json.RawMessage `json:"params,omitempty"`
}
A JSON-RPC request object.
func (*AgentRequest) Validate ¶ added in v0.10.8
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) MarshalJSON ¶
func (u AgentResponse) MarshalJSON() ([]byte, error)
func (*AgentResponse) UnmarshalJSON ¶
func (u *AgentResponse) UnmarshalJSON(b []byte) error
type AgentResult ¶ added in v0.10.8
type AgentResult struct {
// The id of the request this response answers.
Id RequestId `json:"id"`
// Method-specific response data.
Result json.RawMessage `json:"result"`
}
A JSON-RPC response object. A successful JSON-RPC response.
type AgentSideConnection ¶
type AgentSideConnection struct {
// contains filtered or unexported fields
}
AgentSideConnection represents the agent's view of a connection to a client.
func NewAgentSideConnection ¶
func NewAgentSideConnection(agent Agent, peerInput io.Writer, peerOutput io.Reader) *AgentSideConnection
NewAgentSideConnection creates a new agent-side connection bound to the provided Agent implementation.
func (*AgentSideConnection) CallExtension ¶ added in v0.10.8
func (c *AgentSideConnection) CallExtension(ctx context.Context, method string, params any) (json.RawMessage, error)
CallExtension sends an ACP extension-method request (method names starting with "_") from an agent to its client.
func (*AgentSideConnection) CompleteElicitation ¶ added in v0.16.0
func (c *AgentSideConnection) CompleteElicitation(ctx context.Context, params CompleteElicitationNotification) error
func (*AgentSideConnection) CreateElicitation ¶ added in v0.16.0
func (c *AgentSideConnection) CreateElicitation(ctx context.Context, params CreateElicitationRequest) (CreateElicitationResponse, error)
func (*AgentSideConnection) CreateTerminal ¶
func (c *AgentSideConnection) CreateTerminal(ctx context.Context, params CreateTerminalRequest) (CreateTerminalResponse, error)
func (*AgentSideConnection) Done ¶
func (c *AgentSideConnection) Done() <-chan struct{}
Done exposes a channel that closes when the peer disconnects.
func (*AgentSideConnection) KillTerminal ¶ added in v0.11.7
func (c *AgentSideConnection) KillTerminal(ctx context.Context, params KillTerminalRequest) (KillTerminalResponse, error)
func (*AgentSideConnection) NotifyExtension ¶ added in v0.10.8
NotifyExtension sends an ACP extension-method notification (method names starting with "_") from an agent to its client.
func (*AgentSideConnection) ReadTextFile ¶
func (c *AgentSideConnection) ReadTextFile(ctx context.Context, params ReadTextFileRequest) (ReadTextFileResponse, error)
func (*AgentSideConnection) ReleaseTerminal ¶
func (c *AgentSideConnection) ReleaseTerminal(ctx context.Context, params ReleaseTerminalRequest) (ReleaseTerminalResponse, error)
func (*AgentSideConnection) RequestPermission ¶
func (c *AgentSideConnection) RequestPermission(ctx context.Context, params RequestPermissionRequest) (RequestPermissionResponse, error)
func (*AgentSideConnection) SessionUpdate ¶
func (c *AgentSideConnection) SessionUpdate(ctx context.Context, params SessionNotification) error
func (*AgentSideConnection) SetLogger ¶
func (c *AgentSideConnection) SetLogger(l *slog.Logger)
SetLogger directs connection diagnostics to the provided logger.
func (*AgentSideConnection) TerminalOutput ¶
func (c *AgentSideConnection) TerminalOutput(ctx context.Context, params TerminalOutputRequest) (TerminalOutputResponse, error)
func (*AgentSideConnection) UnstableAuthStatusUpdate ¶ added in v0.18.0
func (c *AgentSideConnection) UnstableAuthStatusUpdate(ctx context.Context, params UnstableAuthStatusUpdateNotification) error
func (*AgentSideConnection) UnstableMessageMcp ¶ added in v0.17.0
func (c *AgentSideConnection) UnstableMessageMcp(ctx context.Context, params UnstableMessageMcpRequest) (UnstableMessageMcpResponse, error)
func (*AgentSideConnection) WaitForTerminalExit ¶
func (c *AgentSideConnection) WaitForTerminalExit(ctx context.Context, params WaitForTerminalExitRequest) (WaitForTerminalExitResponse, error)
func (*AgentSideConnection) WriteTextFile ¶
func (c *AgentSideConnection) WriteTextFile(ctx context.Context, params WriteTextFileRequest) (WriteTextFileResponse, error)
type AgentUnstableArchiveSession ¶ added in v0.18.0
type AgentUnstableArchiveSession interface {
// **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)
}
AgentUnstableArchiveSession is the optional interface for the agent method "session/archive". When the agent does not implement it, AgentSideConnection answers "session/archive" with -32601 (method not found).
type AgentUnstableAuthStatus ¶ added in v0.18.0
type AgentUnstableAuthStatus 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)
}
AgentUnstableAuthStatus is the optional interface for the agent method "auth/status". When the agent does not implement it, AgentSideConnection answers "auth/status" with -32601 (method not found).
type AgentUnstableDisableProvider ¶ added in v0.18.0
type AgentUnstableDisableProvider interface {
// **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)
}
AgentUnstableDisableProvider is the optional interface for the agent method "providers/disable". When the agent does not implement it, AgentSideConnection answers "providers/disable" with -32601 (method not found).
type AgentUnstableForkSession ¶ added in v0.18.0
type AgentUnstableForkSession interface {
// **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)
}
AgentUnstableForkSession is the optional interface for the agent method "session/fork". When the agent does not implement it, AgentSideConnection answers "session/fork" with -32601 (method not found).
type AgentUnstableListProviders ¶ added in v0.18.0
type AgentUnstableListProviders interface {
// **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)
}
AgentUnstableListProviders is the optional interface for the agent method "providers/list". When the agent does not implement it, AgentSideConnection answers "providers/list" with -32601 (method not found).
type AgentUnstableMessageMcp ¶ added in v0.18.0
type AgentUnstableMessageMcp interface {
// **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
}
AgentUnstableMessageMcp is the optional interface for the agent method "mcp/message". When the agent does not implement it, AgentSideConnection drops "mcp/message" and logs a -32601 (method not found) error.
type AgentUnstableSessionOptions ¶ added in v0.18.0
type AgentUnstableSessionOptions interface {
// **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. Agents MAY start their runtime to resolve
// the options. The rules above still hold for it.
UnstableSessionOptions(ctx context.Context, params UnstableSessionOptionsRequest) (UnstableSessionOptionsResponse, error)
}
AgentUnstableSessionOptions is the optional interface for the agent method "session/options". When the agent does not implement it, AgentSideConnection answers "session/options" with -32601 (method not found).
type AgentUnstableSessionStatus ¶ added in v0.18.0
type AgentUnstableSessionStatus interface {
// **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)
}
AgentUnstableSessionStatus is the optional interface for the agent method "session/status". When the agent does not implement it, AgentSideConnection answers "session/status" with -32601 (method not found).
type AgentUnstableSetProvider ¶ added in v0.18.0
type AgentUnstableSetProvider interface {
// **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)
}
AgentUnstableSetProvider is the optional interface for the agent method "providers/set". When the agent does not implement it, AgentSideConnection answers "providers/set" with -32601 (method not found).
type AgentUnstableSetSessionTitle ¶ added in v0.18.0
type AgentUnstableSetSessionTitle interface {
// **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)
}
AgentUnstableSetSessionTitle is the optional interface for the agent method "session/set_title". When the agent does not implement it, AgentSideConnection answers "session/set_title" with -32601 (method not found).
type AgentUnstableUnarchiveSession ¶ added in v0.18.0
type AgentUnstableUnarchiveSession interface {
// **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)
}
AgentUnstableUnarchiveSession is the optional interface for the agent method "session/unarchive". When the agent does not implement it, AgentSideConnection answers "session/unarchive" with -32601 (method not found).
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/extensibility)
Meta Meta `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,omitempty"`
// Relative importance of this content when clients choose what to surface.
Priority *float64 `json:"priority,omitempty"`
}
Optional annotations for the client. The client can use annotations to inform how objects are used or displayed
func (*Annotations) UnmarshalJSON ¶ added in v0.14.0
func (v *Annotations) UnmarshalJSON(b []byte) error
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/extensibility)
Meta Meta `json:"_meta,omitempty"`
// Optional annotations that help clients decide how to display or route this content.
Annotations *Annotations `json:"annotations,omitempty"`
// 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.
func (*AudioContent) UnmarshalJSON ¶ added in v0.14.0
func (v *AudioContent) UnmarshalJSON(b []byte) error
type AuthCapabilities ¶ added in v0.11.7
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/extensibility)
Meta Meta `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,omitempty"`
}
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) MarshalJSON ¶ added in v0.11.7
func (v AuthCapabilities) MarshalJSON() ([]byte, error)
func (*AuthCapabilities) UnmarshalJSON ¶ added in v0.11.7
func (v *AuthCapabilities) UnmarshalJSON(b []byte) 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) MarshalJSON ¶ added in v0.11.7
func (u AuthMethod) MarshalJSON() ([]byte, error)
func (*AuthMethod) UnmarshalJSON ¶ added in v0.11.7
func (u *AuthMethod) UnmarshalJSON(b []byte) error
type AuthMethodAgent ¶ added in v0.11.7
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/extensibility)
Meta Meta `json:"_meta,omitempty"`
// Optional human-readable description of this authentication method.
Description *string `json:"description,omitempty"`
// 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.
func (*AuthMethodAgent) UnmarshalJSON ¶ added in v0.15.0
func (v *AuthMethodAgent) UnmarshalJSON(b []byte) error
type AuthMethodId ¶
type AuthMethodId string
Typed identifier used for auth method values on the wire.
type AuthMethodTerminal ¶ added in v0.11.7
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/extensibility)
Meta Meta `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,omitempty"`
// 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]string `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'.
func (*AuthMethodTerminal) UnmarshalJSON ¶ added in v0.15.0
func (v *AuthMethodTerminal) UnmarshalJSON(b []byte) error
type AuthMethodTerminalInline ¶ added in v0.11.7
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/extensibility)
Meta Meta `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,omitempty"`
// 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]string `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'.
func (*AuthMethodTerminalInline) UnmarshalJSON ¶ added in v0.15.0
func (v *AuthMethodTerminalInline) UnmarshalJSON(b []byte) error
type AuthStatusCapabilities ¶ added in v0.18.0
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 Meta `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.
func (*AuthStatusCapabilities) UnmarshalJSON ¶ added in v0.18.0
func (v *AuthStatusCapabilities) UnmarshalJSON(b []byte) error
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/extensibility)
Meta Meta `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) UnmarshalJSON ¶ added in v0.15.0
func (v *AuthenticateRequest) UnmarshalJSON(b []byte) error
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/extensibility)
Meta Meta `json:"_meta,omitempty"`
}
Response to the 'authenticate' method.
func (*AuthenticateResponse) UnmarshalJSON ¶ added in v0.15.0
func (v *AuthenticateResponse) UnmarshalJSON(b []byte) error
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/extensibility)
Meta Meta `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,omitempty"`
// Command name (e.g., 'create_plan', 'research_codebase').
Name string `json:"name"`
}
Information about a command.
func (*AvailableCommand) UnmarshalJSON ¶ added in v0.14.0
func (v *AvailableCommand) UnmarshalJSON(b []byte) error
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) MarshalJSON ¶
func (u AvailableCommandInput) MarshalJSON() ([]byte, error)
func (*AvailableCommandInput) UnmarshalJSON ¶
func (u *AvailableCommandInput) UnmarshalJSON(b []byte) error
type AvailableCommandsUpdate ¶ added in v0.10.8
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/extensibility)
Meta Meta `json:"_meta,omitempty"`
// Commands the agent can execute
AvailableCommands []AvailableCommand `json:"availableCommands"`
}
Available commands are ready or have changed
func (AvailableCommandsUpdate) MarshalJSON ¶ added in v0.14.0
func (v AvailableCommandsUpdate) MarshalJSON() ([]byte, error)
func (*AvailableCommandsUpdate) UnmarshalJSON ¶ added in v0.14.0
func (v *AvailableCommandsUpdate) UnmarshalJSON(b []byte) error
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/extensibility)
Meta Meta `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,omitempty"`
// URI associated with this resource or media payload.
Uri string `json:"uri"`
}
Binary resource contents.
func (*BlobResourceContents) UnmarshalJSON ¶ added in v0.15.0
func (v *BlobResourceContents) UnmarshalJSON(b []byte) error
type BooleanConfigOptionCapabilities ¶ added in v0.15.0
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/extensibility)
Meta Meta `json:"_meta,omitempty"`
}
Capabilities for boolean session configuration options.
Supplying '{}' means the client supports boolean session configuration options.
func (*BooleanConfigOptionCapabilities) UnmarshalJSON ¶ added in v0.15.0
func (v *BooleanConfigOptionCapabilities) UnmarshalJSON(b []byte) error
type BooleanPropertySchema ¶ added in v0.16.0
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 Meta `json:"_meta,omitempty"`
// Default value.
//
// Optional. Omitted and 'null' are equivalent and mean no default value is provided.
Default *bool `json:"default,omitempty"`
// Human-readable description.
//
// Optional. Omitted and 'null' are equivalent and mean no description is provided.
Description *string `json:"description,omitempty"`
// Optional title for the property.
//
// Optional. Omitted and 'null' are equivalent and mean no title is provided.
Title *string `json:"title,omitempty"`
}
Schema for boolean properties in an elicitation form.
func (*BooleanPropertySchema) UnmarshalJSON ¶ added in v0.16.0
func (v *BooleanPropertySchema) UnmarshalJSON(b []byte) error
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/extensibility)
Meta Meta `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/prompt-turn#cancellation)
func (*CancelNotification) UnmarshalJSON ¶ added in v0.15.0
func (v *CancelNotification) UnmarshalJSON(b []byte) error
func (*CancelNotification) Validate ¶
func (v *CancelNotification) Validate() error
type CancelRequestNotification ¶ added in v0.15.0
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/extensibility)
Meta Meta `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/cancellation)
func (*CancelRequestNotification) UnmarshalJSON ¶ added in v0.15.0
func (v *CancelRequestNotification) UnmarshalJSON(b []byte) error
func (*CancelRequestNotification) Validate ¶ added in v0.15.0
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/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/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)
}
Client is the interface that every client implements. Its methods are the stable client methods of ACP schema 1.25.0. Every other client method has its own optional interface, so a schema release never adds a method to Client.
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 Meta `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,omitempty"`
// 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,omitempty"`
// 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,omitempty"`
// **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,omitempty"`
// 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,omitempty"`
// **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,omitempty"`
// Whether the Client support all 'terminal/*' methods.
//
// Defaults to false if unset.
Terminal bool `json:"terminal,omitempty"`
}
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) MarshalJSON ¶
func (v ClientCapabilities) MarshalJSON() ([]byte, error)
func (*ClientCapabilities) UnmarshalJSON ¶
func (v *ClientCapabilities) UnmarshalJSON(b []byte) error
type ClientError ¶ added in v0.10.8
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 ClientNotification ¶
type ClientNotification struct {
// The notification method name.
Method string `json:"method"`
// Method-specific notification parameters.
Params json.RawMessage `json:"params,omitempty"`
}
A JSON-RPC notification object.
func (*ClientNotification) Validate ¶ added in v0.10.8
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 json.RawMessage `json:"params,omitempty"`
}
A JSON-RPC request object.
func (*ClientRequest) Validate ¶ added in v0.10.8
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) MarshalJSON ¶
func (u ClientResponse) MarshalJSON() ([]byte, error)
func (*ClientResponse) UnmarshalJSON ¶
func (u *ClientResponse) UnmarshalJSON(b []byte) error
type ClientResult ¶ added in v0.10.8
type ClientResult struct {
// The id of the request this response answers.
Id RequestId `json:"id"`
// Method-specific response data.
Result json.RawMessage `json:"result"`
}
A JSON-RPC response object. A successful JSON-RPC response.
type ClientSessionCapabilities ¶ added in v0.15.0
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 Meta `json:"_meta,omitempty"`
// Support for ID-addressed context compaction updates. Omitted or 'null'
// means unsupported. '{}' advertises the complete compaction contract.
Compaction *CompactionCapabilities `json:"compaction,omitempty"`
// 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,omitempty"`
// 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,omitempty"`
// **UNSTABLE**
//
// This capability is not part of the spec yet, and may be removed or changed at any point.
//
// Support for 'prompt_suggestions_update' session updates.
//
// Optional. Omitted or 'null' both mean the client does not advertise support.
// Supplying '{}' means the client can offer prompt suggestions made of
// 'text' and 'resource_link' content blocks.
PromptSuggestions *PromptSuggestionsCapabilities `json:"promptSuggestions,omitempty"`
}
Session-related capabilities supported by the client.
func (*ClientSessionCapabilities) UnmarshalJSON ¶ added in v0.15.0
func (v *ClientSessionCapabilities) UnmarshalJSON(b []byte) error
type ClientSideConnection ¶
type ClientSideConnection struct {
// contains filtered or unexported fields
}
ClientSideConnection provides the client's view of the connection and implements Agent calls.
func NewClientSideConnection ¶
func NewClientSideConnection(client Client, peerInput io.Writer, peerOutput io.Reader) *ClientSideConnection
NewClientSideConnection creates a new client-side connection bound to the provided Client implementation.
func (*ClientSideConnection) Authenticate ¶
func (c *ClientSideConnection) Authenticate(ctx context.Context, params AuthenticateRequest) (AuthenticateResponse, error)
func (*ClientSideConnection) CallExtension ¶ added in v0.10.8
func (c *ClientSideConnection) CallExtension(ctx context.Context, method string, params any) (json.RawMessage, error)
CallExtension sends an ACP extension-method request (method names starting with "_") from a client to its agent.
func (*ClientSideConnection) Cancel ¶
func (c *ClientSideConnection) Cancel(ctx context.Context, params CancelNotification) error
func (*ClientSideConnection) CloseSession ¶ added in v0.12.2
func (c *ClientSideConnection) CloseSession(ctx context.Context, params CloseSessionRequest) (CloseSessionResponse, error)
func (*ClientSideConnection) DeleteSession ¶ added in v0.14.0
func (c *ClientSideConnection) DeleteSession(ctx context.Context, params DeleteSessionRequest) (DeleteSessionResponse, error)
func (*ClientSideConnection) Done ¶
func (c *ClientSideConnection) Done() <-chan struct{}
Done exposes a channel that closes when the peer disconnects.
func (*ClientSideConnection) Initialize ¶
func (c *ClientSideConnection) Initialize(ctx context.Context, params InitializeRequest) (InitializeResponse, error)
func (*ClientSideConnection) ListSessions ¶ added in v0.11.7
func (c *ClientSideConnection) ListSessions(ctx context.Context, params ListSessionsRequest) (ListSessionsResponse, error)
func (*ClientSideConnection) LoadSession ¶
func (c *ClientSideConnection) LoadSession(ctx context.Context, params LoadSessionRequest) (LoadSessionResponse, error)
func (*ClientSideConnection) Logout ¶ added in v0.13.4
func (c *ClientSideConnection) Logout(ctx context.Context, params LogoutRequest) (LogoutResponse, error)
func (*ClientSideConnection) NewSession ¶
func (c *ClientSideConnection) NewSession(ctx context.Context, params NewSessionRequest) (NewSessionResponse, error)
func (*ClientSideConnection) NotifyExtension ¶ added in v0.10.8
func (c *ClientSideConnection) NotifyExtension(ctx context.Context, method string, params any) error
NotifyExtension sends an ACP extension-method notification (method names starting with "_") from a client to its agent.
func (*ClientSideConnection) Prompt ¶
func (c *ClientSideConnection) Prompt(ctx context.Context, params PromptRequest) (PromptResponse, error)
func (*ClientSideConnection) ResumeSession ¶ added in v0.12.2
func (c *ClientSideConnection) ResumeSession(ctx context.Context, params ResumeSessionRequest) (ResumeSessionResponse, error)
func (*ClientSideConnection) SetLogger ¶
func (c *ClientSideConnection) SetLogger(l *slog.Logger)
SetLogger directs connection diagnostics to the provided logger.
func (*ClientSideConnection) SetSessionConfigOption ¶ added in v0.10.8
func (c *ClientSideConnection) SetSessionConfigOption(ctx context.Context, params SetSessionConfigOptionRequest) (SetSessionConfigOptionResponse, error)
func (*ClientSideConnection) SetSessionMode ¶
func (c *ClientSideConnection) SetSessionMode(ctx context.Context, params SetSessionModeRequest) (SetSessionModeResponse, error)
func (*ClientSideConnection) UnstableArchiveSession ¶ added in v0.18.0
func (c *ClientSideConnection) UnstableArchiveSession(ctx context.Context, params UnstableArchiveSessionRequest) (UnstableArchiveSessionResponse, error)
func (*ClientSideConnection) UnstableAuthStatus ¶ added in v0.18.0
func (c *ClientSideConnection) UnstableAuthStatus(ctx context.Context, params UnstableAuthStatusRequest) (UnstableAuthStatusResponse, error)
func (*ClientSideConnection) UnstableDisableProvider ¶ added in v0.13.4
func (c *ClientSideConnection) UnstableDisableProvider(ctx context.Context, params UnstableDisableProviderRequest) (UnstableDisableProviderResponse, error)
func (*ClientSideConnection) UnstableForkSession ¶ added in v0.10.8
func (c *ClientSideConnection) UnstableForkSession(ctx context.Context, params UnstableForkSessionRequest) (UnstableForkSessionResponse, error)
func (*ClientSideConnection) UnstableListProviders ¶ added in v0.11.7
func (c *ClientSideConnection) UnstableListProviders(ctx context.Context, params UnstableListProvidersRequest) (UnstableListProvidersResponse, error)
func (*ClientSideConnection) UnstableMessageMcp ¶ added in v0.17.0
func (c *ClientSideConnection) UnstableMessageMcp(ctx context.Context, params UnstableMessageMcpNotification) error
func (*ClientSideConnection) UnstableSessionOptions ¶ added in v0.18.0
func (c *ClientSideConnection) UnstableSessionOptions(ctx context.Context, params UnstableSessionOptionsRequest) (UnstableSessionOptionsResponse, error)
func (*ClientSideConnection) UnstableSessionStatus ¶ added in v0.18.0
func (c *ClientSideConnection) UnstableSessionStatus(ctx context.Context, params UnstableSessionStatusRequest) (UnstableSessionStatusResponse, error)
func (*ClientSideConnection) UnstableSetProvider ¶ added in v0.13.4
func (c *ClientSideConnection) UnstableSetProvider(ctx context.Context, params UnstableSetProviderRequest) (UnstableSetProviderResponse, error)
func (*ClientSideConnection) UnstableSetSessionTitle ¶ added in v0.18.0
func (c *ClientSideConnection) UnstableSetSessionTitle(ctx context.Context, params UnstableSetSessionTitleRequest) (UnstableSetSessionTitleResponse, error)
func (*ClientSideConnection) UnstableUnarchiveSession ¶ added in v0.18.0
func (c *ClientSideConnection) UnstableUnarchiveSession(ctx context.Context, params UnstableUnarchiveSessionRequest) (UnstableUnarchiveSessionResponse, error)
type ClientUnstableAuthStatusUpdate ¶ added in v0.18.0
type ClientUnstableAuthStatusUpdate 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
}
ClientUnstableAuthStatusUpdate is the optional interface for the client method "auth/status_update". When the client does not implement it, ClientSideConnection drops "auth/status_update" and logs a -32601 (method not found) error.
type ClientUnstableMessageMcp ¶ added in v0.18.0
type ClientUnstableMessageMcp interface {
// **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)
}
ClientUnstableMessageMcp is the optional interface for the client method "mcp/message". When the client does not implement it, ClientSideConnection answers "mcp/message" with -32601 (method not found).
type CloseSessionRequest ¶ added in v0.12.2
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/extensibility)
Meta Meta `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) UnmarshalJSON ¶ added in v0.15.0
func (v *CloseSessionRequest) UnmarshalJSON(b []byte) error
func (*CloseSessionRequest) Validate ¶ added in v0.12.2
func (v *CloseSessionRequest) Validate() error
type CloseSessionResponse ¶ added in v0.12.2
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/extensibility)
Meta Meta `json:"_meta,omitempty"`
}
Response from closing a session.
func (*CloseSessionResponse) UnmarshalJSON ¶ added in v0.15.0
func (v *CloseSessionResponse) UnmarshalJSON(b []byte) error
func (*CloseSessionResponse) Validate ¶ added in v0.12.2
func (v *CloseSessionResponse) Validate() error
type CompactionCapabilities ¶ added in v0.16.0
type CompactionCapabilities struct{}
Client support for ID-addressed context compaction updates.
type CompactionId ¶ added in v0.16.0
type CompactionId string
Unique identifier for a context compaction within a session.
type CompactionStatus ¶ added in v0.16.0
type CompactionStatus string
Lifecycle state of a context compaction.
const ( // Compaction has started and has not finished. CompactionStatusInProgress CompactionStatus = "in_progress" // Compaction finished successfully. CompactionStatusCompleted CompactionStatus = "completed" // Compaction finished unsuccessfully. CompactionStatusFailed CompactionStatus = "failed" // Compaction was cancelled before it finished. CompactionStatusCancelled CompactionStatus = "cancelled" )
type CompactionSummaryChunk ¶ added in v0.16.0
type CompactionSummaryChunk struct {
// Metadata scoped to this chunk. Omission and 'null' both mean absent.
Meta Meta `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.
func (*CompactionSummaryChunk) UnmarshalJSON ¶ added in v0.16.0
func (v *CompactionSummaryChunk) UnmarshalJSON(b []byte) error
type CompactionUpdate ¶ added in v0.16.0
type CompactionUpdate struct {
// Extensible metadata patch for this compaction.
Meta Patch[Meta] `json:"_meta"`
// The Agent-owned ID of this compaction, unique within the session.
CompactionId CompactionId `json:"compactionId"`
// Human-readable error details for the compaction.
Error Patch[string] `json:"error"`
// Current lifecycle status.
Status CompactionStatus `json:"status"`
// Complete replacement user-displayable summary content for the compaction.
Summary Patch[[]ContentBlock] `json:"summary"`
}
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.
func (CompactionUpdate) MarshalJSON ¶ added in v0.20.0
func (v CompactionUpdate) MarshalJSON() ([]byte, error)
func (*CompactionUpdate) UnmarshalJSON ¶ added in v0.16.0
func (v *CompactionUpdate) UnmarshalJSON(b []byte) error
type CompleteElicitationNotification ¶ added in v0.16.0
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/extensibility)
Meta Meta `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) UnmarshalJSON ¶ added in v0.16.0
func (v *CompleteElicitationNotification) UnmarshalJSON(b []byte) error
func (*CompleteElicitationNotification) Validate ¶ added in v0.16.0
func (v *CompleteElicitationNotification) Validate() error
type ConfigOptionUpdate ¶ added in v0.10.8
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/extensibility)
Meta Meta `json:"_meta,omitempty"`
// The full set of configuration options and their current values.
ConfigOptions []SessionConfigOption `json:"configOptions"`
}
Session configuration options have been updated.
func (ConfigOptionUpdate) MarshalJSON ¶ added in v0.14.0
func (v ConfigOptionUpdate) MarshalJSON() ([]byte, error)
func (*ConfigOptionUpdate) UnmarshalJSON ¶ added in v0.14.0
func (v *ConfigOptionUpdate) UnmarshalJSON(b []byte) error
type Connection ¶
type Connection struct {
// contains filtered or unexported fields
}
Connection is a simple JSON-RPC 2.0 connection over line-delimited JSON.
func NewConnection ¶
func NewConnection(handler MethodHandler, peerInput io.Writer, peerOutput io.Reader) *Connection
func (*Connection) Done ¶
func (c *Connection) Done() <-chan struct{}
Done returns a channel that is closed when the underlying reader loop exits (typically when the peer disconnects or the input stream is closed).
func (*Connection) SendNotification ¶
func (*Connection) SendRequestNoResult ¶
SendRequestNoResult sends a JSON-RPC request that returns no result payload. It waits for notification handlers as SendRequest does.
func (*Connection) SetLogger ¶
func (c *Connection) SetLogger(l *slog.Logger)
SetLogger installs a logger used for internal connection diagnostics. If unset, logs are written via the default logger.
type Content ¶ added in v0.10.8
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/extensibility)
Meta Meta `json:"_meta,omitempty"`
// The actual content block.
Content ContentBlock `json:"content"`
}
Standard content block (text, images, resources).
func (*Content) UnmarshalJSON ¶ added in v0.15.0
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 AudioBlock ¶
func AudioBlock(data string, mimeType string) ContentBlock
AudioBlock constructs an inline audio content block with base64-encoded data.
func ImageBlock ¶
func ImageBlock(data string, mimeType string) ContentBlock
ImageBlock constructs an inline image content block with base64-encoded data.
func ResourceBlock ¶
func ResourceBlock(res EmbeddedResourceResource) ContentBlock
ResourceBlock wraps an embedded resource as a content block.
func ResourceLinkBlock ¶
func ResourceLinkBlock(name string, uri string) ContentBlock
ResourceLinkBlock constructs a resource_link content block with a name and URI.
func TextBlock ¶
func TextBlock(text string) ContentBlock
TextBlock constructs a text content block.
func (ContentBlock) MarshalJSON ¶
func (u ContentBlock) MarshalJSON() ([]byte, error)
func (*ContentBlock) UnmarshalJSON ¶
func (u *ContentBlock) UnmarshalJSON(b []byte) 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/extensibility)
Meta Meta `json:"_meta,omitempty"`
// Optional annotations that help clients decide how to display or route this content.
Annotations *Annotations `json:"annotations,omitempty"`
// 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.
func (*ContentBlockAudio) UnmarshalJSON ¶ added in v0.14.0
func (v *ContentBlockAudio) UnmarshalJSON(b []byte) error
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/extensibility)
Meta Meta `json:"_meta,omitempty"`
// Optional annotations that help clients decide how to display or route this content.
Annotations *Annotations `json:"annotations,omitempty"`
// 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,omitempty"`
}
Images for visual context or analysis.
Requires the 'image' prompt capability when included in prompts.
func (*ContentBlockImage) UnmarshalJSON ¶ added in v0.14.0
func (v *ContentBlockImage) UnmarshalJSON(b []byte) error
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/extensibility)
Meta Meta `json:"_meta,omitempty"`
// Optional annotations that help clients decide how to display or route this content.
Annotations *Annotations `json:"annotations,omitempty"`
// 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.
func (*ContentBlockResource) UnmarshalJSON ¶ added in v0.14.0
func (v *ContentBlockResource) UnmarshalJSON(b []byte) error
type ContentBlockResourceLink ¶
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/extensibility)
Meta Meta `json:"_meta,omitempty"`
// Optional annotations that help clients decide how to display or route this content.
Annotations *Annotations `json:"annotations,omitempty"`
// Optional human-readable details shown with this protocol object.
Description *string `json:"description,omitempty"`
// MIME type describing the encoded media payload.
MimeType *string `json:"mimeType,omitempty"`
// Human-readable name shown for this protocol object.
Name string `json:"name"`
// Optional size of the linked resource in bytes, if known.
Size *int64 `json:"size,omitempty"`
// Optional display title for end-user UI.
Title *string `json:"title,omitempty"`
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.
func (*ContentBlockResourceLink) UnmarshalJSON ¶ added in v0.14.0
func (v *ContentBlockResourceLink) UnmarshalJSON(b []byte) error
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/extensibility)
Meta Meta `json:"_meta,omitempty"`
// Optional annotations that help clients decide how to display or route this content.
Annotations *Annotations `json:"annotations,omitempty"`
// 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/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.
func (*ContentBlockText) UnmarshalJSON ¶ added in v0.14.0
func (v *ContentBlockText) UnmarshalJSON(b []byte) error
type ContentChunk ¶ added in v0.10.8
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/extensibility)
Meta Meta `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,omitempty"`
}
A streamed item of content
func (*ContentChunk) UnmarshalJSON ¶ added in v0.15.0
func (v *ContentChunk) UnmarshalJSON(b []byte) error
type Cost ¶ added in v0.10.8
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/extensibility)
Meta Meta `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.
func (*Cost) UnmarshalJSON ¶ added in v0.15.0
type CreateElicitationAccept ¶ added in v0.16.0
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/extensibility)
Meta Meta `json:"_meta,omitempty"`
Action string `json:"action"`
// The user-provided content, if any, as an object matching the requested schema.
Content map[string]ElicitationContentValue `json:"content,omitempty"`
}
Response from the client to an elicitation request. The user accepted and provided content.
func (*CreateElicitationAccept) UnmarshalJSON ¶ added in v0.16.0
func (v *CreateElicitationAccept) UnmarshalJSON(b []byte) error
type CreateElicitationCancel ¶ added in v0.16.0
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/extensibility)
Meta Meta `json:"_meta,omitempty"`
Action string `json:"action"`
}
The elicitation was cancelled.
func (*CreateElicitationCancel) UnmarshalJSON ¶ added in v0.16.0
func (v *CreateElicitationCancel) UnmarshalJSON(b []byte) error
type CreateElicitationDecline ¶ added in v0.16.0
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/extensibility)
Meta Meta `json:"_meta,omitempty"`
Action string `json:"action"`
}
The user declined the elicitation.
func (*CreateElicitationDecline) UnmarshalJSON ¶ added in v0.16.0
func (v *CreateElicitationDecline) UnmarshalJSON(b []byte) error
type CreateElicitationForm ¶ added in v0.16.0
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/extensibility)
Meta Meta `json:"_meta,omitempty"`
// A human-readable message describing what input is needed.
Message string `json:"message"`
Mode string `json:"mode"`
// A JSON Schema describing the form fields to present to the user.
RequestedSchema ElicitationSchema `json:"requestedSchema"`
// 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:"-"`
}
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.
func (CreateElicitationForm) MarshalJSON ¶ added in v0.16.0
func (u CreateElicitationForm) MarshalJSON() ([]byte, error)
func (*CreateElicitationForm) UnmarshalJSON ¶ added in v0.16.0
func (u *CreateElicitationForm) UnmarshalJSON(b []byte) error
type CreateElicitationOther ¶ added in v0.16.0
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/extensibility)
Meta Meta `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"`
// 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:"-"`
// AdditionalProperties holds the members that the schema does not name.
AdditionalProperties map[string]json.RawMessage `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.
func (CreateElicitationOther) MarshalJSON ¶ added in v0.16.0
func (u CreateElicitationOther) MarshalJSON() ([]byte, error)
func (*CreateElicitationOther) UnmarshalJSON ¶ added in v0.16.0
func (u *CreateElicitationOther) UnmarshalJSON(b []byte) error
type CreateElicitationRequest ¶ added in v0.16.0
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) MarshalJSON ¶ added in v0.16.0
func (u CreateElicitationRequest) MarshalJSON() ([]byte, error)
func (*CreateElicitationRequest) UnmarshalJSON ¶ added in v0.16.0
func (u *CreateElicitationRequest) UnmarshalJSON(b []byte) error
func (*CreateElicitationRequest) Validate ¶ added in v0.16.0
func (u *CreateElicitationRequest) Validate() error
type CreateElicitationResponse ¶ added in v0.16.0
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) MarshalJSON ¶ added in v0.16.0
func (u CreateElicitationResponse) MarshalJSON() ([]byte, error)
func (*CreateElicitationResponse) UnmarshalJSON ¶ added in v0.16.0
func (u *CreateElicitationResponse) UnmarshalJSON(b []byte) error
func (*CreateElicitationResponse) Validate ¶ added in v0.16.0
func (u *CreateElicitationResponse) Validate() error
type CreateElicitationResponseOther ¶ added in v0.16.0
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/extensibility)
Meta Meta `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"`
// AdditionalProperties holds the members that the schema does not name.
AdditionalProperties map[string]json.RawMessage `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.
func (CreateElicitationResponseOther) MarshalJSON ¶ added in v0.16.0
func (v CreateElicitationResponseOther) MarshalJSON() ([]byte, error)
func (*CreateElicitationResponseOther) UnmarshalJSON ¶ added in v0.16.0
func (v *CreateElicitationResponseOther) UnmarshalJSON(b []byte) error
type CreateElicitationUrl ¶ added in v0.16.0
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/extensibility)
Meta Meta `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 URL to direct the user to.
Url string `json:"url"`
// 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 where the client directs the user to a URL.
func (CreateElicitationUrl) MarshalJSON ¶ added in v0.16.0
func (u CreateElicitationUrl) MarshalJSON() ([]byte, error)
func (*CreateElicitationUrl) UnmarshalJSON ¶ added in v0.16.0
func (u *CreateElicitationUrl) UnmarshalJSON(b []byte) error
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/extensibility)
Meta Meta `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,omitempty"`
// 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 *int64 `json:"outputByteLimit,omitempty"`
// The session ID for this request.
SessionId SessionId `json:"sessionId"`
}
Request to create a new terminal and execute a command.
func (*CreateTerminalRequest) UnmarshalJSON ¶ added in v0.15.0
func (v *CreateTerminalRequest) UnmarshalJSON(b []byte) error
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/extensibility)
Meta Meta `json:"_meta,omitempty"`
// The unique identifier for the created terminal.
TerminalId TerminalId `json:"terminalId"`
}
Response containing the ID of the created terminal.
func (*CreateTerminalResponse) UnmarshalJSON ¶ added in v0.15.0
func (v *CreateTerminalResponse) UnmarshalJSON(b []byte) error
func (*CreateTerminalResponse) Validate ¶
func (v *CreateTerminalResponse) Validate() error
type CurrentModeUpdate ¶ added in v0.10.8
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/extensibility)
Meta Meta `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/session-modes)
func (*CurrentModeUpdate) UnmarshalJSON ¶ added in v0.15.0
func (v *CurrentModeUpdate) UnmarshalJSON(b []byte) error
type DeleteSessionRequest ¶ added in v0.14.0
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/extensibility)
Meta Meta `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) UnmarshalJSON ¶ added in v0.15.0
func (v *DeleteSessionRequest) UnmarshalJSON(b []byte) error
func (*DeleteSessionRequest) Validate ¶ added in v0.14.0
func (v *DeleteSessionRequest) Validate() error
type DeleteSessionResponse ¶ added in v0.14.0
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/extensibility)
Meta Meta `json:"_meta,omitempty"`
}
Response from deleting a session.
func (*DeleteSessionResponse) UnmarshalJSON ¶ added in v0.15.0
func (v *DeleteSessionResponse) UnmarshalJSON(b []byte) error
func (*DeleteSessionResponse) Validate ¶ added in v0.14.0
func (v *DeleteSessionResponse) Validate() error
type Diff ¶ added in v0.10.8
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/extensibility)
Meta Meta `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,omitempty"`
// 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/tool-calls#content)
func (*Diff) UnmarshalJSON ¶ added in v0.15.0
type ElicitationAcceptAction ¶ added in v0.16.0
type ElicitationAcceptAction struct {
// The user-provided content, if any, as an object matching the requested schema.
Content map[string]ElicitationContentValue `json:"content,omitempty"`
}
The user accepted the elicitation and provided content.
type ElicitationCapabilities ¶ added in v0.11.7
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/extensibility)
Meta Meta `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,omitempty"`
// 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,omitempty"`
}
Elicitation capabilities supported by the client.
func (*ElicitationCapabilities) UnmarshalJSON ¶ added in v0.14.0
func (v *ElicitationCapabilities) UnmarshalJSON(b []byte) error
type ElicitationContentValue ¶ added in v0.16.0
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 NewElicitationContentValueBoolean ¶ added in v0.20.0
func NewElicitationContentValueBoolean(b bool) ElicitationContentValue
NewElicitationContentValueBoolean returns the elicitation content value b.
func NewElicitationContentValueInteger ¶ added in v0.20.0
func NewElicitationContentValueInteger(n int64) ElicitationContentValue
NewElicitationContentValueInteger returns the elicitation content value n.
func NewElicitationContentValueNumber ¶ added in v0.20.0
func NewElicitationContentValueNumber(f float64) ElicitationContentValue
NewElicitationContentValueNumber returns the elicitation content value f.
func NewElicitationContentValueString ¶ added in v0.20.0
func NewElicitationContentValueString(s string) ElicitationContentValue
NewElicitationContentValueString returns the elicitation content value s.
func NewElicitationContentValueStringArray ¶ added in v0.20.0
func NewElicitationContentValueStringArray(values ...string) ElicitationContentValue
NewElicitationContentValueStringArray returns the elicitation content value that holds values, an array of strings, as a multi-select field takes.
func (ElicitationContentValue) MarshalJSON ¶ added in v0.16.0
func (u ElicitationContentValue) MarshalJSON() ([]byte, error)
func (*ElicitationContentValue) UnmarshalJSON ¶ added in v0.16.0
func (u *ElicitationContentValue) UnmarshalJSON(b []byte) error
type ElicitationContentValueBoolean ¶ added in v0.16.0
type ElicitationContentValueBoolean bool
Boolean value accepted in elicitation response content.
type ElicitationContentValueInteger ¶ added in v0.16.0
type ElicitationContentValueInteger int64
Integer value accepted in elicitation response content.
type ElicitationContentValueNumber ¶ added in v0.16.0
type ElicitationContentValueNumber float64
Number value accepted in elicitation response content.
type ElicitationContentValueString ¶ added in v0.16.0
type ElicitationContentValueString string
Allowed wire representations for 'ElicitationContentValue'. String value accepted in elicitation response content.
type ElicitationContentValueStringArray ¶ added in v0.16.0
type ElicitationContentValueStringArray []string
String array value accepted in elicitation response content.
type ElicitationFormCapabilities ¶ added in v0.11.7
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/extensibility)
Meta Meta `json:"_meta,omitempty"`
}
Form-based elicitation capabilities.
Supplying '{}' means the client supports form-based elicitation.
func (*ElicitationFormCapabilities) UnmarshalJSON ¶ added in v0.15.0
func (v *ElicitationFormCapabilities) UnmarshalJSON(b []byte) error
type ElicitationFormMode ¶ added in v0.16.0
type ElicitationFormMode struct {
// A JSON Schema describing the form fields to present to the user.
RequestedSchema ElicitationSchema `json:"requestedSchema"`
// 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) MarshalJSON ¶ added in v0.16.0
func (u ElicitationFormMode) MarshalJSON() ([]byte, error)
func (*ElicitationFormMode) UnmarshalJSON ¶ added in v0.16.0
func (u *ElicitationFormMode) UnmarshalJSON(b []byte) error
type ElicitationId ¶ added in v0.16.0
type ElicitationId string
Unique identifier for an elicitation.
type ElicitationPropertySchema ¶ added in v0.16.0
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) MarshalJSON ¶ added in v0.16.0
func (u ElicitationPropertySchema) MarshalJSON() ([]byte, error)
func (*ElicitationPropertySchema) UnmarshalJSON ¶ added in v0.16.0
func (u *ElicitationPropertySchema) UnmarshalJSON(b []byte) error
type ElicitationPropertySchemaArray ¶ added in v0.16.0
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 Meta `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,omitempty"`
// 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 *int64 `json:"maxItems,omitempty"`
// Minimum number of items to select.
//
// Optional. Omitted and 'null' are equivalent and mean there is no minimum selection count.
MinItems *int64 `json:"minItems,omitempty"`
// Optional title for the property.
//
// Optional. Omitted and 'null' are equivalent and mean no title is provided.
Title *string `json:"title,omitempty"`
Type string `json:"type"`
}
Multi-select array property.
func (*ElicitationPropertySchemaArray) UnmarshalJSON ¶ added in v0.16.0
func (v *ElicitationPropertySchemaArray) UnmarshalJSON(b []byte) error
type ElicitationPropertySchemaBoolean ¶ added in v0.16.0
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 Meta `json:"_meta,omitempty"`
// Default value.
//
// Optional. Omitted and 'null' are equivalent and mean no default value is provided.
Default *bool `json:"default,omitempty"`
// Human-readable description.
//
// Optional. Omitted and 'null' are equivalent and mean no description is provided.
Description *string `json:"description,omitempty"`
// Optional title for the property.
//
// Optional. Omitted and 'null' are equivalent and mean no title is provided.
Title *string `json:"title,omitempty"`
Type string `json:"type"`
}
Boolean property.
func (*ElicitationPropertySchemaBoolean) UnmarshalJSON ¶ added in v0.16.0
func (v *ElicitationPropertySchemaBoolean) UnmarshalJSON(b []byte) error
type ElicitationPropertySchemaInteger ¶ added in v0.16.0
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 Meta `json:"_meta,omitempty"`
// Default value.
//
// Optional. Omitted and 'null' are equivalent and mean no default value is provided.
Default *int64 `json:"default,omitempty"`
// Human-readable description.
//
// Optional. Omitted and 'null' are equivalent and mean no description is provided.
Description *string `json:"description,omitempty"`
// Maximum value (inclusive).
//
// Optional. Omitted and 'null' are equivalent and mean there is no inclusive upper bound.
Maximum *int64 `json:"maximum,omitempty"`
// Minimum value (inclusive).
//
// Optional. Omitted and 'null' are equivalent and mean there is no inclusive lower bound.
Minimum *int64 `json:"minimum,omitempty"`
// Optional title for the property.
//
// Optional. Omitted and 'null' are equivalent and mean no title is provided.
Title *string `json:"title,omitempty"`
Type string `json:"type"`
}
Integer property.
func (*ElicitationPropertySchemaInteger) UnmarshalJSON ¶ added in v0.16.0
func (v *ElicitationPropertySchemaInteger) UnmarshalJSON(b []byte) error
type ElicitationPropertySchemaNumber ¶ added in v0.16.0
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 Meta `json:"_meta,omitempty"`
// Default value.
//
// Optional. Omitted and 'null' are equivalent and mean no default value is provided.
Default *float64 `json:"default,omitempty"`
// Human-readable description.
//
// Optional. Omitted and 'null' are equivalent and mean no description is provided.
Description *string `json:"description,omitempty"`
// Maximum value (inclusive).
//
// Optional. Omitted and 'null' are equivalent and mean there is no inclusive upper bound.
Maximum *float64 `json:"maximum,omitempty"`
// Minimum value (inclusive).
//
// Optional. Omitted and 'null' are equivalent and mean there is no inclusive lower bound.
Minimum *float64 `json:"minimum,omitempty"`
// Optional title for the property.
//
// Optional. Omitted and 'null' are equivalent and mean no title is provided.
Title *string `json:"title,omitempty"`
Type string `json:"type"`
}
Number (floating-point) property.
func (*ElicitationPropertySchemaNumber) UnmarshalJSON ¶ added in v0.16.0
func (v *ElicitationPropertySchemaNumber) UnmarshalJSON(b []byte) error
type ElicitationPropertySchemaOther ¶ added in v0.16.0
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"`
// AdditionalProperties holds the members that the schema does not name.
AdditionalProperties map[string]json.RawMessage `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.
func (ElicitationPropertySchemaOther) MarshalJSON ¶ added in v0.16.0
func (v ElicitationPropertySchemaOther) MarshalJSON() ([]byte, error)
func (*ElicitationPropertySchemaOther) UnmarshalJSON ¶ added in v0.16.0
func (v *ElicitationPropertySchemaOther) UnmarshalJSON(b []byte) error
type ElicitationPropertySchemaString ¶ added in v0.16.0
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 Meta `json:"_meta,omitempty"`
// Default value.
//
// Optional. Omitted and 'null' are equivalent and mean no default value is 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,omitempty"`
// 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,omitempty"`
// Maximum string length.
//
// Optional. Omitted and 'null' are equivalent and mean there is no maximum length constraint.
MaxLength *int64 `json:"maxLength,omitempty"`
// Minimum string length.
//
// Optional. Omitted and 'null' are equivalent and mean there is no minimum length constraint.
MinLength *int64 `json:"minLength,omitempty"`
// 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,omitempty"`
// Optional title for the property.
//
// Optional. Omitted and 'null' are equivalent and mean no title is provided.
Title *string `json:"title,omitempty"`
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).
func (*ElicitationPropertySchemaString) UnmarshalJSON ¶ added in v0.16.0
func (v *ElicitationPropertySchemaString) UnmarshalJSON(b []byte) error
type ElicitationRequestScope ¶ added in v0.16.0
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 ¶ added in v0.16.0
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/extensibility)
Meta Meta `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,omitempty"`
// Property definitions (must be primitive types).
//
// Defaults to {} if unset.
Properties map[string]ElicitationPropertySchema `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,omitempty"`
// Type discriminator. Always '"object"'.
//
// Defaults to "object" if unset.
Type ElicitationSchemaType `json:"type,omitempty"`
}
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) MarshalJSON ¶ added in v0.16.0
func (v ElicitationSchema) MarshalJSON() ([]byte, error)
func (*ElicitationSchema) UnmarshalJSON ¶ added in v0.16.0
func (v *ElicitationSchema) UnmarshalJSON(b []byte) error
type ElicitationSchemaType ¶ added in v0.16.0
type ElicitationSchemaType string
Type discriminator for elicitation schemas.
const ( // Object schema type. ElicitationSchemaTypeObject ElicitationSchemaType = "object" )
type ElicitationSessionScope ¶ added in v0.16.0
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,omitempty"`
}
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.
func (*ElicitationSessionScope) UnmarshalJSON ¶ added in v0.16.0
func (v *ElicitationSessionScope) UnmarshalJSON(b []byte) error
type ElicitationUrlCapabilities ¶ added in v0.11.7
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/extensibility)
Meta Meta `json:"_meta,omitempty"`
}
URL-based elicitation capabilities.
Supplying '{}' means the client supports URL-based elicitation.
func (*ElicitationUrlCapabilities) UnmarshalJSON ¶ added in v0.15.0
func (v *ElicitationUrlCapabilities) UnmarshalJSON(b []byte) error
type ElicitationUrlMode ¶ added in v0.16.0
type ElicitationUrlMode struct {
// The unique identifier for this elicitation.
ElicitationId ElicitationId `json:"elicitationId"`
// The URL to direct the user to.
Url string `json:"url"`
// 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) MarshalJSON ¶ added in v0.16.0
func (u ElicitationUrlMode) MarshalJSON() ([]byte, error)
func (*ElicitationUrlMode) UnmarshalJSON ¶ added in v0.16.0
func (u *ElicitationUrlMode) UnmarshalJSON(b []byte) 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/extensibility)
Meta Meta `json:"_meta,omitempty"`
// Optional annotations that help clients decide how to display or route this content.
Annotations *Annotations `json:"annotations,omitempty"`
// 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.
func (*EmbeddedResource) UnmarshalJSON ¶ added in v0.14.0
func (v *EmbeddedResource) UnmarshalJSON(b []byte) error
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) MarshalJSON ¶
func (u EmbeddedResourceResource) MarshalJSON() ([]byte, error)
func (*EmbeddedResourceResource) UnmarshalJSON ¶
func (u *EmbeddedResourceResource) UnmarshalJSON(b []byte) error
type EnumOption ¶ added in v0.16.0
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 Meta `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,omitempty"`
// Human-readable title for this option.
Title string `json:"title"`
}
A titled enum option with a const value, human-readable title, and optional description.
func (*EnumOption) UnmarshalJSON ¶ added in v0.16.0
func (v *EnumOption) UnmarshalJSON(b []byte) error
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/extensibility)
Meta Meta `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.
func (*EnvVariable) UnmarshalJSON ¶ added in v0.15.0
func (v *EnvVariable) UnmarshalJSON(b []byte) error
type Error ¶ added in v0.6.3
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 json.RawMessage `json:"data,omitempty"`
// 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)
func (*Error) UnmarshalJSON ¶ added in v0.15.0
type ErrorCode ¶ added in v0.10.8
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) MarshalJSON ¶ added in v0.10.8
func (*ErrorCode) UnmarshalJSON ¶ added in v0.10.8
type ErrorCodeAuthenticationRequired ¶ added in v0.10.8
type ErrorCodeAuthenticationRequired int
**Authentication required**: Authentication is required before this operation can be performed.
type ErrorCodeInternalError ¶ added in v0.10.8
type ErrorCodeInternalError int
**Internal error**: Internal JSON-RPC error.
type ErrorCodeInvalidParams ¶ added in v0.10.8
type ErrorCodeInvalidParams int
**Invalid params**: Invalid method parameter(s).
type ErrorCodeInvalidRequest ¶ added in v0.10.8
type ErrorCodeInvalidRequest int
**Invalid request**: The JSON sent is not a valid Request object.
type ErrorCodeMethodNotFound ¶ added in v0.10.8
type ErrorCodeMethodNotFound int
**Method not found**: The method does not exist or is not available.
type ErrorCodeParseError ¶ added in v0.10.8
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 ¶ added in v0.15.0
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 ¶ added in v0.10.8
type ErrorCodeResourceNotFound int
**Resource not found**: A given resource, such as a session or file, was not found.
type ErrorStopReason ¶ added in v0.17.0
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,omitempty"`
}
**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.
func (*ErrorStopReason) UnmarshalJSON ¶ added in v0.17.0
func (v *ErrorStopReason) UnmarshalJSON(b []byte) error
type ExtNotification ¶ added in v0.10.8
type ExtNotification = json.RawMessage
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; it holds the JSON as it was read.
type ExtRequest ¶ added in v0.10.8
type ExtRequest = json.RawMessage
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; it holds the JSON as it was read.
type ExtResponse ¶ added in v0.10.8
type ExtResponse = json.RawMessage
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; it holds the JSON as it was read.
type ExtensionMethodHandler ¶ added in v0.10.8
type ExtensionMethodHandler interface {
HandleExtensionMethod(ctx context.Context, method string, params json.RawMessage) (any, error)
}
ExtensionMethodHandler can be implemented by either an Agent or a Client.
ACP extension methods are JSON-RPC methods whose names begin with "_". They provide a stable namespace for custom functionality that is not part of the core ACP spec.
If the method is unrecognized, implementations should return NewMethodNotFound(method).
See: https://agentclientprotocol.com/protocol/extensibility#extension-methods
type FileSystemCapabilities ¶ added in v0.11.7
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/extensibility)
Meta Meta `json:"_meta,omitempty"`
// Whether the Client supports 'fs/read_text_file' requests.
//
// Defaults to false if unset.
ReadTextFile bool `json:"readTextFile,omitempty"`
// Whether the Client supports 'fs/write_text_file' requests.
//
// Defaults to false if unset.
WriteTextFile bool `json:"writeTextFile,omitempty"`
}
File system capabilities that a client may support.
See protocol docs: [FileSystem](https://agentclientprotocol.com/protocol/v1/initialization#filesystem)
func (FileSystemCapabilities) MarshalJSON ¶ added in v0.11.7
func (v FileSystemCapabilities) MarshalJSON() ([]byte, error)
func (*FileSystemCapabilities) UnmarshalJSON ¶ added in v0.11.7
func (v *FileSystemCapabilities) UnmarshalJSON(b []byte) 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/extensibility)
Meta Meta `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.
func (*HttpHeader) UnmarshalJSON ¶ added in v0.15.0
func (v *HttpHeader) UnmarshalJSON(b []byte) error
type IdleStateUpdate ¶ added in v0.17.0
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) MarshalJSON ¶ added in v0.17.0
func (u IdleStateUpdate) MarshalJSON() ([]byte, error)
func (*IdleStateUpdate) UnmarshalJSON ¶ added in v0.17.0
func (u *IdleStateUpdate) UnmarshalJSON(b []byte) error
type IdleStateUpdateCancelled ¶ added in v0.17.0
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 Meta `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,omitempty"`
}
The work was cancelled.
func (*IdleStateUpdateCancelled) UnmarshalJSON ¶ added in v0.17.0
func (v *IdleStateUpdateCancelled) UnmarshalJSON(b []byte) error
type IdleStateUpdateEndTurn ¶ added in v0.17.0
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 Meta `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,omitempty"`
}
The child is ready to process another prompt.
An omitted, 'null', or malformed 'stopReason' means not reported. The work ended successfully.
func (*IdleStateUpdateEndTurn) UnmarshalJSON ¶ added in v0.17.0
func (v *IdleStateUpdateEndTurn) UnmarshalJSON(b []byte) error
type IdleStateUpdateError ¶ added in v0.17.0
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 Meta `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,omitempty"`
StopReason string `json:"stopReason"`
// **UNSTABLE** Token usage for completed foreground work.
//
// Optional. Omitted or 'null' means not reported.
Usage *Usage `json:"usage,omitempty"`
}
The work ended because something failed.
func (*IdleStateUpdateError) UnmarshalJSON ¶ added in v0.17.0
func (v *IdleStateUpdateError) UnmarshalJSON(b []byte) error
type IdleStateUpdateMaxTokens ¶ added in v0.17.0
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 Meta `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,omitempty"`
}
The work ended because the agent reached the maximum number of tokens.
func (*IdleStateUpdateMaxTokens) UnmarshalJSON ¶ added in v0.17.0
func (v *IdleStateUpdateMaxTokens) UnmarshalJSON(b []byte) error
type IdleStateUpdateMaxTurnRequests ¶ added in v0.17.0
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 Meta `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,omitempty"`
}
The work ended because the agent reached the maximum number of allowed agent requests.
func (*IdleStateUpdateMaxTurnRequests) UnmarshalJSON ¶ added in v0.17.0
func (v *IdleStateUpdateMaxTurnRequests) UnmarshalJSON(b []byte) error
type IdleStateUpdateNone ¶ added in v0.17.0
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 Meta `json:"_meta,omitempty"`
// **UNSTABLE** Token usage for completed foreground work.
//
// Optional. Omitted or 'null' means not reported.
Usage *Usage `json:"usage,omitempty"`
}
No stop reason: 'stopReason' is omitted or 'null'.
func (*IdleStateUpdateNone) UnmarshalJSON ¶ added in v0.17.0
func (v *IdleStateUpdateNone) UnmarshalJSON(b []byte) error
type IdleStateUpdateOther ¶ added in v0.17.0
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 Meta `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,omitempty"`
// AdditionalProperties holds the members that the schema does not name.
AdditionalProperties map[string]json.RawMessage `json:"-"`
}
Custom or future stop reason.
Values beginning with '_' are reserved for implementation-specific extensions. Other unknown values are reserved for future ACP variants.
func (IdleStateUpdateOther) MarshalJSON ¶ added in v0.17.0
func (v IdleStateUpdateOther) MarshalJSON() ([]byte, error)
func (*IdleStateUpdateOther) UnmarshalJSON ¶ added in v0.17.0
func (v *IdleStateUpdateOther) UnmarshalJSON(b []byte) error
type IdleStateUpdateRefusal ¶ added in v0.17.0
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 Meta `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,omitempty"`
}
The work ended because the agent refused to continue.
func (*IdleStateUpdateRefusal) UnmarshalJSON ¶ added in v0.17.0
func (v *IdleStateUpdateRefusal) UnmarshalJSON(b []byte) error
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/extensibility)
Meta Meta `json:"_meta,omitempty"`
// Optional annotations that help clients decide how to display or route this content.
Annotations *Annotations `json:"annotations,omitempty"`
// 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,omitempty"`
}
An image provided to or from an LLM.
func (*ImageContent) UnmarshalJSON ¶ added in v0.14.0
func (v *ImageContent) UnmarshalJSON(b []byte) error
type Implementation ¶ added in v0.6.3
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/extensibility)
Meta Meta `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,omitempty"`
// 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.
func (*Implementation) UnmarshalJSON ¶ added in v0.15.0
func (v *Implementation) UnmarshalJSON(b []byte) error
type InitialSessionConfigOption ¶ added in v0.18.0
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) MarshalJSON ¶ added in v0.18.0
func (u InitialSessionConfigOption) MarshalJSON() ([]byte, error)
func (*InitialSessionConfigOption) UnmarshalJSON ¶ added in v0.18.0
func (u *InitialSessionConfigOption) UnmarshalJSON(b []byte) error
type InitialSessionConfigOptionBoolean ¶ added in v0.18.0
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 Meta `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"').
func (*InitialSessionConfigOptionBoolean) UnmarshalJSON ¶ added in v0.18.0
func (v *InitialSessionConfigOptionBoolean) UnmarshalJSON(b []byte) error
type InitialSessionConfigOptionValueId ¶ added in v0.18.0
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 Meta `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.
func (*InitialSessionConfigOptionValueId) UnmarshalJSON ¶ added in v0.18.0
func (v *InitialSessionConfigOptionValueId) UnmarshalJSON(b []byte) error
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/extensibility)
Meta Meta `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,omitempty"`
// 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,omitempty"`
// 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/initialization)
func (InitializeRequest) MarshalJSON ¶
func (v InitializeRequest) MarshalJSON() ([]byte, error)
func (*InitializeRequest) UnmarshalJSON ¶
func (v *InitializeRequest) UnmarshalJSON(b []byte) 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 Meta `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,omitempty"`
// 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,omitempty"`
// 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) MarshalJSON ¶
func (v InitializeResponse) MarshalJSON() ([]byte, error)
func (*InitializeResponse) UnmarshalJSON ¶
func (v *InitializeResponse) UnmarshalJSON(b []byte) error
func (*InitializeResponse) Validate ¶
func (v *InitializeResponse) Validate() error
type IntegerPropertySchema ¶ added in v0.16.0
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 Meta `json:"_meta,omitempty"`
// Default value.
//
// Optional. Omitted and 'null' are equivalent and mean no default value is provided.
Default *int64 `json:"default,omitempty"`
// Human-readable description.
//
// Optional. Omitted and 'null' are equivalent and mean no description is provided.
Description *string `json:"description,omitempty"`
// Maximum value (inclusive).
//
// Optional. Omitted and 'null' are equivalent and mean there is no inclusive upper bound.
Maximum *int64 `json:"maximum,omitempty"`
// Minimum value (inclusive).
//
// Optional. Omitted and 'null' are equivalent and mean there is no inclusive lower bound.
Minimum *int64 `json:"minimum,omitempty"`
// Optional title for the property.
//
// Optional. Omitted and 'null' are equivalent and mean no title is provided.
Title *string `json:"title,omitempty"`
}
Schema for integer properties in an elicitation form.
func (*IntegerPropertySchema) UnmarshalJSON ¶ added in v0.16.0
func (v *IntegerPropertySchema) UnmarshalJSON(b []byte) error
type KillTerminalRequest ¶ added in v0.11.7
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/extensibility)
Meta Meta `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) UnmarshalJSON ¶ added in v0.15.0
func (v *KillTerminalRequest) UnmarshalJSON(b []byte) error
func (*KillTerminalRequest) Validate ¶ added in v0.11.7
func (v *KillTerminalRequest) Validate() error
type KillTerminalResponse ¶ added in v0.11.7
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/extensibility)
Meta Meta `json:"_meta,omitempty"`
}
Response to 'terminal/kill' method
func (*KillTerminalResponse) UnmarshalJSON ¶ added in v0.15.0
func (v *KillTerminalResponse) UnmarshalJSON(b []byte) error
func (*KillTerminalResponse) Validate ¶ added in v0.11.7
func (v *KillTerminalResponse) Validate() error
type ListSessionsRequest ¶ added in v0.11.7
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 Meta `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,omitempty"`
// Opaque cursor token from a previous response's nextCursor field for cursor-based pagination
Cursor *string `json:"cursor,omitempty"`
// Filter sessions by working directory. Must be an absolute path.
Cwd *string `json:"cwd,omitempty"`
}
Request parameters for listing existing sessions.
Only available if the Agent supports the 'sessionCapabilities.list' capability.
func (*ListSessionsRequest) UnmarshalJSON ¶ added in v0.15.0
func (v *ListSessionsRequest) UnmarshalJSON(b []byte) error
func (*ListSessionsRequest) Validate ¶ added in v0.11.7
func (v *ListSessionsRequest) Validate() error
type ListSessionsResponse ¶ added in v0.11.7
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/extensibility)
Meta Meta `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,omitempty"`
// Array of session information objects
Sessions []SessionInfo `json:"sessions"`
}
Response from listing sessions.
func (ListSessionsResponse) MarshalJSON ¶ added in v0.14.0
func (v ListSessionsResponse) MarshalJSON() ([]byte, error)
func (*ListSessionsResponse) UnmarshalJSON ¶ added in v0.14.0
func (v *ListSessionsResponse) UnmarshalJSON(b []byte) error
func (*ListSessionsResponse) Validate ¶ added in v0.11.7
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 Meta `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,omitempty"`
}
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) MarshalJSON ¶ added in v0.14.0
func (v LoadSessionRequest) MarshalJSON() ([]byte, error)
func (*LoadSessionRequest) UnmarshalJSON ¶ added in v0.15.0
func (v *LoadSessionRequest) UnmarshalJSON(b []byte) error
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/extensibility)
Meta Meta `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/session-modes)
Modes *SessionModeState `json:"modes,omitempty"`
}
Response from loading an existing session.
func (*LoadSessionResponse) UnmarshalJSON ¶ added in v0.14.0
func (v *LoadSessionResponse) UnmarshalJSON(b []byte) error
func (*LoadSessionResponse) Validate ¶
func (v *LoadSessionResponse) Validate() error
type LogoutCapabilities ¶ added in v0.11.7
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/extensibility)
Meta Meta `json:"_meta,omitempty"`
}
Logout capabilities supported by the agent.
Supplying '{}' means the agent supports the logout method.
func (*LogoutCapabilities) UnmarshalJSON ¶ added in v0.15.0
func (v *LogoutCapabilities) UnmarshalJSON(b []byte) error
type LogoutRequest ¶ added in v0.13.4
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/extensibility)
Meta Meta `json:"_meta,omitempty"`
}
Request parameters for the logout method.
Terminates the current authenticated session.
func (*LogoutRequest) UnmarshalJSON ¶ added in v0.15.0
func (v *LogoutRequest) UnmarshalJSON(b []byte) error
func (*LogoutRequest) Validate ¶ added in v0.13.4
func (v *LogoutRequest) Validate() error
type LogoutResponse ¶ added in v0.13.4
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/extensibility)
Meta Meta `json:"_meta,omitempty"`
}
Response to the 'logout' method.
func (*LogoutResponse) UnmarshalJSON ¶ added in v0.15.0
func (v *LogoutResponse) UnmarshalJSON(b []byte) error
func (*LogoutResponse) Validate ¶ added in v0.13.4
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 Meta `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,omitempty"`
// Agent supports 'http' MCP servers.
//
// Defaults to false if unset.
Http bool `json:"http,omitempty"`
// Agent supports 'sse' MCP servers.
//
// Defaults to false if unset.
Sse bool `json:"sse,omitempty"`
}
MCP capabilities supported by the agent
func (McpCapabilities) MarshalJSON ¶
func (v McpCapabilities) MarshalJSON() ([]byte, error)
func (*McpCapabilities) UnmarshalJSON ¶
func (v *McpCapabilities) UnmarshalJSON(b []byte) 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) MarshalJSON ¶
func (*McpServer) UnmarshalJSON ¶
type McpServerAcp ¶ added in v0.13.0
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 Meta `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'.
func (*McpServerAcp) UnmarshalJSON ¶ added in v0.15.0
func (v *McpServerAcp) UnmarshalJSON(b []byte) error
type McpServerAcpId ¶ added in v0.13.0
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 ¶ added in v0.13.0
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 Meta `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.
func (*McpServerAcpInline) UnmarshalJSON ¶ added in v0.15.0
func (v *McpServerAcpInline) UnmarshalJSON(b []byte) error
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/extensibility)
Meta Meta `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.
func (McpServerHttp) MarshalJSON ¶ added in v0.14.0
func (v McpServerHttp) MarshalJSON() ([]byte, error)
func (*McpServerHttp) UnmarshalJSON ¶ added in v0.15.0
func (v *McpServerHttp) UnmarshalJSON(b []byte) error
type McpServerHttpInline ¶ added in v0.10.8
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/extensibility)
Meta Meta `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'.
func (McpServerHttpInline) MarshalJSON ¶ added in v0.14.0
func (v McpServerHttpInline) MarshalJSON() ([]byte, error)
func (*McpServerHttpInline) UnmarshalJSON ¶ added in v0.15.0
func (v *McpServerHttpInline) UnmarshalJSON(b []byte) error
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/extensibility)
Meta Meta `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.
func (McpServerSse) MarshalJSON ¶ added in v0.14.0
func (v McpServerSse) MarshalJSON() ([]byte, error)
func (*McpServerSse) UnmarshalJSON ¶ added in v0.15.0
func (v *McpServerSse) UnmarshalJSON(b []byte) error
type McpServerSseInline ¶ added in v0.10.8
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/extensibility)
Meta Meta `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'.
func (McpServerSseInline) MarshalJSON ¶ added in v0.14.0
func (v McpServerSseInline) MarshalJSON() ([]byte, error)
func (*McpServerSseInline) UnmarshalJSON ¶ added in v0.15.0
func (v *McpServerSseInline) UnmarshalJSON(b []byte) error
type McpServerStdio ¶ added in v0.6.3
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/extensibility)
Meta Meta `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.
func (McpServerStdio) MarshalJSON ¶ added in v0.14.0
func (v McpServerStdio) MarshalJSON() ([]byte, error)
func (*McpServerStdio) UnmarshalJSON ¶ added in v0.15.0
func (v *McpServerStdio) UnmarshalJSON(b []byte) error
type MessageId ¶ added in v0.14.0
type MessageId string
Unique identifier for a message within a session.
type Meta ¶ added in v0.20.0
type Meta map[string]json.RawMessage
Meta is the _meta member of an ACP type: data that a client or an agent attaches for its own use. ACP gives its keys no meaning. Each value holds the JSON as it was read, so a number keeps every digit.
Read a value with Get and write one with Set, or use the map directly. An empty Meta is left out of the encoded message.
func NewMeta ¶ added in v0.20.0
NewMeta returns a Meta with each value of values encoded as JSON. It returns nil for no values.
type MethodHandler ¶
type MethodHandler func(ctx context.Context, method string, params json.RawMessage) (any, *RequestError)
type MultiSelectItems ¶ added in v0.16.0
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) MarshalJSON ¶ added in v0.16.0
func (u MultiSelectItems) MarshalJSON() ([]byte, error)
func (*MultiSelectItems) UnmarshalJSON ¶ added in v0.16.0
func (u *MultiSelectItems) UnmarshalJSON(b []byte) error
type MultiSelectItemsOther ¶ added in v0.16.0
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"`
// AdditionalProperties holds the members that the schema does not name.
AdditionalProperties map[string]json.RawMessage `json:"-"`
}
Custom or future typed multi-select items.
func (MultiSelectItemsOther) MarshalJSON ¶ added in v0.16.0
func (v MultiSelectItemsOther) MarshalJSON() ([]byte, error)
func (*MultiSelectItemsOther) UnmarshalJSON ¶ added in v0.16.0
func (v *MultiSelectItemsOther) UnmarshalJSON(b []byte) error
type MultiSelectItemsString ¶ added in v0.16.0
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 Meta `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.
func (MultiSelectItemsString) MarshalJSON ¶ added in v0.16.0
func (v MultiSelectItemsString) MarshalJSON() ([]byte, error)
func (*MultiSelectItemsString) UnmarshalJSON ¶ added in v0.16.0
func (v *MultiSelectItemsString) UnmarshalJSON(b []byte) error
type MultiSelectPropertySchema ¶ added in v0.16.0
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 Meta `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,omitempty"`
// 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 *int64 `json:"maxItems,omitempty"`
// Minimum number of items to select.
//
// Optional. Omitted and 'null' are equivalent and mean there is no minimum selection count.
MinItems *int64 `json:"minItems,omitempty"`
// Optional title for the property.
//
// Optional. Omitted and 'null' are equivalent and mean no title is provided.
Title *string `json:"title,omitempty"`
}
Schema for multi-select (array) properties in an elicitation form.
func (*MultiSelectPropertySchema) UnmarshalJSON ¶ added in v0.16.0
func (v *MultiSelectPropertySchema) UnmarshalJSON(b []byte) error
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 Meta `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,
// and SHOULD NOT send other 'session/update' notifications caused by applying them
// before it responds.
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,omitempty"`
}
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) MarshalJSON ¶ added in v0.14.0
func (v NewSessionRequest) MarshalJSON() ([]byte, error)
func (*NewSessionRequest) UnmarshalJSON ¶ added in v0.15.0
func (v *NewSessionRequest) UnmarshalJSON(b []byte) error
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/extensibility)
Meta Meta `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/session-modes)
Modes *SessionModeState `json:"modes,omitempty"`
// 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/session-setup#creating-a-session)
func (*NewSessionResponse) UnmarshalJSON ¶ added in v0.14.0
func (v *NewSessionResponse) UnmarshalJSON(b []byte) error
func (*NewSessionResponse) Validate ¶
func (v *NewSessionResponse) Validate() error
type Notice ¶ added in v0.17.0
type Notice struct {
// Metadata scoped to this notice.
//
// Omitted and 'null' are equivalent and mean no metadata was supplied.
Meta Meta `json:"_meta,omitempty"`
// Optional plain-text detail or guidance.
//
// Omitted and 'null' are equivalent and mean no description was supplied.
Description *string `json:"description,omitempty"`
// 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)
func (*Notice) UnmarshalJSON ¶ added in v0.17.0
type NoticeCapabilities ¶ added in v0.17.0
type NoticeCapabilities struct{}
Client support for presenting live notices to the user.
type NoticeSeverity ¶ added in v0.17.0
type NoticeSeverity string
Severity hint for a session notice.
const ( // Informational notice. NoticeSeverityInfo NoticeSeverity = "info" // Warning notice. NoticeSeverityWarning NoticeSeverity = "warning" // Error notice. NoticeSeverityError NoticeSeverity = "error" )
type NumberPropertySchema ¶ added in v0.16.0
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 Meta `json:"_meta,omitempty"`
// Default value.
//
// Optional. Omitted and 'null' are equivalent and mean no default value is provided.
Default *float64 `json:"default,omitempty"`
// Human-readable description.
//
// Optional. Omitted and 'null' are equivalent and mean no description is provided.
Description *string `json:"description,omitempty"`
// Maximum value (inclusive).
//
// Optional. Omitted and 'null' are equivalent and mean there is no inclusive upper bound.
Maximum *float64 `json:"maximum,omitempty"`
// Minimum value (inclusive).
//
// Optional. Omitted and 'null' are equivalent and mean there is no inclusive lower bound.
Minimum *float64 `json:"minimum,omitempty"`
// Optional title for the property.
//
// Optional. Omitted and 'null' are equivalent and mean no title is provided.
Title *string `json:"title,omitempty"`
}
Schema for number (floating-point) properties in an elicitation form.
func (*NumberPropertySchema) UnmarshalJSON ¶ added in v0.16.0
func (v *NumberPropertySchema) UnmarshalJSON(b []byte) error
type Patch ¶ added in v0.20.0
type Patch[T any] struct { // contains filtered or unexported fields }
Patch is a field of an update that changes a value the receiver stores. It has three states, one per form of the member on the wire:
- unset (the zero value): the member is absent, and the stored value stays as it is;
- null: the member is null, which clears the stored value, unless the field's documentation says otherwise;
- set: the member holds a value, which replaces the stored one.
In ACP v1 a null in a ToolCallUpdate does not clear: the protocol docs say that it leaves name, rawInput, and rawOutput unchanged, and the Rust SDK reads null in every ToolCallUpdate field as absent. Treat IsNull there like IsUnset. A set Patch whose value encodes as JSON null, such as a nil json.RawMessage or a nil pointer, is null on the wire and reads back as IsNull.
Make one with PatchSet, PatchNull, or PatchFromPtr, and read it with Value, Ptr, IsNull, and IsUnset. The structs of this package leave the member out when the field is unset. In a struct of your own, tag the field omitzero (Go 1.24 or later) to do the same: omitempty never leaves out a struct, so it writes an unset Patch as null.
func PatchFromPtr ¶ added in v0.20.0
PatchFromPtr returns the Patch that replaces the stored value with *p, or an unset Patch, which leaves the stored value as it is, for a nil p.
func PatchSet ¶ added in v0.20.0
PatchSet returns the Patch that replaces the stored value with v. A nil slice or map is written as an empty one, so that it does not read as null, unless its type has a MarshalJSON method: a nil json.RawMessage is null. A nil pointer is null too. A []byte is written as encoding/json writes it, except that a nil one is []: an empty one is "".
func (Patch[T]) IsUnset ¶ added in v0.20.0
IsUnset reports whether p leaves the stored value as it is.
func (Patch[T]) MarshalJSON ¶ added in v0.20.0
MarshalJSON writes the value of a set Patch, and null otherwise. Only the struct that holds an unset Patch can leave the member out (see Patch).
func (Patch[T]) Ptr ¶ added in v0.20.0
func (p Patch[T]) Ptr() *T
Ptr returns a pointer to a copy of the value of a set Patch, and nil when p is unset or null.
func (*Patch[T]) UnmarshalJSON ¶ added in v0.20.0
UnmarshalJSON reads null as a Patch that clears the stored value, and any other JSON as a value of T. encoding/json calls it only for a member that is there, so an absent member leaves the Patch unset.
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/extensibility)
Meta Meta `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.
func (*PermissionOption) UnmarshalJSON ¶ added in v0.15.0
func (v *PermissionOption) UnmarshalJSON(b []byte) error
type PermissionOptionKind ¶
type PermissionOptionKind string
The type of permission option being presented to the user.
Helps clients choose appropriate icons and UI treatment.
const ( // Allow this operation only this time. PermissionOptionKindAllowOnce PermissionOptionKind = "allow_once" // Allow this operation and remember the choice. PermissionOptionKindAllowAlways PermissionOptionKind = "allow_always" // Reject this operation only this time. PermissionOptionKindRejectOnce PermissionOptionKind = "reject_once" // Reject this operation and remember the choice. 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/extensibility)
Meta Meta `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/agent-plan)
func (Plan) MarshalJSON ¶ added in v0.14.0
func (*Plan) UnmarshalJSON ¶ added in v0.14.0
type PlanCapabilities ¶ added in v0.13.4
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 Meta `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.
func (*PlanCapabilities) UnmarshalJSON ¶ added in v0.15.0
func (v *PlanCapabilities) UnmarshalJSON(b []byte) error
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/extensibility)
Meta Meta `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/agent-plan#plan-entries)
func (*PlanEntry) UnmarshalJSON ¶ added in v0.15.0
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/agent-plan#plan-entries)
const ( // High priority task - critical to the overall goal. PlanEntryPriorityHigh PlanEntryPriority = "high" // Medium priority task - important but not critical. PlanEntryPriorityMedium PlanEntryPriority = "medium" // Low priority task - nice to have but not essential. 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/agent-plan#plan-entries)
const ( // The task has not started yet. PlanEntryStatusPending PlanEntryStatus = "pending" // The task is currently being worked on. PlanEntryStatusInProgress PlanEntryStatus = "in_progress" // The task has been successfully completed. PlanEntryStatusCompleted PlanEntryStatus = "completed" )
type PlanId ¶ added in v0.13.4
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 ¶ added in v0.13.4
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 Meta `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.
func (PlanItems) MarshalJSON ¶ added in v0.14.0
func (*PlanItems) UnmarshalJSON ¶ added in v0.14.0
type PlanMarkdown ¶ added in v0.13.4
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 Meta `json:"_meta,omitempty"`
// Markdown content for the plan.
Content string `json:"content"`
// The absolute path of the file that holds this plan.
//
// This field is optional. Omitting it or sending 'null' both mean that the plan
// has no file. 'content' is the plan to display whether or not 'path' is set.
// Clients can use 'path' to open the file.
Path *string `json:"path,omitempty"`
// 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.
func (*PlanMarkdown) UnmarshalJSON ¶ added in v0.15.0
func (v *PlanMarkdown) UnmarshalJSON(b []byte) error
type PlanRemoved ¶ added in v0.13.4
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 Meta `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.
func (*PlanRemoved) UnmarshalJSON ¶ added in v0.15.0
func (v *PlanRemoved) UnmarshalJSON(b []byte) error
type PlanUpdate ¶ added in v0.13.4
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 Meta `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.
func (*PlanUpdate) UnmarshalJSON ¶ added in v0.15.0
func (v *PlanUpdate) UnmarshalJSON(b []byte) error
type PlanUpdateContent ¶ added in v0.13.4
type PlanUpdateContent struct {
// Structured plan entries.
Items *PlanUpdateContentItems `json:"-"`
// Raw markdown content for the plan.
Markdown *PlanUpdateContentMarkdown `json:"-"`
}
func NewPlanUpdateContentItems ¶ added in v0.13.4
func NewPlanUpdateContentItems(planId PlanId, entries []PlanEntry) PlanUpdateContent
NewPlanUpdateContentItems constructs a PlanUpdateContent using the 'items' variant.
func NewPlanUpdateContentMarkdown ¶ added in v0.13.4
func NewPlanUpdateContentMarkdown(planId PlanId, content string) PlanUpdateContent
NewPlanUpdateContentMarkdown constructs a PlanUpdateContent using the 'markdown' variant.
func (PlanUpdateContent) MarshalJSON ¶ added in v0.13.4
func (u PlanUpdateContent) MarshalJSON() ([]byte, error)
func (*PlanUpdateContent) UnmarshalJSON ¶ added in v0.13.4
func (u *PlanUpdateContent) UnmarshalJSON(b []byte) error
func (*PlanUpdateContent) Validate ¶ added in v0.13.4
func (u *PlanUpdateContent) Validate() error
type PlanUpdateContentItems ¶ added in v0.13.4
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 Meta `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.
func (PlanUpdateContentItems) MarshalJSON ¶ added in v0.14.0
func (v PlanUpdateContentItems) MarshalJSON() ([]byte, error)
func (*PlanUpdateContentItems) UnmarshalJSON ¶ added in v0.14.0
func (v *PlanUpdateContentItems) UnmarshalJSON(b []byte) error
type PlanUpdateContentMarkdown ¶ added in v0.13.4
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 Meta `json:"_meta,omitempty"`
// Markdown content for the plan.
Content string `json:"content"`
// The absolute path of the file that holds this plan.
//
// This field is optional. Omitting it or sending 'null' both mean that the plan
// has no file. 'content' is the plan to display whether or not 'path' is set.
// Clients can use 'path' to open the file.
Path *string `json:"path,omitempty"`
// The plan ID to update.
PlanId PlanId `json:"planId"`
Type string `json:"type"`
}
Raw markdown content for the plan.
func (*PlanUpdateContentMarkdown) UnmarshalJSON ¶ added in v0.15.0
func (v *PlanUpdateContentMarkdown) UnmarshalJSON(b []byte) error
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/extensibility)
Meta Meta `json:"_meta,omitempty"`
// Agent supports 'audio' content blocks.
//
// Defaults to false if unset.
Audio bool `json:"audio,omitempty"`
// 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,omitempty"`
// Agent supports 'image' content blocks.
//
// Defaults to false if unset.
Image bool `json:"image,omitempty"`
}
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/initialization#prompt-capabilities)
func (PromptCapabilities) MarshalJSON ¶
func (v PromptCapabilities) MarshalJSON() ([]byte, error)
func (*PromptCapabilities) UnmarshalJSON ¶
func (v *PromptCapabilities) UnmarshalJSON(b []byte) 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/extensibility)
Meta Meta `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/prompt-turn#1-user-message)
func (PromptRequest) MarshalJSON ¶ added in v0.14.0
func (v PromptRequest) MarshalJSON() ([]byte, error)
func (*PromptRequest) UnmarshalJSON ¶ added in v0.15.0
func (v *PromptRequest) UnmarshalJSON(b []byte) error
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 Meta `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,omitempty"`
}
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) UnmarshalJSON ¶ added in v0.14.0
func (v *PromptResponse) UnmarshalJSON(b []byte) error
func (*PromptResponse) Validate ¶
func (v *PromptResponse) Validate() error
type PromptSuggestion ¶ added in v0.18.0
type PromptSuggestion 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 Meta `json:"_meta,omitempty"`
// The content of the suggested prompt.
//
// Required and non-null. Must contain at least one content block. This is
// the same type as the 'prompt' field of 'session/prompt', and the Client
// can send it in that field unchanged.
//
// Agents MUST only use 'text' and 'resource_link' content blocks, and
// other content block types that both the Agent's prompt capabilities
// and the Client's 'session.promptSuggestions' capability advertise.
// Agents MUST NOT send a prompt whose only content is empty or
// whitespace-only text.
Prompt []ContentBlock `json:"prompt"`
}
**UNSTABLE**
This capability is not part of the spec yet, and may be removed or changed at any point.
A prompt the Agent predicts the user will send next.
func (PromptSuggestion) MarshalJSON ¶ added in v0.18.0
func (v PromptSuggestion) MarshalJSON() ([]byte, error)
func (*PromptSuggestion) UnmarshalJSON ¶ added in v0.18.0
func (v *PromptSuggestion) UnmarshalJSON(b []byte) error
type PromptSuggestionsAudioCapabilities ¶ added in v0.18.0
type PromptSuggestionsAudioCapabilities 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 Meta `json:"_meta,omitempty"`
}
**UNSTABLE**
This capability is not part of the spec yet, and may be removed or changed at any point.
Capabilities for audio content in prompt suggestions.
Supplying '{}' means the client can offer suggestions that include audio.
func (*PromptSuggestionsAudioCapabilities) UnmarshalJSON ¶ added in v0.18.0
func (v *PromptSuggestionsAudioCapabilities) UnmarshalJSON(b []byte) error
type PromptSuggestionsCapabilities ¶ added in v0.18.0
type PromptSuggestionsCapabilities 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 Meta `json:"_meta,omitempty"`
// Whether prompt suggestions may include 'audio' content blocks.
//
// Optional. Omitted or 'null' both mean the client does not advertise support.
// Supplying '{}' means the client can offer suggestions that include audio.
Audio *PromptSuggestionsAudioCapabilities `json:"audio,omitempty"`
// Whether prompt suggestions may include 'resource' content blocks.
//
// Optional. Omitted or 'null' both mean the client does not advertise support.
// Supplying '{}' means the client can offer suggestions that include
// embedded resources.
EmbeddedContext *PromptSuggestionsEmbeddedContextCapabilities `json:"embeddedContext,omitempty"`
// Whether prompt suggestions may include 'image' content blocks.
//
// Optional. Omitted or 'null' both mean the client does not advertise support.
// Supplying '{}' means the client can offer suggestions that include images.
Image *PromptSuggestionsImageCapabilities `json:"image,omitempty"`
}
**UNSTABLE**
This capability is not part of the spec yet, and may be removed or changed at any point.
Client support for 'prompt_suggestions_update' session updates.
Supplying '{}' means the client can offer prompt suggestions made of 'text' and 'resource_link' content blocks. The client opts in to other content block types with the fields below. They have the same names as the agent's prompt capabilities.
func (*PromptSuggestionsCapabilities) UnmarshalJSON ¶ added in v0.18.0
func (v *PromptSuggestionsCapabilities) UnmarshalJSON(b []byte) error
type PromptSuggestionsEmbeddedContextCapabilities ¶ added in v0.18.0
type PromptSuggestionsEmbeddedContextCapabilities 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 Meta `json:"_meta,omitempty"`
}
**UNSTABLE**
This capability is not part of the spec yet, and may be removed or changed at any point.
Capabilities for embedded resources in prompt suggestions.
Supplying '{}' means the client can offer suggestions that include 'resource' content blocks.
func (*PromptSuggestionsEmbeddedContextCapabilities) UnmarshalJSON ¶ added in v0.18.0
func (v *PromptSuggestionsEmbeddedContextCapabilities) UnmarshalJSON(b []byte) error
type PromptSuggestionsImageCapabilities ¶ added in v0.18.0
type PromptSuggestionsImageCapabilities 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 Meta `json:"_meta,omitempty"`
}
**UNSTABLE**
This capability is not part of the spec yet, and may be removed or changed at any point.
Capabilities for image content in prompt suggestions.
Supplying '{}' means the client can offer suggestions that include images.
func (*PromptSuggestionsImageCapabilities) UnmarshalJSON ¶ added in v0.18.0
func (v *PromptSuggestionsImageCapabilities) UnmarshalJSON(b []byte) error
type PromptSuggestionsUpdate ¶ added in v0.18.0
type PromptSuggestionsUpdate 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 Meta `json:"_meta,omitempty"`
// The suggestions the Client can offer, ordered most likely first.
//
// Required and non-null. An empty list withdraws the suggestions the
// Client is offering. A Client skips an entry it cannot parse and keeps
// the rest.
Suggestions []PromptSuggestion `json:"suggestions"`
}
**UNSTABLE**
This capability is not part of the spec yet, and may be removed or changed at any point.
Replaces the session's current list of prompt suggestions.
A prompt suggestion is a prompt the Agent predicts the user will send next. The Client offers suggestions where the user writes the next prompt. The list in the most recent update is the current list until the Agent sends another update. A session starts with an empty list.
Suggestions are not part of session history. Agents SHOULD NOT include this update when they replay a session.
Agents MUST only send this update when the Client advertised the 'session.promptSuggestions' Client capability.
func (PromptSuggestionsUpdate) MarshalJSON ¶ added in v0.18.0
func (v PromptSuggestionsUpdate) MarshalJSON() ([]byte, error)
func (*PromptSuggestionsUpdate) UnmarshalJSON ¶ added in v0.18.0
func (v *PromptSuggestionsUpdate) UnmarshalJSON(b []byte) 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 ¶ added in v0.11.7
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 Meta `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.
func (*ProvidersCapabilities) UnmarshalJSON ¶ added in v0.15.0
func (v *ProvidersCapabilities) UnmarshalJSON(b []byte) error
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/extensibility)
Meta Meta `json:"_meta,omitempty"`
// Maximum number of lines to read.
Limit *int64 `json:"limit,omitempty"`
// Line number to start reading from (1-based).
Line *int64 `json:"line,omitempty"`
// 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) UnmarshalJSON ¶ added in v0.15.0
func (v *ReadTextFileRequest) UnmarshalJSON(b []byte) error
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/extensibility)
Meta Meta `json:"_meta,omitempty"`
// Content payload returned by this response.
Content string `json:"content"`
}
Response containing the contents of a text file.
func (*ReadTextFileResponse) UnmarshalJSON ¶ added in v0.15.0
func (v *ReadTextFileResponse) UnmarshalJSON(b []byte) error
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/extensibility)
Meta Meta `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) UnmarshalJSON ¶ added in v0.15.0
func (v *ReleaseTerminalRequest) UnmarshalJSON(b []byte) error
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/extensibility)
Meta Meta `json:"_meta,omitempty"`
}
Response to terminal/release method
func (*ReleaseTerminalResponse) UnmarshalJSON ¶ added in v0.15.0
func (v *ReleaseTerminalResponse) UnmarshalJSON(b []byte) error
func (*ReleaseTerminalResponse) Validate ¶
func (v *ReleaseTerminalResponse) Validate() error
type RequestError ¶
type RequestError struct {
Code int `json:"code"`
Message string `json:"message"`
Data json.RawMessage `json:"data,omitempty"`
}
RequestError represents a JSON-RPC error response. Data holds the JSON of the error's data as it was read, so a number keeps every digit, and a "data": null stays null. The generated Error type reads "data": null as no data instead, as its schema asks. The New* constructors encode their data argument into Data. A request handler whose error has a Data that is not valid JSON answers with an internal error (-32603).
func NewAuthRequired ¶
func NewAuthRequired(data any) *RequestError
func NewInternalError ¶
func NewInternalError(data any) *RequestError
func NewInvalidParams ¶
func NewInvalidParams(data any) *RequestError
func NewInvalidRequest ¶
func NewInvalidRequest(data any) *RequestError
func NewMethodNotFound ¶
func NewMethodNotFound(method string) *RequestError
func NewParseError ¶
func NewParseError(data any) *RequestError
func NewRequestCancelled ¶ added in v0.10.8
func NewRequestCancelled(data any) *RequestError
func NewRequestError ¶ added in v0.20.0
func NewRequestError(code int, message string, data any) *RequestError
NewRequestError returns the error with code and message, and with data encoded as JSON. A nil data, or one that json.Marshal cannot encode, gives an error without data. The other New* constructors set a code of the JSON-RPC or ACP specification the same way.
func (*RequestError) Error ¶
func (e *RequestError) Error() string
type RequestId ¶ added in v0.10.8
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) MarshalJSON ¶ added in v0.10.8
func (*RequestId) UnmarshalJSON ¶ added in v0.10.8
type RequestIdNull ¶ added in v0.10.8
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 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/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) MarshalJSON ¶
func (u RequestPermissionOutcome) MarshalJSON() ([]byte, error)
func (*RequestPermissionOutcome) UnmarshalJSON ¶
func (u *RequestPermissionOutcome) UnmarshalJSON(b []byte) 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/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/extensibility)
Meta Meta `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.
func (*RequestPermissionOutcomeSelected) UnmarshalJSON ¶ added in v0.15.0
func (v *RequestPermissionOutcomeSelected) UnmarshalJSON(b []byte) error
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/extensibility)
Meta Meta `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/tool-calls#requesting-permission)
func (RequestPermissionRequest) MarshalJSON ¶ added in v0.14.0
func (v RequestPermissionRequest) MarshalJSON() ([]byte, error)
func (*RequestPermissionRequest) UnmarshalJSON ¶ added in v0.15.0
func (v *RequestPermissionRequest) UnmarshalJSON(b []byte) error
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/extensibility)
Meta Meta `json:"_meta,omitempty"`
// The user's decision on the permission request.
Outcome RequestPermissionOutcome `json:"outcome"`
}
Response to a permission request.
func (*RequestPermissionResponse) UnmarshalJSON ¶ added in v0.15.0
func (v *RequestPermissionResponse) UnmarshalJSON(b []byte) error
func (*RequestPermissionResponse) Validate ¶
func (v *RequestPermissionResponse) Validate() error
type RequiresActionStateUpdate ¶ added in v0.17.0
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 Meta `json:"_meta,omitempty"`
}
Foreground work is blocked on user action.
func (*RequiresActionStateUpdate) UnmarshalJSON ¶ added in v0.17.0
func (v *RequiresActionStateUpdate) UnmarshalJSON(b []byte) error
type ResourceLink ¶
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/extensibility)
Meta Meta `json:"_meta,omitempty"`
// Optional annotations that help clients decide how to display or route this content.
Annotations *Annotations `json:"annotations,omitempty"`
// Optional human-readable details shown with this protocol object.
Description *string `json:"description,omitempty"`
// MIME type describing the encoded media payload.
MimeType *string `json:"mimeType,omitempty"`
// Human-readable name shown for this protocol object.
Name string `json:"name"`
// Optional size of the linked resource in bytes, if known.
Size *int64 `json:"size,omitempty"`
// Optional display title for end-user UI.
Title *string `json:"title,omitempty"`
// 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.
func (*ResourceLink) UnmarshalJSON ¶ added in v0.14.0
func (v *ResourceLink) UnmarshalJSON(b []byte) error
type ResumeSessionRequest ¶ added in v0.12.2
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 Meta `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,omitempty"`
}
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) UnmarshalJSON ¶ added in v0.15.0
func (v *ResumeSessionRequest) UnmarshalJSON(b []byte) error
func (*ResumeSessionRequest) Validate ¶ added in v0.12.2
func (v *ResumeSessionRequest) Validate() error
type ResumeSessionResponse ¶ added in v0.12.2
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/extensibility)
Meta Meta `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/session-modes)
Modes *SessionModeState `json:"modes,omitempty"`
}
Response from resuming an existing session.
func (*ResumeSessionResponse) UnmarshalJSON ¶ added in v0.14.0
func (v *ResumeSessionResponse) UnmarshalJSON(b []byte) error
func (*ResumeSessionResponse) Validate ¶ added in v0.12.2
func (v *ResumeSessionResponse) Validate() error
type RunningStateUpdate ¶ added in v0.17.0
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 Meta `json:"_meta,omitempty"`
}
Foreground work is in progress.
func (*RunningStateUpdate) UnmarshalJSON ¶ added in v0.17.0
func (v *RunningStateUpdate) UnmarshalJSON(b []byte) error
type SelectedPermissionOutcome ¶ added in v0.10.8
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/extensibility)
Meta Meta `json:"_meta,omitempty"`
// The ID of the option the user selected.
OptionId PermissionOptionId `json:"optionId"`
}
The user selected one of the provided options.
func (*SelectedPermissionOutcome) UnmarshalJSON ¶ added in v0.15.0
func (v *SelectedPermissionOutcome) UnmarshalJSON(b []byte) error
type SessionAdditionalDirectoriesCapabilities ¶ added in v0.11.7
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/extensibility)
Meta Meta `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.
func (*SessionAdditionalDirectoriesCapabilities) UnmarshalJSON ¶ added in v0.15.0
func (v *SessionAdditionalDirectoriesCapabilities) UnmarshalJSON(b []byte) error
type SessionArchiveCapabilities ¶ added in v0.18.0
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 Meta `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'.
func (*SessionArchiveCapabilities) UnmarshalJSON ¶ added in v0.18.0
func (v *SessionArchiveCapabilities) UnmarshalJSON(b []byte) error
type SessionArchiveFilter ¶ added in v0.18.0
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 ( // Only sessions that are not archived. This is the default. SessionArchiveFilterExclude SessionArchiveFilter = "exclude" // Both archived sessions and sessions that are not archived. SessionArchiveFilterInclude SessionArchiveFilter = "include" // Only archived sessions. SessionArchiveFilterOnly SessionArchiveFilter = "only" )
type SessionAvailableCommandsUpdate ¶ added in v0.6.3
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/extensibility)
Meta Meta `json:"_meta,omitempty"`
// Commands the agent can execute
AvailableCommands []AvailableCommand `json:"availableCommands"`
SessionUpdate string `json:"sessionUpdate"`
}
Available commands are ready or have changed
func (SessionAvailableCommandsUpdate) MarshalJSON ¶ added in v0.14.0
func (v SessionAvailableCommandsUpdate) MarshalJSON() ([]byte, error)
func (*SessionAvailableCommandsUpdate) UnmarshalJSON ¶ added in v0.14.0
func (v *SessionAvailableCommandsUpdate) UnmarshalJSON(b []byte) error
type SessionCancelCapabilities ¶ added in v0.17.0
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 Meta `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.
func (*SessionCancelCapabilities) UnmarshalJSON ¶ added in v0.17.0
func (v *SessionCancelCapabilities) UnmarshalJSON(b []byte) error
type SessionCapabilities ¶ added in v0.10.8
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 Meta `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,omitempty"`
// **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,omitempty"`
// 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,omitempty"`
// 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,omitempty"`
// **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,omitempty"`
// 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,omitempty"`
// **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,omitempty"`
// 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,omitempty"`
// **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,omitempty"`
// 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,omitempty"`
// **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,omitempty"`
}
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)
func (*SessionCapabilities) UnmarshalJSON ¶ added in v0.14.0
func (v *SessionCapabilities) UnmarshalJSON(b []byte) error
type SessionCloseCapabilities ¶ added in v0.11.7
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/extensibility)
Meta Meta `json:"_meta,omitempty"`
}
Capabilities for the 'session/close' method.
Supplying '{}' means the agent supports closing sessions.
func (*SessionCloseCapabilities) UnmarshalJSON ¶ added in v0.15.0
func (v *SessionCloseCapabilities) UnmarshalJSON(b []byte) error
type SessionCompactionUpdate ¶ added in v0.16.0
type SessionCompactionUpdate struct {
// Extensible metadata patch for this compaction.
Meta Patch[Meta] `json:"_meta"`
// The Agent-owned ID of this compaction, unique within the session.
CompactionId CompactionId `json:"compactionId"`
// Human-readable error details for the compaction.
Error Patch[string] `json:"error"`
SessionUpdate string `json:"sessionUpdate"`
// Current lifecycle status.
Status CompactionStatus `json:"status"`
// Complete replacement user-displayable summary content for the compaction.
Summary Patch[[]ContentBlock] `json:"summary"`
}
A context compaction has been created or updated.
Agents MUST only send this update when the Client advertised the 'session.compaction' Client capability.
func (SessionCompactionUpdate) MarshalJSON ¶ added in v0.20.0
func (v SessionCompactionUpdate) MarshalJSON() ([]byte, error)
func (*SessionCompactionUpdate) UnmarshalJSON ¶ added in v0.16.0
func (v *SessionCompactionUpdate) UnmarshalJSON(b []byte) error
type SessionConfigBoolean ¶ added in v0.11.7
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 ¶ added in v0.10.8
type SessionConfigGroupId string
Unique identifier for a session configuration option value group.
type SessionConfigId ¶ added in v0.10.8
type SessionConfigId string
Unique identifier for a session configuration option.
type SessionConfigOption ¶ added in v0.10.8
type SessionConfigOption struct {
// Single-value selector (dropdown).
Select *SessionConfigOptionSelect `json:"-"`
// Boolean on/off toggle.
Boolean *SessionConfigOptionBoolean `json:"-"`
}
func NewSessionConfigOptionBoolean ¶ added in v0.11.7
func NewSessionConfigOptionBoolean(currentValue bool) SessionConfigOption
NewSessionConfigOptionBoolean constructs a SessionConfigOption using the 'boolean' variant.
func NewSessionConfigOptionSelect ¶ added in v0.10.8
func NewSessionConfigOptionSelect(currentValue SessionConfigValueId, options SessionConfigSelectOptions) SessionConfigOption
NewSessionConfigOptionSelect constructs a SessionConfigOption using the 'select' variant.
func (SessionConfigOption) MarshalJSON ¶ added in v0.10.8
func (u SessionConfigOption) MarshalJSON() ([]byte, error)
func (*SessionConfigOption) UnmarshalJSON ¶ added in v0.10.8
func (u *SessionConfigOption) UnmarshalJSON(b []byte) error
func (*SessionConfigOption) Validate ¶ added in v0.10.8
func (u *SessionConfigOption) Validate() error
type SessionConfigOptionBoolean ¶ added in v0.11.7
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/extensibility)
Meta Meta `json:"_meta,omitempty"`
// Optional semantic category for this option (UX only).
Category *SessionConfigOptionCategory `json:"category,omitempty"`
// 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,omitempty"`
// 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.
func (*SessionConfigOptionBoolean) UnmarshalJSON ¶ added in v0.14.0
func (v *SessionConfigOptionBoolean) UnmarshalJSON(b []byte) error
type SessionConfigOptionCategory ¶ added in v0.10.8
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 ( // Session mode selector. SessionConfigOptionCategoryMode SessionConfigOptionCategory = "mode" // Model selector. SessionConfigOptionCategoryModel SessionConfigOptionCategory = "model" // Model-related configuration parameter. SessionConfigOptionCategoryModelConfig SessionConfigOptionCategory = "model_config" // **UNSTABLE** // // This capability is not part of the spec yet, and may be removed or changed at any point. // // Response speed selector, such as a fast mode toggle. SessionConfigOptionCategorySpeed SessionConfigOptionCategory = "speed" // Thought/reasoning level selector. SessionConfigOptionCategoryThoughtLevel SessionConfigOptionCategory = "thought_level" )
type SessionConfigOptionSelect ¶ added in v0.10.8
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/extensibility)
Meta Meta `json:"_meta,omitempty"`
// Optional semantic category for this option (UX only).
Category *SessionConfigOptionCategory `json:"category,omitempty"`
// The currently selected value.
CurrentValue SessionConfigValueId `json:"currentValue"`
// Optional description for the Client to display to the user.
Description *string `json:"description,omitempty"`
// 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).
func (*SessionConfigOptionSelect) UnmarshalJSON ¶ added in v0.14.0
func (v *SessionConfigOptionSelect) UnmarshalJSON(b []byte) error
type SessionConfigOptionUpdate ¶ added in v0.10.8
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/extensibility)
Meta Meta `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.
func (SessionConfigOptionUpdate) MarshalJSON ¶ added in v0.14.0
func (v SessionConfigOptionUpdate) MarshalJSON() ([]byte, error)
func (*SessionConfigOptionUpdate) UnmarshalJSON ¶ added in v0.14.0
func (v *SessionConfigOptionUpdate) UnmarshalJSON(b []byte) error
type SessionConfigOptionsCapabilities ¶ added in v0.15.0
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/extensibility)
Meta Meta `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,omitempty"`
}
Session configuration option capabilities supported by the client.
func (*SessionConfigOptionsCapabilities) UnmarshalJSON ¶ added in v0.15.0
func (v *SessionConfigOptionsCapabilities) UnmarshalJSON(b []byte) error
type SessionConfigSelect ¶ added in v0.10.8
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 ¶ added in v0.10.8
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/extensibility)
Meta Meta `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.
func (SessionConfigSelectGroup) MarshalJSON ¶ added in v0.14.0
func (v SessionConfigSelectGroup) MarshalJSON() ([]byte, error)
func (*SessionConfigSelectGroup) UnmarshalJSON ¶ added in v0.15.0
func (v *SessionConfigSelectGroup) UnmarshalJSON(b []byte) error
type SessionConfigSelectOption ¶ added in v0.10.8
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/extensibility)
Meta Meta `json:"_meta,omitempty"`
// Optional description for this option value.
Description *string `json:"description,omitempty"`
// 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.
func (*SessionConfigSelectOption) UnmarshalJSON ¶ added in v0.15.0
func (v *SessionConfigSelectOption) UnmarshalJSON(b []byte) error
type SessionConfigSelectOptions ¶ added in v0.10.8
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) MarshalJSON ¶ added in v0.10.8
func (u SessionConfigSelectOptions) MarshalJSON() ([]byte, error)
func (*SessionConfigSelectOptions) UnmarshalJSON ¶ added in v0.10.8
func (u *SessionConfigSelectOptions) UnmarshalJSON(b []byte) error
type SessionConfigSelectOptionsGrouped ¶ added in v0.10.8
type SessionConfigSelectOptionsGrouped []SessionConfigSelectGroup
A list of options grouped under headers.
type SessionConfigSelectOptionsUngrouped ¶ added in v0.10.8
type SessionConfigSelectOptionsUngrouped []SessionConfigSelectOption
Possible values for a session configuration option. A flat list of options with no grouping.
type SessionConfigValueId ¶ added in v0.10.8
type SessionConfigValueId string
Unique identifier for a session configuration option value.
type SessionCurrentModeUpdate ¶ added in v0.6.3
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/extensibility)
Meta Meta `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)
func (*SessionCurrentModeUpdate) UnmarshalJSON ¶ added in v0.15.0
func (v *SessionCurrentModeUpdate) UnmarshalJSON(b []byte) error
type SessionDeleteCapabilities ¶ added in v0.13.4
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/extensibility)
Meta Meta `json:"_meta,omitempty"`
}
Capabilities for the 'session/delete' method.
Supplying '{}' means the agent supports deleting sessions from 'session/list'.
func (*SessionDeleteCapabilities) UnmarshalJSON ¶ added in v0.15.0
func (v *SessionDeleteCapabilities) UnmarshalJSON(b []byte) error
type SessionForkCapabilities ¶ added in v0.10.8
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 Meta `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.
func (*SessionForkCapabilities) UnmarshalJSON ¶ added in v0.15.0
func (v *SessionForkCapabilities) UnmarshalJSON(b []byte) error
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/session-setup#session-id)
type SessionInfo ¶ added in v0.11.7
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 Meta `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,omitempty"`
// 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,omitempty"`
// ISO 8601 timestamp of last activity
UpdatedAt *string `json:"updatedAt,omitempty"`
}
Information about a session returned by session/list
func (*SessionInfo) UnmarshalJSON ¶ added in v0.14.0
func (v *SessionInfo) UnmarshalJSON(b []byte) error
type SessionInfoUpdate ¶ added in v0.10.8
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/extensibility)
//
// ACP v1 does not say that null clears this field, and the Rust SDK
// reads null here as absent: treat IsNull like IsUnset.
Meta Patch[Meta] `json:"_meta"`
// Human-readable title for the session. Set to null to clear.
Title Patch[string] `json:"title"`
// ISO 8601 timestamp of last activity. Set to null to clear.
UpdatedAt Patch[string] `json:"updatedAt"`
}
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.
func (SessionInfoUpdate) MarshalJSON ¶ added in v0.20.0
func (v SessionInfoUpdate) MarshalJSON() ([]byte, error)
func (*SessionInfoUpdate) UnmarshalJSON ¶ added in v0.15.0
func (v *SessionInfoUpdate) UnmarshalJSON(b []byte) error
type SessionListCapabilities ¶ added in v0.10.8
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/extensibility)
Meta Meta `json:"_meta,omitempty"`
}
Capabilities for the 'session/list' method.
Supplying '{}' means the agent supports listing sessions.
func (*SessionListCapabilities) UnmarshalJSON ¶ added in v0.15.0
func (v *SessionListCapabilities) UnmarshalJSON(b []byte) error
type SessionMessage ¶ added in v0.17.0
type SessionMessage struct {
// Omitted leaves metadata unchanged. 'null' removes it.
//
// Implementations MUST NOT make assumptions about values in '_meta'.
Meta Patch[Meta] `json:"_meta"`
// Omitted leaves content unchanged. 'null' or '[]' clears it.
// A non-empty array replaces all content.
Content Patch[[]ContentBlock] `json:"content"`
// 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 Patch[MessageId] `json:"recipientMessageId"`
// The receiving session.
//
// Omitted leaves the stored value unchanged. 'null' clears it. A value replaces it.
RecipientSessionId Patch[SessionId] `json:"recipientSessionId"`
// 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 Patch[MessageId] `json:"senderMessageId"`
// The sending session.
//
// Omitted leaves the stored value unchanged. 'null' clears it. A value replaces it.
SenderSessionId Patch[SessionId] `json:"senderSessionId"`
}
**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.
func (SessionMessage) MarshalJSON ¶ added in v0.20.0
func (v SessionMessage) MarshalJSON() ([]byte, error)
func (*SessionMessage) UnmarshalJSON ¶ added in v0.17.0
func (v *SessionMessage) UnmarshalJSON(b []byte) error
type SessionMessageChunk ¶ added in v0.17.0
type SessionMessageChunk struct {
// Optional and nullable chunk-scoped metadata. Omitted or 'null' means none.
//
// Implementations MUST NOT make assumptions about values in '_meta'.
Meta Meta `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.
func (*SessionMessageChunk) UnmarshalJSON ¶ added in v0.17.0
func (v *SessionMessageChunk) UnmarshalJSON(b []byte) error
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/extensibility)
Meta Meta `json:"_meta,omitempty"`
// Optional human-readable details shown with this protocol object.
Description *string `json:"description,omitempty"`
// 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/session-modes)
func (*SessionMode) UnmarshalJSON ¶ added in v0.15.0
func (v *SessionMode) UnmarshalJSON(b []byte) error
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/extensibility)
Meta Meta `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.
func (SessionModeState) MarshalJSON ¶ added in v0.14.0
func (v SessionModeState) MarshalJSON() ([]byte, error)
func (*SessionModeState) UnmarshalJSON ¶ added in v0.14.0
func (v *SessionModeState) UnmarshalJSON(b []byte) error
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/extensibility)
Meta Meta `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/prompt-turn#3-agent-reports-output)
func (*SessionNotification) UnmarshalJSON ¶ added in v0.15.0
func (v *SessionNotification) UnmarshalJSON(b []byte) error
func (*SessionNotification) Validate ¶
func (v *SessionNotification) Validate() error
type SessionOptionsCapabilities ¶ added in v0.18.0
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 Meta `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.
func (*SessionOptionsCapabilities) UnmarshalJSON ¶ added in v0.18.0
func (v *SessionOptionsCapabilities) UnmarshalJSON(b []byte) error
type SessionPlanUpdate ¶ added in v0.13.4
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 Meta `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.
func (*SessionPlanUpdate) UnmarshalJSON ¶ added in v0.15.0
func (v *SessionPlanUpdate) UnmarshalJSON(b []byte) error
type SessionPromptSuggestionsUpdate ¶ added in v0.18.0
type SessionPromptSuggestionsUpdate 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 Meta `json:"_meta,omitempty"`
SessionUpdate string `json:"sessionUpdate"`
// The suggestions the Client can offer, ordered most likely first.
//
// Required and non-null. An empty list withdraws the suggestions the
// Client is offering. A Client skips an entry it cannot parse and keeps
// the rest.
Suggestions []PromptSuggestion `json:"suggestions"`
}
**UNSTABLE**
This capability is not part of the spec yet, and may be removed or changed at any point.
Replaces the session's current list of prompt suggestions.
Agents MUST only send this update when the Client advertised the 'session.promptSuggestions' Client capability.
func (SessionPromptSuggestionsUpdate) MarshalJSON ¶ added in v0.18.0
func (v SessionPromptSuggestionsUpdate) MarshalJSON() ([]byte, error)
func (*SessionPromptSuggestionsUpdate) UnmarshalJSON ¶ added in v0.18.0
func (v *SessionPromptSuggestionsUpdate) UnmarshalJSON(b []byte) error
type SessionReference ¶ added in v0.18.0
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 Meta `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.
func (*SessionReference) UnmarshalJSON ¶ added in v0.18.0
func (v *SessionReference) UnmarshalJSON(b []byte) error
type SessionResumeCapabilities ¶ added in v0.10.8
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/extensibility)
Meta Meta `json:"_meta,omitempty"`
}
Capabilities for the 'session/resume' method.
Supplying '{}' means the agent supports resuming sessions.
func (*SessionResumeCapabilities) UnmarshalJSON ¶ added in v0.15.0
func (v *SessionResumeCapabilities) UnmarshalJSON(b []byte) error
type SessionSessionInfoUpdate ¶ added in v0.10.8
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/extensibility)
//
// ACP v1 does not say that null clears this field, and the Rust SDK
// reads null here as absent: treat IsNull like IsUnset.
Meta Patch[Meta] `json:"_meta"`
SessionUpdate string `json:"sessionUpdate"`
// Human-readable title for the session. Set to null to clear.
Title Patch[string] `json:"title"`
// ISO 8601 timestamp of last activity. Set to null to clear.
UpdatedAt Patch[string] `json:"updatedAt"`
}
Session metadata has been updated (title, timestamps, custom metadata)
func (SessionSessionInfoUpdate) MarshalJSON ¶ added in v0.20.0
func (v SessionSessionInfoUpdate) MarshalJSON() ([]byte, error)
func (*SessionSessionInfoUpdate) UnmarshalJSON ¶ added in v0.15.0
func (v *SessionSessionInfoUpdate) UnmarshalJSON(b []byte) error
type SessionStatusCapabilities ¶ added in v0.18.0
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 Meta `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.
func (*SessionStatusCapabilities) UnmarshalJSON ¶ added in v0.18.0
func (v *SessionStatusCapabilities) UnmarshalJSON(b []byte) error
type SessionSubagentUpdate ¶ added in v0.17.0
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 Patch[Meta] `json:"_meta"`
// 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 Patch[[]string] `json:"additionalDirectories"`
// 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 Patch[SubagentSessionCapabilities] `json:"capabilities"`
// 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 Patch[string] `json:"cwd"`
// 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 Patch[string] `json:"description"`
// 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 Patch[StateUpdate] `json:"state"`
// 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 Patch[string] `json:"title"`
}
**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.
func (SessionSubagentUpdate) MarshalJSON ¶ added in v0.20.0
func (v SessionSubagentUpdate) MarshalJSON() ([]byte, error)
func (*SessionSubagentUpdate) UnmarshalJSON ¶ added in v0.17.0
func (v *SessionSubagentUpdate) UnmarshalJSON(b []byte) error
type SessionSystemPromptCapabilities ¶ added in v0.18.0
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/extensibility)
Meta Meta `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,omitempty"`
}
Capabilities for client-provided system prompts.
Supplying '{}' means the agent supports 'systemPrompt' on session lifecycle requests in 'append' mode.
func (*SessionSystemPromptCapabilities) UnmarshalJSON ¶ added in v0.18.0
func (v *SessionSystemPromptCapabilities) UnmarshalJSON(b []byte) error
type SessionSystemPromptModeCapabilities ¶ added in v0.18.0
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/extensibility)
Meta Meta `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,omitempty"`
}
System prompt delivery modes the agent supports in addition to 'append'.
'append' has no entry because every agent advertising 'sessionCapabilities.systemPrompt' supports it.
func (*SessionSystemPromptModeCapabilities) UnmarshalJSON ¶ added in v0.18.0
func (v *SessionSystemPromptModeCapabilities) UnmarshalJSON(b []byte) error
type SessionSystemPromptOverrideCapabilities ¶ added in v0.18.0
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/extensibility)
Meta Meta `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.
func (*SessionSystemPromptOverrideCapabilities) UnmarshalJSON ¶ added in v0.18.0
func (v *SessionSystemPromptOverrideCapabilities) UnmarshalJSON(b []byte) error
type SessionTitleCapabilities ¶ added in v0.18.0
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 Meta `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.
func (*SessionTitleCapabilities) UnmarshalJSON ¶ added in v0.18.0
func (v *SessionTitleCapabilities) UnmarshalJSON(b []byte) error
type SessionToolCallUpdate ¶ added in v0.6.3
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/extensibility)
//
// ACP v1 does not say that null clears this field, and the Rust SDK
// reads null here as absent: treat IsNull like IsUnset.
Meta Patch[Meta] `json:"_meta"`
// Replace the content collection.
//
// ACP v1 does not say that null clears this field, and the Rust SDK
// reads null here as absent: treat IsNull like IsUnset.
Content Patch[[]ToolCallContent] `json:"content"`
// Update the tool kind.
//
// ACP v1 does not say that null clears this field, and the Rust SDK
// reads null here as absent: treat IsNull like IsUnset.
Kind Patch[ToolKind] `json:"kind"`
// Replace the locations collection.
//
// ACP v1 does not say that null clears this field, and the Rust SDK
// reads null here as absent: treat IsNull like IsUnset.
Locations Patch[[]ToolCallLocation] `json:"locations"`
// 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 Patch[string] `json:"name"`
// Update the raw input.
//
// ACP v1 does not say that null clears this field, and the Rust SDK
// reads null here as absent: treat IsNull like IsUnset.
RawInput Patch[json.RawMessage] `json:"rawInput"`
// Update the raw output.
//
// ACP v1 does not say that null clears this field, and the Rust SDK
// reads null here as absent: treat IsNull like IsUnset.
RawOutput Patch[json.RawMessage] `json:"rawOutput"`
SessionUpdate string `json:"sessionUpdate"`
// Update the execution status.
//
// ACP v1 does not say that null clears this field, and the Rust SDK
// reads null here as absent: treat IsNull like IsUnset.
Status Patch[ToolCallStatus] `json:"status"`
// Update the human-readable title.
//
// ACP v1 does not say that null clears this field, and the Rust SDK
// reads null here as absent: treat IsNull like IsUnset.
Title Patch[string] `json:"title"`
// The ID of the tool call being updated.
ToolCallId ToolCallId `json:"toolCallId"`
}
Update on the status or results of a tool call.
func (SessionToolCallUpdate) MarshalJSON ¶ added in v0.20.0
func (v SessionToolCallUpdate) MarshalJSON() ([]byte, error)
func (*SessionToolCallUpdate) UnmarshalJSON ¶ added in v0.14.0
func (v *SessionToolCallUpdate) UnmarshalJSON(b []byte) error
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.
//
// Replaces the session's current list of prompt suggestions.
//
// Agents MUST only send this update when the Client advertised
// the 'session.promptSuggestions' Client capability.
PromptSuggestionsUpdate *SessionPromptSuggestionsUpdate `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 StartEditToolCall ¶
func StartEditToolCall(id ToolCallId, title string, path string, content any, opts ...ToolCallStartOpt) SessionUpdate
StartEditToolCall constructs a 'tool_call' update for editing content: kind=edit, status=pending, locations=[{path}], rawInput={path, content}.
func StartReadToolCall ¶
func StartReadToolCall(id ToolCallId, title string, path string, opts ...ToolCallStartOpt) SessionUpdate
StartReadToolCall constructs a 'tool_call' update for reading a file: kind=read, status=pending, locations=[{path}], rawInput={path}.
func StartToolCall ¶
func StartToolCall(id ToolCallId, title string, opts ...ToolCallStartOpt) SessionUpdate
StartToolCall constructs a tool_call update with required fields and applies optional modifiers.
func UpdateAgentMessage ¶
func UpdateAgentMessage(content ContentBlock) SessionUpdate
UpdateAgentMessage constructs an agent_message_chunk update with the given content.
func UpdateAgentMessageText ¶
func UpdateAgentMessageText(text string) SessionUpdate
UpdateAgentMessageText constructs an agent_message_chunk update from text.
func UpdateAgentThought ¶
func UpdateAgentThought(content ContentBlock) SessionUpdate
UpdateAgentThought constructs an agent_thought_chunk update with the given content.
func UpdateAgentThoughtText ¶
func UpdateAgentThoughtText(text string) SessionUpdate
UpdateAgentThoughtText constructs an agent_thought_chunk update from text.
func UpdatePlan ¶
func UpdatePlan(entries ...PlanEntry) SessionUpdate
UpdatePlan constructs a plan update with the provided entries.
func UpdateToolCall ¶
func UpdateToolCall(id ToolCallId, opts ...ToolCallUpdateOpt) SessionUpdate
UpdateToolCall constructs a tool_call_update with the given ID and applies optional modifiers.
func UpdateUserMessage ¶
func UpdateUserMessage(content ContentBlock) SessionUpdate
UpdateUserMessage constructs a user_message_chunk update with the given content.
func UpdateUserMessageText ¶
func UpdateUserMessageText(text string) SessionUpdate
UpdateUserMessageText constructs a user_message_chunk update from text.
func (SessionUpdate) MarshalJSON ¶
func (u SessionUpdate) MarshalJSON() ([]byte, error)
func (*SessionUpdate) UnmarshalJSON ¶
func (u *SessionUpdate) UnmarshalJSON(b []byte) 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/extensibility)
Meta Meta `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,omitempty"`
SessionUpdate string `json:"sessionUpdate"`
}
A chunk of the agent's response being streamed.
func (*SessionUpdateAgentMessageChunk) UnmarshalJSON ¶ added in v0.15.0
func (v *SessionUpdateAgentMessageChunk) UnmarshalJSON(b []byte) error
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/extensibility)
Meta Meta `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,omitempty"`
SessionUpdate string `json:"sessionUpdate"`
}
A chunk of the agent's internal reasoning being streamed.
func (*SessionUpdateAgentThoughtChunk) UnmarshalJSON ¶ added in v0.15.0
func (v *SessionUpdateAgentThoughtChunk) UnmarshalJSON(b []byte) error
type SessionUpdateCompactionSummaryChunk ¶ added in v0.16.0
type SessionUpdateCompactionSummaryChunk struct {
// Metadata scoped to this chunk. Omission and 'null' both mean absent.
Meta Meta `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.
func (*SessionUpdateCompactionSummaryChunk) UnmarshalJSON ¶ added in v0.16.0
func (v *SessionUpdateCompactionSummaryChunk) UnmarshalJSON(b []byte) error
type SessionUpdateNotice ¶ added in v0.17.0
type SessionUpdateNotice struct {
// Metadata scoped to this notice.
//
// Omitted and 'null' are equivalent and mean no metadata was supplied.
Meta Meta `json:"_meta,omitempty"`
// Optional plain-text detail or guidance.
//
// Omitted and 'null' are equivalent and mean no description was supplied.
Description *string `json:"description,omitempty"`
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.
func (*SessionUpdateNotice) UnmarshalJSON ¶ added in v0.17.0
func (v *SessionUpdateNotice) UnmarshalJSON(b []byte) error
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/extensibility)
Meta Meta `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)
func (SessionUpdatePlan) MarshalJSON ¶ added in v0.14.0
func (v SessionUpdatePlan) MarshalJSON() ([]byte, error)
func (*SessionUpdatePlan) UnmarshalJSON ¶ added in v0.14.0
func (v *SessionUpdatePlan) UnmarshalJSON(b []byte) error
type SessionUpdatePlanRemoved ¶ added in v0.13.4
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 Meta `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.
func (*SessionUpdatePlanRemoved) UnmarshalJSON ¶ added in v0.15.0
func (v *SessionUpdatePlanRemoved) UnmarshalJSON(b []byte) error
type SessionUpdateSessionMessage ¶ added in v0.17.0
type SessionUpdateSessionMessage struct {
// Omitted leaves metadata unchanged. 'null' removes it.
//
// Implementations MUST NOT make assumptions about values in '_meta'.
Meta Patch[Meta] `json:"_meta"`
// Omitted leaves content unchanged. 'null' or '[]' clears it.
// A non-empty array replaces all content.
Content Patch[[]ContentBlock] `json:"content"`
// 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 Patch[MessageId] `json:"recipientMessageId"`
// The receiving session.
//
// Omitted leaves the stored value unchanged. 'null' clears it. A value replaces it.
RecipientSessionId Patch[SessionId] `json:"recipientSessionId"`
// 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 Patch[MessageId] `json:"senderMessageId"`
// The sending session.
//
// Omitted leaves the stored value unchanged. 'null' clears it. A value replaces it.
SenderSessionId Patch[SessionId] `json:"senderSessionId"`
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.
func (SessionUpdateSessionMessage) MarshalJSON ¶ added in v0.20.0
func (v SessionUpdateSessionMessage) MarshalJSON() ([]byte, error)
func (*SessionUpdateSessionMessage) UnmarshalJSON ¶ added in v0.17.0
func (v *SessionUpdateSessionMessage) UnmarshalJSON(b []byte) error
type SessionUpdateSessionMessageChunk ¶ added in v0.17.0
type SessionUpdateSessionMessageChunk struct {
// Optional and nullable chunk-scoped metadata. Omitted or 'null' means none.
//
// Implementations MUST NOT make assumptions about values in '_meta'.
Meta Meta `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.
func (*SessionUpdateSessionMessageChunk) UnmarshalJSON ¶ added in v0.17.0
func (v *SessionUpdateSessionMessageChunk) UnmarshalJSON(b []byte) error
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/extensibility)
Meta Meta `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,omitempty"`
// 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,omitempty"`
// Raw input parameters sent to the tool.
RawInput json.RawMessage `json:"rawInput,omitempty"`
// Raw output returned by the tool.
RawOutput json.RawMessage `json:"rawOutput,omitempty"`
SessionUpdate string `json:"sessionUpdate"`
// Current execution status of the tool call.
Status ToolCallStatus `json:"status,omitempty"`
// 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.
func (*SessionUpdateToolCall) UnmarshalJSON ¶ added in v0.14.0
func (v *SessionUpdateToolCall) UnmarshalJSON(b []byte) error
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/extensibility)
Meta Meta `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,omitempty"`
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.
func (*SessionUpdateUserMessageChunk) UnmarshalJSON ¶ added in v0.15.0
func (v *SessionUpdateUserMessageChunk) UnmarshalJSON(b []byte) error
type SessionUsageUpdate ¶ added in v0.10.8
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/extensibility)
Meta Meta `json:"_meta,omitempty"`
// Cumulative session cost (optional).
Cost *Cost `json:"cost,omitempty"`
SessionUpdate string `json:"sessionUpdate"`
// Total context window size in tokens.
Size int64 `json:"size"`
// Tokens currently in context.
Used int64 `json:"used"`
}
Context window and cost update for the session.
func (*SessionUsageUpdate) UnmarshalJSON ¶ added in v0.14.0
func (v *SessionUsageUpdate) UnmarshalJSON(b []byte) error
type SetSessionConfigOptionBoolean ¶ added in v0.11.7
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/extensibility)
Meta Meta `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"').
func (*SetSessionConfigOptionBoolean) UnmarshalJSON ¶ added in v0.15.0
func (v *SetSessionConfigOptionBoolean) UnmarshalJSON(b []byte) error
type SetSessionConfigOptionRequest ¶ added in v0.10.8
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) MarshalJSON ¶ added in v0.11.7
func (u SetSessionConfigOptionRequest) MarshalJSON() ([]byte, error)
func (*SetSessionConfigOptionRequest) UnmarshalJSON ¶ added in v0.11.7
func (u *SetSessionConfigOptionRequest) UnmarshalJSON(b []byte) error
func (*SetSessionConfigOptionRequest) Validate ¶ added in v0.10.8
func (u *SetSessionConfigOptionRequest) Validate() error
type SetSessionConfigOptionResponse ¶ added in v0.10.8
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/extensibility)
Meta Meta `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) MarshalJSON ¶ added in v0.14.0
func (v SetSessionConfigOptionResponse) MarshalJSON() ([]byte, error)
func (*SetSessionConfigOptionResponse) UnmarshalJSON ¶ added in v0.14.0
func (v *SetSessionConfigOptionResponse) UnmarshalJSON(b []byte) error
func (*SetSessionConfigOptionResponse) Validate ¶ added in v0.10.8
func (v *SetSessionConfigOptionResponse) Validate() error
type SetSessionConfigOptionValueId ¶ added in v0.11.7
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/extensibility)
Meta Meta `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.
func (*SetSessionConfigOptionValueId) UnmarshalJSON ¶ added in v0.15.0
func (v *SetSessionConfigOptionValueId) UnmarshalJSON(b []byte) error
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/extensibility)
Meta Meta `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) UnmarshalJSON ¶ added in v0.15.0
func (v *SetSessionModeRequest) UnmarshalJSON(b []byte) error
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/extensibility)
Meta Meta `json:"_meta,omitempty"`
}
Response to 'session/set_mode' method.
func (*SetSessionModeResponse) UnmarshalJSON ¶ added in v0.15.0
func (v *SetSessionModeResponse) UnmarshalJSON(b []byte) error
func (*SetSessionModeResponse) Validate ¶
func (v *SetSessionModeResponse) Validate() error
type StateUpdate ¶ added in v0.17.0
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) MarshalJSON ¶ added in v0.17.0
func (u StateUpdate) MarshalJSON() ([]byte, error)
func (*StateUpdate) UnmarshalJSON ¶ added in v0.17.0
func (u *StateUpdate) UnmarshalJSON(b []byte) error
type StateUpdateIdle ¶ added in v0.17.0
type StateUpdateIdle struct {
// The work ended successfully.
EndTurn *StateUpdateIdleEndTurn `json:"-"`
// The work ended because the agent reached the maximum number of tokens.
MaxTokens *StateUpdateIdleMaxTokens `json:"-"`
// The work ended because the agent reached the maximum number of allowed
// agent requests.
MaxTurnRequests *StateUpdateIdleMaxTurnRequests `json:"-"`
// The work ended because the agent refused to continue.
Refusal *StateUpdateIdleRefusal `json:"-"`
// The work was cancelled.
Cancelled *StateUpdateIdleCancelled `json:"-"`
// The work ended because something failed.
Error *StateUpdateIdleError `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 *StateUpdateIdleOther `json:"-"`
// No stop reason: 'stopReason' is omitted or 'null'.
None *StateUpdateIdleNone `json:"-"`
}
func (StateUpdateIdle) MarshalJSON ¶ added in v0.17.0
func (u StateUpdateIdle) MarshalJSON() ([]byte, error)
func (*StateUpdateIdle) UnmarshalJSON ¶ added in v0.17.0
func (u *StateUpdateIdle) UnmarshalJSON(b []byte) error
type StateUpdateIdleCancelled ¶ added in v0.17.0
type StateUpdateIdleCancelled 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 Meta `json:"_meta,omitempty"`
State string `json:"state"`
StopReason string `json:"stopReason"`
// **UNSTABLE** Token usage for completed foreground work.
//
// Optional. Omitted or 'null' means not reported.
Usage *Usage `json:"usage,omitempty"`
}
The work was cancelled.
func (*StateUpdateIdleCancelled) UnmarshalJSON ¶ added in v0.17.0
func (v *StateUpdateIdleCancelled) UnmarshalJSON(b []byte) error
type StateUpdateIdleEndTurn ¶ added in v0.17.0
type StateUpdateIdleEndTurn 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 Meta `json:"_meta,omitempty"`
State string `json:"state"`
StopReason string `json:"stopReason"`
// **UNSTABLE** Token usage for completed foreground work.
//
// Optional. Omitted or 'null' means not reported.
Usage *Usage `json:"usage,omitempty"`
}
The child is ready to process another prompt. The work ended successfully.
func (*StateUpdateIdleEndTurn) UnmarshalJSON ¶ added in v0.17.0
func (v *StateUpdateIdleEndTurn) UnmarshalJSON(b []byte) error
type StateUpdateIdleError ¶ added in v0.17.0
type StateUpdateIdleError 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 Meta `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,omitempty"`
State string `json:"state"`
StopReason string `json:"stopReason"`
// **UNSTABLE** Token usage for completed foreground work.
//
// Optional. Omitted or 'null' means not reported.
Usage *Usage `json:"usage,omitempty"`
}
The work ended because something failed.
func (*StateUpdateIdleError) UnmarshalJSON ¶ added in v0.17.0
func (v *StateUpdateIdleError) UnmarshalJSON(b []byte) error
type StateUpdateIdleMaxTokens ¶ added in v0.17.0
type StateUpdateIdleMaxTokens 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 Meta `json:"_meta,omitempty"`
State string `json:"state"`
StopReason string `json:"stopReason"`
// **UNSTABLE** Token usage for completed foreground work.
//
// Optional. Omitted or 'null' means not reported.
Usage *Usage `json:"usage,omitempty"`
}
The work ended because the agent reached the maximum number of tokens.
func (*StateUpdateIdleMaxTokens) UnmarshalJSON ¶ added in v0.17.0
func (v *StateUpdateIdleMaxTokens) UnmarshalJSON(b []byte) error
type StateUpdateIdleMaxTurnRequests ¶ added in v0.17.0
type StateUpdateIdleMaxTurnRequests 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 Meta `json:"_meta,omitempty"`
State string `json:"state"`
StopReason string `json:"stopReason"`
// **UNSTABLE** Token usage for completed foreground work.
//
// Optional. Omitted or 'null' means not reported.
Usage *Usage `json:"usage,omitempty"`
}
The work ended because the agent reached the maximum number of allowed agent requests.
func (*StateUpdateIdleMaxTurnRequests) UnmarshalJSON ¶ added in v0.17.0
func (v *StateUpdateIdleMaxTurnRequests) UnmarshalJSON(b []byte) error
type StateUpdateIdleNone ¶ added in v0.17.0
type StateUpdateIdleNone 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 Meta `json:"_meta,omitempty"`
State string `json:"state"`
// **UNSTABLE** Token usage for completed foreground work.
//
// Optional. Omitted or 'null' means not reported.
Usage *Usage `json:"usage,omitempty"`
}
No stop reason: 'stopReason' is omitted or 'null'.
func (*StateUpdateIdleNone) UnmarshalJSON ¶ added in v0.17.0
func (v *StateUpdateIdleNone) UnmarshalJSON(b []byte) error
type StateUpdateIdleOther ¶ added in v0.17.0
type StateUpdateIdleOther 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 Meta `json:"_meta,omitempty"`
State string `json:"state"`
// 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,omitempty"`
// AdditionalProperties holds the members that the schema does not name.
AdditionalProperties map[string]json.RawMessage `json:"-"`
}
Custom or future stop reason.
Values beginning with '_' are reserved for implementation-specific extensions. Other unknown values are reserved for future ACP variants.
func (StateUpdateIdleOther) MarshalJSON ¶ added in v0.17.0
func (v StateUpdateIdleOther) MarshalJSON() ([]byte, error)
func (*StateUpdateIdleOther) UnmarshalJSON ¶ added in v0.17.0
func (v *StateUpdateIdleOther) UnmarshalJSON(b []byte) error
type StateUpdateIdleRefusal ¶ added in v0.17.0
type StateUpdateIdleRefusal 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 Meta `json:"_meta,omitempty"`
State string `json:"state"`
StopReason string `json:"stopReason"`
// **UNSTABLE** Token usage for completed foreground work.
//
// Optional. Omitted or 'null' means not reported.
Usage *Usage `json:"usage,omitempty"`
}
The work ended because the agent refused to continue.
func (*StateUpdateIdleRefusal) UnmarshalJSON ¶ added in v0.17.0
func (v *StateUpdateIdleRefusal) UnmarshalJSON(b []byte) error
type StateUpdateOther ¶ added in v0.17.0
type StateUpdateOther struct {
// Unrecognized state discriminator.
State string `json:"state"`
// AdditionalProperties holds the members that the schema does not name.
AdditionalProperties map[string]json.RawMessage `json:"-"`
}
Custom or future state.
Values beginning with '_' are reserved for implementation-specific extensions. Other unknown values are reserved for future ACP variants.
func (StateUpdateOther) MarshalJSON ¶ added in v0.17.0
func (v StateUpdateOther) MarshalJSON() ([]byte, error)
func (*StateUpdateOther) UnmarshalJSON ¶ added in v0.17.0
func (v *StateUpdateOther) UnmarshalJSON(b []byte) error
type StateUpdateRequiresAction ¶ added in v0.17.0
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 Meta `json:"_meta,omitempty"`
State string `json:"state"`
}
Foreground work is blocked on user action.
func (*StateUpdateRequiresAction) UnmarshalJSON ¶ added in v0.17.0
func (v *StateUpdateRequiresAction) UnmarshalJSON(b []byte) error
type StateUpdateRunning ¶ added in v0.17.0
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 Meta `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.
func (*StateUpdateRunning) UnmarshalJSON ¶ added in v0.17.0
func (v *StateUpdateRunning) UnmarshalJSON(b []byte) error
type StateUpdateUnknown ¶ added in v0.17.0
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 Meta `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.
func (*StateUpdateUnknown) UnmarshalJSON ¶ added in v0.17.0
func (v *StateUpdateUnknown) UnmarshalJSON(b []byte) error
type StopReason ¶
type StopReason string
Reasons why an agent stops processing a prompt turn.
See protocol docs: [Stop Reasons](https://agentclientprotocol.com/protocol/v1/prompt-turn#stop-reasons)
const ( // The turn ended successfully. StopReasonEndTurn StopReason = "end_turn" // The turn ended because the agent reached the maximum number of tokens. StopReasonMaxTokens StopReason = "max_tokens" // The turn ended because the agent reached the maximum number of allowed // agent requests between user turns. StopReasonMaxTurnRequests StopReason = "max_turn_requests" // The turn ended because the agent refused to continue. The user prompt // and everything that comes after it won't be included in the next // prompt, so this should be reflected in the UI. StopReasonRefusal StopReason = "refusal" // The turn was cancelled by the client via 'session/cancel'. // // This stop reason MUST be returned when the client sends a 'session/cancel' // notification, even if the cancellation causes exceptions in underlying operations. // Agents should catch these exceptions and return this semantically meaningful // response to confirm successful cancellation. StopReasonCancelled StopReason = "cancelled" )
type StringFormat ¶ added in v0.16.0
type StringFormat string
String format types for string properties in elicitation schemas.
const ( // Email address format. StringFormatEmail StringFormat = "email" // URI format. StringFormatUri StringFormat = "uri" // Date format (YYYY-MM-DD). StringFormatDate StringFormat = "date" // Date-time format (ISO 8601). StringFormatDateTime StringFormat = "date-time" )
type StringMultiSelectItems ¶ added in v0.16.0
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 Meta `json:"_meta,omitempty"`
// Allowed enum values.
Enum []string `json:"enum"`
}
String item schema for multi-select enum properties.
func (StringMultiSelectItems) MarshalJSON ¶ added in v0.16.0
func (v StringMultiSelectItems) MarshalJSON() ([]byte, error)
func (*StringMultiSelectItems) UnmarshalJSON ¶ added in v0.16.0
func (v *StringMultiSelectItems) UnmarshalJSON(b []byte) error
type StringPropertySchema ¶ added in v0.16.0
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 Meta `json:"_meta,omitempty"`
// Default value.
//
// Optional. Omitted and 'null' are equivalent and mean no default value is 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,omitempty"`
// 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,omitempty"`
// Maximum string length.
//
// Optional. Omitted and 'null' are equivalent and mean there is no maximum length constraint.
MaxLength *int64 `json:"maxLength,omitempty"`
// Minimum string length.
//
// Optional. Omitted and 'null' are equivalent and mean there is no minimum length constraint.
MinLength *int64 `json:"minLength,omitempty"`
// 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,omitempty"`
// Optional title for the property.
//
// Optional. Omitted and 'null' are equivalent and mean no title is provided.
Title *string `json:"title,omitempty"`
}
Schema for string properties in an elicitation form.
When 'enum' or 'oneOf' is set, this represents a single-select enum with '"type": "string"'.
func (*StringPropertySchema) UnmarshalJSON ¶ added in v0.16.0
func (v *StringPropertySchema) UnmarshalJSON(b []byte) error
type SubagentCapabilities ¶ added in v0.17.0
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 Meta `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.
func (*SubagentCapabilities) UnmarshalJSON ¶ added in v0.17.0
func (v *SubagentCapabilities) UnmarshalJSON(b []byte) error
type SubagentSessionCapabilities ¶ added in v0.17.0
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 Meta `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,omitempty"`
}
**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.
func (*SubagentSessionCapabilities) UnmarshalJSON ¶ added in v0.17.0
func (v *SubagentSessionCapabilities) UnmarshalJSON(b []byte) error
type SubagentUpdate ¶ added in v0.17.0
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 Patch[Meta] `json:"_meta"`
// 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 Patch[[]string] `json:"additionalDirectories"`
// 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 Patch[SubagentSessionCapabilities] `json:"capabilities"`
// 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 Patch[string] `json:"cwd"`
// 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 Patch[string] `json:"description"`
// 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 Patch[StateUpdate] `json:"state"`
// 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 Patch[string] `json:"title"`
}
**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.
func (SubagentUpdate) MarshalJSON ¶ added in v0.20.0
func (v SubagentUpdate) MarshalJSON() ([]byte, error)
func (*SubagentUpdate) UnmarshalJSON ¶ added in v0.17.0
func (v *SubagentUpdate) UnmarshalJSON(b []byte) error
type SystemPrompt ¶ added in v0.18.0
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/extensibility)
Meta Meta `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.
func (SystemPrompt) MarshalJSON ¶ added in v0.18.0
func (v SystemPrompt) MarshalJSON() ([]byte, error)
func (*SystemPrompt) UnmarshalJSON ¶ added in v0.18.0
func (v *SystemPrompt) UnmarshalJSON(b []byte) error
type SystemPromptMode ¶ added in v0.18.0
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 ( // Add the content to the Agent's own instructions rather than replacing them. // // Every Agent that advertises 'sessionCapabilities.systemPrompt' supports this mode. // Agents SHOULD give the content system-level precedence, for example in the // model's system prompt or developer instructions rather than in user-turn // content. Where it is placed and how it is formatted is implementation-defined. SystemPromptModeAppend SystemPromptMode = "append" // Replace the Agent's built-in default instructions with the content. // // This does not change tool availability, MCP servers, permissions, or session // configuration. Context the Agent supplies from the workspace or environment // MAY still be included. Clients that use this mode take responsibility for any // tool guidance or safety instructions the Agent's default instructions // provided, and MUST only use it when the Agent advertises // 'sessionCapabilities.systemPrompt.mode.override'. SystemPromptModeOverride SystemPromptMode = "override" )
type Terminal ¶ added in v0.10.8
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/extensibility)
Meta Meta `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/terminals)
func (*Terminal) UnmarshalJSON ¶ added in v0.15.0
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/extensibility)
Meta Meta `json:"_meta,omitempty"`
// The process exit code (may be null if terminated by signal).
ExitCode *int64 `json:"exitCode,omitempty"`
// The signal that terminated the process (may be null if exited normally).
Signal *string `json:"signal,omitempty"`
}
Exit status of a terminal command.
func (*TerminalExitStatus) UnmarshalJSON ¶ added in v0.15.0
func (v *TerminalExitStatus) UnmarshalJSON(b []byte) error
type TerminalId ¶ added in v0.15.0
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/extensibility)
Meta Meta `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) UnmarshalJSON ¶ added in v0.15.0
func (v *TerminalOutputRequest) UnmarshalJSON(b []byte) error
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/extensibility)
Meta Meta `json:"_meta,omitempty"`
// Exit status if the command has completed.
ExitStatus *TerminalExitStatus `json:"exitStatus,omitempty"`
// 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) UnmarshalJSON ¶ added in v0.15.0
func (v *TerminalOutputResponse) UnmarshalJSON(b []byte) error
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/extensibility)
Meta Meta `json:"_meta,omitempty"`
// Optional annotations that help clients decide how to display or route this content.
Annotations *Annotations `json:"annotations,omitempty"`
// Text payload carried by this content block.
Text string `json:"text"`
}
Text provided to or from an LLM.
func (*TextContent) UnmarshalJSON ¶ added in v0.14.0
func (v *TextContent) UnmarshalJSON(b []byte) error
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/extensibility)
Meta Meta `json:"_meta,omitempty"`
// MIME type describing the encoded media payload.
MimeType *string `json:"mimeType,omitempty"`
// 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.
func (*TextResourceContents) UnmarshalJSON ¶ added in v0.15.0
func (v *TextResourceContents) UnmarshalJSON(b []byte) error
type TitledMultiSelectItems ¶ added in v0.16.0
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 Meta `json:"_meta,omitempty"`
// Titled enum options.
AnyOf []EnumOption `json:"anyOf"`
}
Items definition for titled multi-select enum properties.
func (TitledMultiSelectItems) MarshalJSON ¶ added in v0.16.0
func (v TitledMultiSelectItems) MarshalJSON() ([]byte, error)
func (*TitledMultiSelectItems) UnmarshalJSON ¶ added in v0.16.0
func (v *TitledMultiSelectItems) UnmarshalJSON(b []byte) error
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/extensibility)
Meta Meta `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,omitempty"`
// 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,omitempty"`
// Raw input parameters sent to the tool.
RawInput json.RawMessage `json:"rawInput,omitempty"`
// Raw output returned by the tool.
RawOutput json.RawMessage `json:"rawOutput,omitempty"`
// Current execution status of the tool call.
Status ToolCallStatus `json:"status,omitempty"`
// 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/tool-calls)
func (*ToolCall) UnmarshalJSON ¶ added in v0.14.0
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 ToolContent ¶
func ToolContent(block ContentBlock) ToolCallContent
ToolContent wraps a content block as tool-call content.
func ToolDiffContent ¶
func ToolDiffContent(path string, newText string, oldText ...string) ToolCallContent
ToolDiffContent constructs a diff tool-call content. If oldText is omitted, the field is left empty.
func ToolTerminalRef ¶
func ToolTerminalRef(terminalID string) ToolCallContent
ToolTerminalRef constructs a terminal reference tool-call content.
func (ToolCallContent) MarshalJSON ¶
func (u ToolCallContent) MarshalJSON() ([]byte, error)
func (*ToolCallContent) UnmarshalJSON ¶
func (u *ToolCallContent) UnmarshalJSON(b []byte) 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/extensibility)
Meta Meta `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).
func (*ToolCallContentContent) UnmarshalJSON ¶ added in v0.15.0
func (v *ToolCallContentContent) UnmarshalJSON(b []byte) error
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/extensibility)
Meta Meta `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,omitempty"`
// The absolute file path being modified.
Path string `json:"path"`
Type string `json:"type"`
}
File modification shown as a diff.
func (*ToolCallContentDiff) UnmarshalJSON ¶ added in v0.15.0
func (v *ToolCallContentDiff) UnmarshalJSON(b []byte) error
type ToolCallContentSession ¶ added in v0.18.0
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 Meta `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.
func (*ToolCallContentSession) UnmarshalJSON ¶ added in v0.18.0
func (v *ToolCallContentSession) UnmarshalJSON(b []byte) error
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/extensibility)
Meta Meta `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)
func (*ToolCallContentTerminal) UnmarshalJSON ¶ added in v0.15.0
func (v *ToolCallContentTerminal) UnmarshalJSON(b []byte) error
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/extensibility)
Meta Meta `json:"_meta,omitempty"`
// Optional 1-based line number within the file.
Line *int64 `json:"line,omitempty"`
// 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/tool-calls#following-the-agent)
func (*ToolCallLocation) UnmarshalJSON ¶ added in v0.15.0
func (v *ToolCallLocation) UnmarshalJSON(b []byte) error
type ToolCallStartOpt ¶
type ToolCallStartOpt func(tc *SessionUpdateToolCall)
func WithStartContent ¶
func WithStartContent(c []ToolCallContent) ToolCallStartOpt
WithStartContent sets the initial content for a tool_call start update.
func WithStartKind ¶
func WithStartKind(k ToolKind) ToolCallStartOpt
WithStartKind sets the kind for a tool_call start update.
func WithStartLocations ¶
func WithStartLocations(l []ToolCallLocation) ToolCallStartOpt
WithStartLocations sets file locations. With a single path, it also sets rawInput.path when rawInput is unset or an object without a path.
func WithStartName ¶ added in v0.17.0
func WithStartName(n string) ToolCallStartOpt
WithStartName sets the programmatic name of the tool, such as "read_file", for a tool_call start update. Title stays the human-readable label.
func WithStartRawInput ¶
func WithStartRawInput(v any) ToolCallStartOpt
WithStartRawInput sets rawInput for a tool_call start update to v, encoded with json.Marshal, so a json.RawMessage keeps its JSON. A nil v, or one that json.Marshal cannot encode, leaves rawInput unset: the field is raw JSON and cannot hold the error. To see the error, encode v yourself and pass the json.RawMessage.
func WithStartRawOutput ¶
func WithStartRawOutput(v any) ToolCallStartOpt
WithStartRawOutput sets rawOutput for a tool_call start update to v encoded as JSON, as WithStartRawInput does.
func WithStartStatus ¶
func WithStartStatus(s ToolCallStatus) ToolCallStartOpt
WithStartStatus sets the status for a tool_call start update.
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/tool-calls#status)
const ( // The tool call hasn't started running yet because the input is either // streaming or we're awaiting approval. ToolCallStatusPending ToolCallStatus = "pending" // The tool call is currently running. ToolCallStatusInProgress ToolCallStatus = "in_progress" // The tool call completed successfully. ToolCallStatusCompleted ToolCallStatus = "completed" // The tool call failed with an error. 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/extensibility)
//
// ACP v1 does not say that null clears this field, and the Rust SDK
// reads null here as absent: treat IsNull like IsUnset.
Meta Patch[Meta] `json:"_meta"`
// Replace the content collection.
//
// ACP v1 does not say that null clears this field, and the Rust SDK
// reads null here as absent: treat IsNull like IsUnset.
Content Patch[[]ToolCallContent] `json:"content"`
// Update the tool kind.
//
// ACP v1 does not say that null clears this field, and the Rust SDK
// reads null here as absent: treat IsNull like IsUnset.
Kind Patch[ToolKind] `json:"kind"`
// Replace the locations collection.
//
// ACP v1 does not say that null clears this field, and the Rust SDK
// reads null here as absent: treat IsNull like IsUnset.
Locations Patch[[]ToolCallLocation] `json:"locations"`
// 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 Patch[string] `json:"name"`
// Update the raw input.
//
// ACP v1 does not say that null clears this field, and the Rust SDK
// reads null here as absent: treat IsNull like IsUnset.
RawInput Patch[json.RawMessage] `json:"rawInput"`
// Update the raw output.
//
// ACP v1 does not say that null clears this field, and the Rust SDK
// reads null here as absent: treat IsNull like IsUnset.
RawOutput Patch[json.RawMessage] `json:"rawOutput"`
// Update the execution status.
//
// ACP v1 does not say that null clears this field, and the Rust SDK
// reads null here as absent: treat IsNull like IsUnset.
Status Patch[ToolCallStatus] `json:"status"`
// Update the human-readable title.
//
// ACP v1 does not say that null clears this field, and the Rust SDK
// reads null here as absent: treat IsNull like IsUnset.
Title Patch[string] `json:"title"`
// 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/tool-calls#updating)
func (ToolCallUpdate) MarshalJSON ¶ added in v0.20.0
func (v ToolCallUpdate) MarshalJSON() ([]byte, error)
func (*ToolCallUpdate) UnmarshalJSON ¶ added in v0.14.0
func (v *ToolCallUpdate) UnmarshalJSON(b []byte) error
func (*ToolCallUpdate) Validate ¶
func (t *ToolCallUpdate) Validate() error
type ToolCallUpdateOpt ¶
type ToolCallUpdateOpt func(tu *SessionToolCallUpdate)
func WithUpdateContent ¶
func WithUpdateContent(c []ToolCallContent) ToolCallUpdateOpt
WithUpdateContent replaces the content collection for a tool_call_update. A nil c leaves the field unset, so the content stays as it is; an empty non-nil c sends [], which replaces it with none.
func WithUpdateKind ¶
func WithUpdateKind(k ToolKind) ToolCallUpdateOpt
WithUpdateKind sets the kind for a tool_call_update.
func WithUpdateLocations ¶
func WithUpdateLocations(l []ToolCallLocation) ToolCallUpdateOpt
WithUpdateLocations replaces the locations collection for a tool_call_update. A nil l leaves the field unset, so the locations stay as they are; an empty non-nil l sends [], which replaces them with none.
func WithUpdateName ¶ added in v0.17.0
func WithUpdateName(n string) ToolCallUpdateOpt
WithUpdateName sets the programmatic name of the tool for a tool_call_update.
func WithUpdateRawInput ¶
func WithUpdateRawInput(v any) ToolCallUpdateOpt
WithUpdateRawInput sets rawInput for a tool_call_update to v, encoded with json.Marshal, so a json.RawMessage keeps its JSON. A nil v leaves rawInput unset. When json.Marshal cannot encode v, such as a channel or a NaN, the update fails to encode with that error, so sending it returns the error.
func WithUpdateRawOutput ¶
func WithUpdateRawOutput(v any) ToolCallUpdateOpt
WithUpdateRawOutput sets rawOutput for a tool_call_update to v encoded as JSON, as WithUpdateRawInput does.
func WithUpdateStatus ¶
func WithUpdateStatus(s ToolCallStatus) ToolCallUpdateOpt
WithUpdateStatus sets the status for a tool_call_update.
func WithUpdateTitle ¶
func WithUpdateTitle(t string) ToolCallUpdateOpt
WithUpdateTitle sets the title for a tool_call_update.
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/tool-calls#creating)
const ( // Reading files or data. ToolKindRead ToolKind = "read" // Modifying files or content. ToolKindEdit ToolKind = "edit" // Removing files or data. ToolKindDelete ToolKind = "delete" // Moving or renaming files. ToolKindMove ToolKind = "move" // Searching for information. ToolKindSearch ToolKind = "search" // Running commands or code. ToolKindExecute ToolKind = "execute" // Internal reasoning or planning. ToolKindThink ToolKind = "think" // Retrieving external data. ToolKindFetch ToolKind = "fetch" // Switching the current session mode. ToolKindSwitchMode ToolKind = "switch_mode" // Other tool types (default). ToolKindOther ToolKind = "other" )
func (*ToolKind) UnmarshalJSON ¶ added in v0.14.0
UnmarshalJSON reads a string that ToolKind does not list as ToolKindOther.
type UnknownStateUpdate ¶ added in v0.17.0
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 Meta `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. If a control is no longer available, the Agent updates the capabilities explicitly. Unfinished tool calls and terminals stay as last reported. The Agent does not invent a final status for them, and Clients do not present them as confirmed live activity.
func (*UnknownStateUpdate) UnmarshalJSON ¶ added in v0.17.0
func (v *UnknownStateUpdate) UnmarshalJSON(b []byte) error
type UnstableArchiveSessionRequest ¶ added in v0.18.0
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 Meta `json:"_meta,omitempty"`
// The ID of the session to archive.
SessionId SessionId `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) UnmarshalJSON ¶ added in v0.18.0
func (v *UnstableArchiveSessionRequest) UnmarshalJSON(b []byte) error
func (*UnstableArchiveSessionRequest) Validate ¶ added in v0.18.0
func (v *UnstableArchiveSessionRequest) Validate() error
type UnstableArchiveSessionResponse ¶ added in v0.18.0
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 Meta `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) UnmarshalJSON ¶ added in v0.18.0
func (v *UnstableArchiveSessionResponse) UnmarshalJSON(b []byte) error
func (*UnstableArchiveSessionResponse) Validate ¶ added in v0.18.0
func (v *UnstableArchiveSessionResponse) Validate() error
type UnstableAuthAccount ¶ added in v0.18.0
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 Meta `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,omitempty"`
// 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,omitempty"`
// Email address of the user.
//
// Optional. Omitted and 'null' are equivalent and mean no email is reported.
Email *string `json:"email,omitempty"`
// 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,omitempty"`
// 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,omitempty"`
}
**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.
func (*UnstableAuthAccount) UnmarshalJSON ¶ added in v0.18.0
func (v *UnstableAuthAccount) UnmarshalJSON(b []byte) error
type UnstableAuthState ¶ added in v0.18.0
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 ( // Credentials are configured. This does not guarantee that they are valid. UnstableAuthStateAuthenticated UnstableAuthState = "authenticated" // The user needs to sign in. This includes credentials that are missing, // expired, or known to be invalid. UnstableAuthStateUnauthenticated UnstableAuthState = "unauthenticated" // No authentication is needed, for example because the agent uses a local model. UnstableAuthStateNotRequired UnstableAuthState = "not_required" // The agent cannot currently determine the state. UnstableAuthStateUnknown UnstableAuthState = "unknown" )
type UnstableAuthStatusRequest ¶ added in v0.18.0
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 Meta `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) UnmarshalJSON ¶ added in v0.18.0
func (v *UnstableAuthStatusRequest) UnmarshalJSON(b []byte) error
func (*UnstableAuthStatusRequest) Validate ¶ added in v0.18.0
func (v *UnstableAuthStatusRequest) Validate() error
type UnstableAuthStatusResponse ¶ added in v0.18.0
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 Meta `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) UnmarshalJSON ¶ added in v0.18.0
func (v *UnstableAuthStatusResponse) UnmarshalJSON(b []byte) error
func (*UnstableAuthStatusResponse) Validate ¶ added in v0.18.0
func (v *UnstableAuthStatusResponse) Validate() error
type UnstableAuthStatusUpdateNotification ¶ added in v0.18.0
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 Meta `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) UnmarshalJSON ¶ added in v0.18.0
func (v *UnstableAuthStatusUpdateNotification) UnmarshalJSON(b []byte) error
func (*UnstableAuthStatusUpdateNotification) Validate ¶ added in v0.18.0
func (v *UnstableAuthStatusUpdateNotification) Validate() error
type UnstableDisableProviderRequest ¶ added in v0.13.4
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 Meta `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) UnmarshalJSON ¶ added in v0.15.0
func (v *UnstableDisableProviderRequest) UnmarshalJSON(b []byte) error
func (*UnstableDisableProviderRequest) Validate ¶ added in v0.13.4
func (v *UnstableDisableProviderRequest) Validate() error
type UnstableDisableProviderResponse ¶ added in v0.13.4
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 Meta `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) UnmarshalJSON ¶ added in v0.15.0
func (v *UnstableDisableProviderResponse) UnmarshalJSON(b []byte) error
func (*UnstableDisableProviderResponse) Validate ¶ added in v0.13.4
func (v *UnstableDisableProviderResponse) Validate() error
type UnstableForkSessionRequest ¶ added in v0.10.8
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 Meta `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"`
// **UNSTABLE**
//
// This capability is not part of the spec yet, and may be removed or changed at any point.
//
// Initial values for the forked 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 on top of the configuration the fork
// starts with, 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,
// and SHOULD NOT send other 'session/update' notifications caused by applying them
// before it responds.
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 fork.
SessionId SessionId `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 *SystemPrompt `json:"systemPrompt,omitempty"`
}
**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) UnmarshalJSON ¶ added in v0.15.0
func (v *UnstableForkSessionRequest) UnmarshalJSON(b []byte) error
func (*UnstableForkSessionRequest) Validate ¶ added in v0.10.8
func (v *UnstableForkSessionRequest) Validate() error
type UnstableForkSessionResponse ¶ added in v0.10.8
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 Meta `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,omitempty"`
// Unique identifier for the newly created forked session.
SessionId SessionId `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) UnmarshalJSON ¶ added in v0.14.0
func (v *UnstableForkSessionResponse) UnmarshalJSON(b []byte) error
func (*UnstableForkSessionResponse) Validate ¶ added in v0.10.8
func (v *UnstableForkSessionResponse) Validate() error
type UnstableListProvidersRequest ¶ added in v0.11.7
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 Meta `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) UnmarshalJSON ¶ added in v0.15.0
func (v *UnstableListProvidersRequest) UnmarshalJSON(b []byte) error
func (*UnstableListProvidersRequest) Validate ¶ added in v0.11.7
func (v *UnstableListProvidersRequest) Validate() error
type UnstableListProvidersResponse ¶ added in v0.11.7
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 Meta `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) MarshalJSON ¶ added in v0.14.0
func (v UnstableListProvidersResponse) MarshalJSON() ([]byte, error)
func (*UnstableListProvidersResponse) UnmarshalJSON ¶ added in v0.14.0
func (v *UnstableListProvidersResponse) UnmarshalJSON(b []byte) error
func (*UnstableListProvidersResponse) Validate ¶ added in v0.11.7
func (v *UnstableListProvidersResponse) Validate() error
type UnstableLlmProtocol ¶ added in v0.11.7
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 ( // Anthropic API protocol. UnstableLlmProtocolAnthropic UnstableLlmProtocol = "anthropic" // OpenAI API protocol. UnstableLlmProtocolOpenai UnstableLlmProtocol = "openai" // Azure OpenAI API protocol. UnstableLlmProtocolAzure UnstableLlmProtocol = "azure" // Google Vertex AI API protocol. UnstableLlmProtocolVertex UnstableLlmProtocol = "vertex" // AWS Bedrock API protocol. UnstableLlmProtocolBedrock UnstableLlmProtocol = "bedrock" )
type UnstableMcpError ¶ added in v0.17.0
type UnstableMcpError struct {
// Inner MCP error code. Never an ACP error code.
Code int `json:"code"`
// Optional error data. Explicit null is retained.
Data json.RawMessage `json:"data,omitempty"`
// Inner MCP error message.
Message string `json:"message"`
// AdditionalProperties holds the members that the schema does not name.
AdditionalProperties map[string]json.RawMessage `json:"-"`
}
**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.
func (UnstableMcpError) MarshalJSON ¶ added in v0.17.0
func (v UnstableMcpError) MarshalJSON() ([]byte, error)
func (*UnstableMcpError) UnmarshalJSON ¶ added in v0.17.0
func (v *UnstableMcpError) UnmarshalJSON(b []byte) error
type UnstableMcpRequestId ¶ added in v0.17.0
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 UnstableMessageMcpError ¶ added in v0.17.0
type UnstableMessageMcpError struct {
// Optional ACP carrier metadata.
Meta Meta `json:"_meta,omitempty"`
// Required, non-null MCP error object.
Error UnstableMcpError `json:"error"`
}
A structured inner MCP error.
func (*UnstableMessageMcpError) UnmarshalJSON ¶ added in v0.17.0
func (v *UnstableMessageMcpError) UnmarshalJSON(b []byte) error
type UnstableMessageMcpNotification ¶ added in v0.13.0
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 Meta `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]json.RawMessage `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 McpServerAcpId `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) UnmarshalJSON ¶ added in v0.15.0
func (v *UnstableMessageMcpNotification) UnmarshalJSON(b []byte) error
func (*UnstableMessageMcpNotification) Validate ¶ added in v0.13.0
func (v *UnstableMessageMcpNotification) Validate() error
type UnstableMessageMcpRequest ¶ added in v0.13.0
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 Meta `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]json.RawMessage `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 McpServerAcpId `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) UnmarshalJSON ¶ added in v0.15.0
func (v *UnstableMessageMcpRequest) UnmarshalJSON(b []byte) error
func (*UnstableMessageMcpRequest) Validate ¶ added in v0.13.0
func (v *UnstableMessageMcpRequest) Validate() error
type UnstableMessageMcpResponse ¶ added in v0.13.0
type UnstableMessageMcpResponse struct {
// An opaque inner MCP result.
Result *UnstableMessageMcpResult `json:"-"`
// A structured inner MCP error.
Error *UnstableMessageMcpError `json:"-"`
}
func (UnstableMessageMcpResponse) MarshalJSON ¶ added in v0.17.0
func (u UnstableMessageMcpResponse) MarshalJSON() ([]byte, error)
func (*UnstableMessageMcpResponse) UnmarshalJSON ¶ added in v0.17.0
func (u *UnstableMessageMcpResponse) UnmarshalJSON(b []byte) error
type UnstableMessageMcpResult ¶ added in v0.17.0
type UnstableMessageMcpResult struct {
// Optional ACP carrier metadata.
Meta Meta `json:"_meta,omitempty"`
// Required, even if JSON null.
Result json.RawMessage `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.
func (*UnstableMessageMcpResult) UnmarshalJSON ¶ added in v0.17.0
func (v *UnstableMessageMcpResult) UnmarshalJSON(b []byte) error
type UnstableProviderCurrentConfig ¶ added in v0.11.7
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 Meta `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.
func (*UnstableProviderCurrentConfig) UnmarshalJSON ¶ added in v0.15.0
func (v *UnstableProviderCurrentConfig) UnmarshalJSON(b []byte) error
type UnstableProviderId ¶ added in v0.15.0
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 ¶ added in v0.11.7
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 Meta `json:"_meta,omitempty"`
// Current effective non-secret routing config.
// Null or omitted means provider is disabled.
Current *UnstableProviderCurrentConfig `json:"current,omitempty"`
// 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.
func (UnstableProviderInfo) MarshalJSON ¶ added in v0.14.0
func (v UnstableProviderInfo) MarshalJSON() ([]byte, error)
func (*UnstableProviderInfo) UnmarshalJSON ¶ added in v0.14.0
func (v *UnstableProviderInfo) UnmarshalJSON(b []byte) error
type UnstableSessionOptionsRequest ¶ added in v0.18.0
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 Meta `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 *SessionId `json:"sessionId,omitempty"`
}
**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. Agents MAY start their runtime to resolve the options. The rules above still hold for it.
func (*UnstableSessionOptionsRequest) UnmarshalJSON ¶ added in v0.18.0
func (v *UnstableSessionOptionsRequest) UnmarshalJSON(b []byte) error
func (*UnstableSessionOptionsRequest) Validate ¶ added in v0.18.0
func (v *UnstableSessionOptionsRequest) Validate() error
type UnstableSessionOptionsResponse ¶ added in v0.18.0
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 Meta `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 []SessionConfigOption `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 *SessionModeState `json:"modes,omitempty"`
}
**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) UnmarshalJSON ¶ added in v0.18.0
func (v *UnstableSessionOptionsResponse) UnmarshalJSON(b []byte) error
func (*UnstableSessionOptionsResponse) Validate ¶ added in v0.18.0
func (v *UnstableSessionOptionsResponse) Validate() error
type UnstableSessionStatus ¶ added in v0.18.0
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 ( // The Agent has the session in memory, for any connection. // // This does not mean the requesting connection is attached to it. A Client that did // not create or resume the session on its own connection MUST still call // 'session/load' or 'session/resume' before sending 'session/prompt' or expecting // 'session/update' notifications. UnstableSessionStatusOpen UnstableSessionStatus = "open" // The Agent knows the session and can resume it, but does not have it in memory. // // The Client can call 'session/load' or 'session/resume' to start it. UnstableSessionStatusSaved UnstableSessionStatus = "saved" )
type UnstableSessionStatusRequest ¶ added in v0.18.0
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 Meta `json:"_meta,omitempty"`
// The ID of the session to check.
SessionId SessionId `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) UnmarshalJSON ¶ added in v0.18.0
func (v *UnstableSessionStatusRequest) UnmarshalJSON(b []byte) error
func (*UnstableSessionStatusRequest) Validate ¶ added in v0.18.0
func (v *UnstableSessionStatusRequest) Validate() error
type UnstableSessionStatusResponse ¶ added in v0.18.0
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 Meta `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) UnmarshalJSON ¶ added in v0.18.0
func (v *UnstableSessionStatusResponse) UnmarshalJSON(b []byte) error
func (*UnstableSessionStatusResponse) Validate ¶ added in v0.18.0
func (v *UnstableSessionStatusResponse) Validate() error
type UnstableSetProviderRequest ¶ added in v0.13.4
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 Meta `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]string `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) UnmarshalJSON ¶ added in v0.15.0
func (v *UnstableSetProviderRequest) UnmarshalJSON(b []byte) error
func (*UnstableSetProviderRequest) Validate ¶ added in v0.13.4
func (v *UnstableSetProviderRequest) Validate() error
type UnstableSetProviderResponse ¶ added in v0.13.4
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 Meta `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) UnmarshalJSON ¶ added in v0.15.0
func (v *UnstableSetProviderResponse) UnmarshalJSON(b []byte) error
func (*UnstableSetProviderResponse) Validate ¶ added in v0.13.4
func (v *UnstableSetProviderResponse) Validate() error
type UnstableSetSessionTitleRequest ¶ added in v0.18.0
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 Meta `json:"_meta,omitempty"`
// The ID of the session to retitle.
SessionId SessionId `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) UnmarshalJSON ¶ added in v0.18.0
func (v *UnstableSetSessionTitleRequest) UnmarshalJSON(b []byte) error
func (*UnstableSetSessionTitleRequest) Validate ¶ added in v0.18.0
func (v *UnstableSetSessionTitleRequest) Validate() error
type UnstableSetSessionTitleResponse ¶ added in v0.18.0
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 Meta `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) UnmarshalJSON ¶ added in v0.18.0
func (v *UnstableSetSessionTitleResponse) UnmarshalJSON(b []byte) error
func (*UnstableSetSessionTitleResponse) Validate ¶ added in v0.18.0
func (v *UnstableSetSessionTitleResponse) Validate() error
type UnstableUnarchiveSessionRequest ¶ added in v0.18.0
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 Meta `json:"_meta,omitempty"`
// The ID of the session to unarchive.
SessionId SessionId `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) UnmarshalJSON ¶ added in v0.18.0
func (v *UnstableUnarchiveSessionRequest) UnmarshalJSON(b []byte) error
func (*UnstableUnarchiveSessionRequest) Validate ¶ added in v0.18.0
func (v *UnstableUnarchiveSessionRequest) Validate() error
type UnstableUnarchiveSessionResponse ¶ added in v0.18.0
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 Meta `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) UnmarshalJSON ¶ added in v0.18.0
func (v *UnstableUnarchiveSessionResponse) UnmarshalJSON(b []byte) error
func (*UnstableUnarchiveSessionResponse) Validate ¶ added in v0.18.0
func (v *UnstableUnarchiveSessionResponse) Validate() error
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/extensibility)
Meta Meta `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.
func (*UnstructuredCommandInput) UnmarshalJSON ¶ added in v0.15.0
func (v *UnstructuredCommandInput) UnmarshalJSON(b []byte) error
type Usage ¶ added in v0.10.8
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 Meta `json:"_meta,omitempty"`
// Total cache read tokens.
CachedReadTokens *int64 `json:"cachedReadTokens,omitempty"`
// Total cache write tokens.
CachedWriteTokens *int64 `json:"cachedWriteTokens,omitempty"`
// Total input tokens across all turns.
InputTokens int64 `json:"inputTokens"`
// Total output tokens across all turns.
OutputTokens int64 `json:"outputTokens"`
// Total thought/reasoning tokens
ThoughtTokens *int64 `json:"thoughtTokens,omitempty"`
// Sum of all token types across session.
TotalTokens int64 `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.
func (*Usage) UnmarshalJSON ¶ added in v0.15.0
type UsageUpdate ¶ added in v0.10.8
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/extensibility)
Meta Meta `json:"_meta,omitempty"`
// Cumulative session cost (optional).
Cost *Cost `json:"cost,omitempty"`
// Total context window size in tokens.
Size int64 `json:"size"`
// Tokens currently in context.
Used int64 `json:"used"`
}
Context window and cost update for a session.
func (*UsageUpdate) UnmarshalJSON ¶ added in v0.14.0
func (v *UsageUpdate) UnmarshalJSON(b []byte) error
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/extensibility)
Meta Meta `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) UnmarshalJSON ¶ added in v0.15.0
func (v *WaitForTerminalExitRequest) UnmarshalJSON(b []byte) error
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/extensibility)
Meta Meta `json:"_meta,omitempty"`
// The process exit code (may be null if terminated by signal).
ExitCode *int64 `json:"exitCode,omitempty"`
// The signal that terminated the process (may be null if exited normally).
Signal *string `json:"signal,omitempty"`
}
Response containing the exit status of a terminal command.
func (*WaitForTerminalExitResponse) UnmarshalJSON ¶ added in v0.15.0
func (v *WaitForTerminalExitResponse) UnmarshalJSON(b []byte) error
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/extensibility)
Meta Meta `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) UnmarshalJSON ¶ added in v0.15.0
func (v *WriteTextFileRequest) UnmarshalJSON(b []byte) error
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/extensibility)
Meta Meta `json:"_meta,omitempty"`
}
Response to 'fs/write_text_file'
func (*WriteTextFileResponse) UnmarshalJSON ¶ added in v0.15.0
func (v *WriteTextFileResponse) UnmarshalJSON(b []byte) error
func (*WriteTextFileResponse) Validate ¶
func (v *WriteTextFileResponse) Validate() error