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"
"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
}
// SetSessionConfigOption implements Agent.
func (a *agentExample) SetSessionConfigOption(ctx context.Context, params SetSessionConfigOptionRequest) (SetSessionConfigOptionResponse, error) {
return SetSessionConfigOptionResponse{}, nil
}
// CloseSession implements Agent.
func (a *agentExample) CloseSession(ctx context.Context, params CloseSessionRequest) (CloseSessionResponse, error) {
return CloseSessionResponse{}, nil
}
// ResumeSession implements Agent.
func (a *agentExample) ResumeSession(ctx context.Context, params ResumeSessionRequest) (ResumeSessionResponse, error) {
return ResumeSessionResponse{}, nil
}
// SetSessionModel implements Agent.
func (a *agentExample) SetSessionModel(ctx context.Context, params SetSessionModelRequest) (SetSessionModelResponse, error) {
return SetSessionModelResponse{}, 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: Ptr("Modifying configuration"),
Kind: Ptr(ToolKindEdit),
Status: Ptr(ToolCallStatusPending),
Locations: []ToolCallLocation{{Path: "/project/config.json"}},
RawInput: map[string]any{"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) ¶
Example_client launches the Go agent example, negotiates protocol, opens a session, and sends a simple prompt.
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:
fmt.Printf("\n[tool] %s -> %v\n", u.ToolCallUpdate.ToolCallId, u.ToolCallUpdate.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 {
if *p.Line-1 > 0 {
start = *p.Line - 1
}
if start > len(lines) {
start = len(lines)
}
}
end := len(lines)
if p.Limit != nil && *p.Limit > 0 && start+*p.Limit < end {
end = start + *p.Limit
}
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.
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) ¶
Example_gemini connects to a Gemini CLI speaking ACP over stdio, then initializes, opens a session, and sends a prompt.
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 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
- 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 AgentExperimental
- 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) 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) UnstableCompleteElicitation(ctx context.Context, params UnstableCompleteElicitationNotification) error
- func (c *AgentSideConnection) UnstableCreateElicitation(ctx context.Context, params UnstableCreateElicitationRequest) (UnstableCreateElicitationResponse, error)
- func (c *AgentSideConnection) WaitForTerminalExit(ctx context.Context, params WaitForTerminalExitRequest) (WaitForTerminalExitResponse, error)
- func (c *AgentSideConnection) WriteTextFile(ctx context.Context, params WriteTextFileRequest) (WriteTextFileResponse, error)
- type Annotations
- type AudioContent
- type AuthCapabilities
- type AuthEnvVar
- type AuthMethod
- type AuthMethodAgent
- type AuthMethodEnvVar
- type AuthMethodEnvVarInline
- type AuthMethodTerminal
- type AuthMethodTerminalInline
- type AuthenticateRequest
- type AuthenticateResponse
- type AvailableCommand
- type AvailableCommandInput
- type AvailableCommandsUpdate
- type BlobResourceContents
- type CancelNotification
- type Client
- type ClientCapabilities
- type ClientError
- type ClientExperimental
- type ClientNesCapabilities
- type ClientNotification
- type ClientRequest
- type ClientResponse
- type ClientResult
- 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) 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) 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) SetSessionModel(ctx context.Context, params SetSessionModelRequest) (SetSessionModelResponse, error)
- func (c *ClientSideConnection) UnstableAcceptNes(ctx context.Context, params UnstableAcceptNesNotification) error
- func (c *ClientSideConnection) UnstableCloseNes(ctx context.Context, params UnstableCloseNesRequest) (UnstableCloseNesResponse, error)
- func (c *ClientSideConnection) UnstableCloseSession(ctx context.Context, params UnstableCloseSessionRequest) (UnstableCloseSessionResponse, error)
- func (c *ClientSideConnection) UnstableDidChangeDocument(ctx context.Context, params UnstableDidChangeDocumentNotification) error
- func (c *ClientSideConnection) UnstableDidCloseDocument(ctx context.Context, params UnstableDidCloseDocumentNotification) error
- func (c *ClientSideConnection) UnstableDidFocusDocument(ctx context.Context, params UnstableDidFocusDocumentNotification) error
- func (c *ClientSideConnection) UnstableDidOpenDocument(ctx context.Context, params UnstableDidOpenDocumentNotification) error
- func (c *ClientSideConnection) UnstableDidSaveDocument(ctx context.Context, params UnstableDidSaveDocumentNotification) error
- func (c *ClientSideConnection) UnstableDisableProviders(ctx context.Context, params UnstableDisableProvidersRequest) (UnstableDisableProvidersResponse, 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) UnstableLogout(ctx context.Context, params UnstableLogoutRequest) (UnstableLogoutResponse, error)
- func (c *ClientSideConnection) UnstableRejectNes(ctx context.Context, params UnstableRejectNesNotification) error
- func (c *ClientSideConnection) UnstableResumeSession(ctx context.Context, params UnstableResumeSessionRequest) (UnstableResumeSessionResponse, error)
- func (c *ClientSideConnection) UnstableSetProviders(ctx context.Context, params UnstableSetProvidersRequest) (UnstableSetProvidersResponse, error)
- func (c *ClientSideConnection) UnstableSetSessionModel(ctx context.Context, params UnstableSetSessionModelRequest) (UnstableSetSessionModelResponse, error)
- func (c *ClientSideConnection) UnstableStartNes(ctx context.Context, params UnstableStartNesRequest) (UnstableStartNesResponse, error)
- func (c *ClientSideConnection) UnstableSuggestNes(ctx context.Context, params UnstableSuggestNesRequest) (UnstableSuggestNesResponse, error)
- type CloseSessionRequest
- type CloseSessionResponse
- type ConfigOptionUpdate
- type Connection
- type Content
- type ContentBlock
- type ContentBlockAudio
- type ContentBlockImage
- type ContentBlockResource
- type ContentBlockResourceLink
- type ContentBlockText
- type ContentChunk
- type Cost
- type CreateTerminalRequest
- type CreateTerminalResponse
- type CurrentModeUpdate
- type Diff
- type ElicitationCapabilities
- type ElicitationFormCapabilities
- type ElicitationUrlCapabilities
- type EmbeddedResource
- type EmbeddedResourceResource
- type EnvVariable
- type Error
- type ErrorCode
- type ErrorCodeAuthenticationRequired
- type ErrorCodeInternalError
- type ErrorCodeInvalidParams
- type ErrorCodeInvalidRequest
- type ErrorCodeMethodNotFound
- type ErrorCodeOther
- type ErrorCodeParseError
- type ErrorCodeResourceNotFound
- type ExtNotification
- type ExtRequest
- type ExtResponse
- type ExtensionMethodHandler
- type FileSystemCapabilities
- type HttpHeader
- type ImageContent
- type Implementation
- type InitializeProxyRequest
- type InitializeRequest
- type InitializeResponse
- type KillTerminalRequest
- type KillTerminalResponse
- type ListSessionsRequest
- type ListSessionsResponse
- type LoadSessionRequest
- type LoadSessionResponse
- type LogoutCapabilities
- type McpCapabilities
- type McpConnectRequest
- type McpConnectResponse
- type McpDisconnectNotification
- type McpOverAcpMessage
- type McpServer
- type McpServerHttp
- type McpServerHttpInline
- type McpServerSse
- type McpServerSseInline
- type McpServerStdio
- type MethodHandler
- type ModelId
- type ModelInfo
- type NesCapabilities
- type NesContextCapabilities
- type NesDiagnosticsCapabilities
- type NesDocumentDidChangeCapabilities
- type NesDocumentDidCloseCapabilities
- type NesDocumentDidFocusCapabilities
- type NesDocumentDidOpenCapabilities
- type NesDocumentDidSaveCapabilities
- type NesDocumentEventCapabilities
- type NesEditHistoryCapabilities
- type NesEventCapabilities
- type NesJumpCapabilities
- type NesOpenFilesCapabilities
- type NesRecentFilesCapabilities
- type NesRelatedSnippetsCapabilities
- type NesRenameCapabilities
- type NesSearchAndReplaceCapabilities
- type NesUserActionsCapabilities
- type NewSessionRequest
- type NewSessionResponse
- type PermissionOption
- type PermissionOptionId
- type PermissionOptionKind
- type Plan
- type PlanEntry
- type PlanEntryPriority
- type PlanEntryStatus
- type PositionEncodingKind
- type PromptCapabilities
- type PromptRequest
- type PromptResponse
- 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
- type RequestId
- type RequestIdNull
- type RequestIdNumber
- type RequestIdStr
- type RequestPermissionOutcome
- type RequestPermissionOutcomeCancelled
- type RequestPermissionOutcomeSelected
- type RequestPermissionRequest
- type RequestPermissionResponse
- type ResourceLink
- type ResumeSessionRequest
- type ResumeSessionResponse
- type Role
- type SelectedPermissionOutcome
- type SessionAdditionalDirectoriesCapabilities
- type SessionAvailableCommandsUpdate
- type SessionCapabilities
- type SessionCloseCapabilities
- type SessionConfigBoolean
- type SessionConfigGroupId
- type SessionConfigId
- type SessionConfigOption
- type SessionConfigOptionBoolean
- type SessionConfigOptionCategory
- type SessionConfigOptionCategoryOther
- type SessionConfigOptionSelect
- type SessionConfigOptionUpdate
- type SessionConfigSelect
- type SessionConfigSelectGroup
- type SessionConfigSelectOption
- type SessionConfigSelectOptions
- type SessionConfigSelectOptionsGrouped
- type SessionConfigSelectOptionsUngrouped
- type SessionConfigValueId
- type SessionCurrentModeUpdate
- type SessionForkCapabilities
- type SessionId
- type SessionInfo
- type SessionInfoUpdate
- type SessionListCapabilities
- type SessionMode
- type SessionModeId
- type SessionModeState
- type SessionModelState
- type SessionNotification
- type SessionResumeCapabilities
- type SessionSessionInfoUpdate
- type SessionToolCallUpdate
- type SessionUpdate
- func StartEditToolCall(id ToolCallId, title string, path string, content any, ...) SessionUpdate
- func StartPlan(entries ...PlanEntry) SessionUpdate
- func StartReadToolCall(id ToolCallId, title string, path string, opts ...ToolCallStartOpt) SessionUpdate
- func StartToolCall(id ToolCallId, title string, opts ...ToolCallStartOpt) SessionUpdate
- func StartToolCallStreaming(id ToolCallId, title string, kind ToolKind, opts ...ToolCallStartOpt) SessionUpdate
- func UpdateAgentMessage(content ContentBlock) SessionUpdate
- func UpdateAgentMessageText(text string) SessionUpdate
- func UpdateAgentThought(content ContentBlock) SessionUpdate
- func UpdateAgentThoughtText(text string) SessionUpdate
- func UpdateAvailableCommands(commands ...AvailableCommand) SessionUpdate
- func UpdateConfigOptions(opts []SessionConfigOption) SessionUpdate
- func UpdateCurrentMode(modeID SessionModeId) SessionUpdate
- func UpdatePlan(entries ...PlanEntry) SessionUpdate
- func UpdateSessionInfo(update SessionInfoUpdate) SessionUpdate
- func UpdateSessionTitle(title string) SessionUpdate
- func UpdateToolCall(id ToolCallId, opts ...ToolCallUpdateOpt) SessionUpdate
- func UpdateUsage(used, size int, cost ...Cost) SessionUpdate
- func UpdateUserMessage(content ContentBlock) SessionUpdate
- func UpdateUserMessageText(text string) SessionUpdate
- type SessionUpdateAgentMessageChunk
- type SessionUpdateAgentThoughtChunk
- type SessionUpdatePlan
- type SessionUpdateToolCall
- type SessionUpdateUserMessageChunk
- type SessionUsageUpdate
- type SetSessionConfigOptionBoolean
- type SetSessionConfigOptionRequest
- type SetSessionConfigOptionResponse
- type SetSessionConfigOptionValueId
- type SetSessionModeRequest
- type SetSessionModeResponse
- type SetSessionModelRequest
- type SetSessionModelResponse
- type StopReason
- type SuccessorMessage
- type Terminal
- type TerminalExitStatus
- type TerminalOutputRequest
- type TerminalOutputResponse
- type TextContent
- type TextDocumentSyncKind
- type TextResourceContents
- type ToolCall
- type ToolCallContent
- func ToolContent(block ContentBlock, opts ...ToolContentOpt) ToolCallContent
- func ToolDiffContent(path string, newText string, oldText ...string) ToolCallContent
- func ToolDiffContentWithOptions(path string, newText string, oldText *string, opts ...ToolDiffContentOpt) ToolCallContent
- func ToolTerminalRef(terminalID string, opts ...ToolTerminalContentOpt) ToolCallContent
- type ToolCallContentContent
- type ToolCallContentDiff
- type ToolCallContentTerminal
- type ToolCallId
- type ToolCallLocation
- type ToolCallStartOpt
- func WithStartContent(c []ToolCallContent) ToolCallStartOpt
- func WithStartKind(k ToolKind) ToolCallStartOpt
- func WithStartLocations(l []ToolCallLocation) ToolCallStartOpt
- func WithStartMeta(meta map[string]any) 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 WithUpdateMeta(meta map[string]any) ToolCallUpdateOpt
- func WithUpdateRawInput(v any) ToolCallUpdateOpt
- func WithUpdateRawOutput(v any) ToolCallUpdateOpt
- func WithUpdateStatus(s ToolCallStatus) ToolCallUpdateOpt
- func WithUpdateTitle(t string) ToolCallUpdateOpt
- type ToolContentOpt
- type ToolDiffContentOpt
- type ToolKind
- type ToolTerminalContentOpt
- type UnstableAcceptNesNotification
- type UnstableCancelRequestNotification
- type UnstableCloseNesRequest
- type UnstableCloseNesResponse
- type UnstableCloseSessionRequest
- type UnstableCloseSessionResponse
- type UnstableCompleteElicitationNotification
- type UnstableCreateElicitationAccept
- type UnstableCreateElicitationCancel
- type UnstableCreateElicitationDecline
- type UnstableCreateElicitationForm
- type UnstableCreateElicitationRequest
- type UnstableCreateElicitationResponse
- type UnstableCreateElicitationUrl
- type UnstableDidChangeDocumentNotification
- type UnstableDidCloseDocumentNotification
- type UnstableDidFocusDocumentNotification
- type UnstableDidOpenDocumentNotification
- type UnstableDidSaveDocumentNotification
- type UnstableDisableProvidersRequest
- type UnstableDisableProvidersResponse
- type UnstableElicitationAcceptAction
- type UnstableElicitationFormMode
- type UnstableElicitationId
- type UnstableElicitationRequestScope
- type UnstableElicitationSchema
- type UnstableElicitationSchemaType
- type UnstableElicitationSessionScope
- type UnstableElicitationUrlMode
- type UnstableForkSessionRequest
- type UnstableForkSessionResponse
- type UnstableListProvidersRequest
- type UnstableListProvidersResponse
- type UnstableLlmProtocol
- type UnstableLlmProtocolOther
- type UnstableLogoutRequest
- type UnstableLogoutResponse
- type UnstableModelId
- type UnstableModelInfo
- type UnstableNesDiagnostic
- type UnstableNesDiagnosticSeverity
- type UnstableNesEditHistoryEntry
- type UnstableNesEditSuggestion
- type UnstableNesExcerpt
- type UnstableNesJumpSuggestion
- type UnstableNesOpenFile
- type UnstableNesRecentFile
- type UnstableNesRejectReason
- type UnstableNesRelatedSnippet
- type UnstableNesRenameSuggestion
- type UnstableNesRepository
- type UnstableNesSearchAndReplaceSuggestion
- type UnstableNesSuggestContext
- type UnstableNesSuggestion
- func NewUnstableNesSuggestionEdit(id string, uri string, edits []UnstableNesTextEdit) UnstableNesSuggestion
- func NewUnstableNesSuggestionJump(id string, uri string, position UnstablePosition) UnstableNesSuggestion
- func NewUnstableNesSuggestionRename(id string, uri string, position UnstablePosition, newName string) UnstableNesSuggestion
- func NewUnstableNesSuggestionSearchAndReplace(id string, uri string, search string, replace string) UnstableNesSuggestion
- type UnstableNesSuggestionEdit
- type UnstableNesSuggestionJump
- type UnstableNesSuggestionRename
- type UnstableNesSuggestionSearchAndReplace
- type UnstableNesTextEdit
- type UnstableNesTriggerKind
- type UnstableNesUserAction
- type UnstablePosition
- type UnstableProviderCurrentConfig
- type UnstableProviderInfo
- type UnstableRange
- type UnstableRejectNesNotification
- type UnstableResumeSessionRequest
- type UnstableResumeSessionResponse
- type UnstableSessionConfigBoolean
- type UnstableSessionConfigOption
- type UnstableSessionConfigOptionBoolean
- type UnstableSessionConfigOptionSelect
- type UnstableSessionModelState
- type UnstableSetProvidersRequest
- type UnstableSetProvidersResponse
- type UnstableSetSessionModelRequest
- type UnstableSetSessionModelResponse
- type UnstableStartNesRequest
- type UnstableStartNesResponse
- type UnstableSuggestNesRequest
- type UnstableSuggestNesResponse
- type UnstableTextDocumentContentChangeEvent
- type UnstableWorkspaceFolder
- type UnstructuredCommandInput
- type Usage
- type UsageUpdate
- type WaitForTerminalExitRequest
- type WaitForTerminalExitResponse
- type WriteTextFileRequest
- type WriteTextFileResponse
Examples ¶
Constants ¶
const ( AgentMethodAuthenticate = "authenticate" AgentMethodDocumentDidChange = "document/didChange" AgentMethodDocumentDidClose = "document/didClose" AgentMethodDocumentDidFocus = "document/didFocus" AgentMethodDocumentDidOpen = "document/didOpen" AgentMethodDocumentDidSave = "document/didSave" AgentMethodInitialize = "initialize" AgentMethodLogout = "logout" AgentMethodNesAccept = "nes/accept" AgentMethodNesClose = "nes/close" AgentMethodNesReject = "nes/reject" AgentMethodNesStart = "nes/start" AgentMethodNesSuggest = "nes/suggest" AgentMethodProvidersDisable = "providers/disable" AgentMethodProvidersList = "providers/list" AgentMethodProvidersSet = "providers/set" AgentMethodSessionCancel = "session/cancel" AgentMethodSessionClose = "session/close" AgentMethodSessionFork = "session/fork" AgentMethodSessionList = "session/list" AgentMethodSessionLoad = "session/load" AgentMethodSessionNew = "session/new" AgentMethodSessionPrompt = "session/prompt" AgentMethodSessionResume = "session/resume" AgentMethodSessionSetConfigOption = "session/set_config_option" AgentMethodSessionSetMode = "session/set_mode" AgentMethodSessionSetModel = "session/set_model" )
Agent method names
const ( ClientMethodElicitationComplete = "elicitation/complete" ClientMethodElicitationCreate = "elicitation/create" ClientMethodFsReadTextFile = "fs/read_text_file" ClientMethodFsWriteTextFile = "fs/write_text_file" 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 ProtocolVersionNumber = 1
ProtocolVersionNumber is the ACP protocol version supported by this SDK.
Variables ¶
This section is empty.
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.
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/initialization)
Initialize(ctx context.Context, params InitializeRequest) (InitializeResponse, error)
// Notification to cancel ongoing operations for a session.
//
// See protocol docs: [Cancellation](https://agentclientprotocol.com/protocol/prompt-turn#cancellation)
Cancel(ctx context.Context, params CancelNotification) error
// Request parameters for closing an existing session.
CloseSession(ctx context.Context, params CloseSessionRequest) (CloseSessionResponse, 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/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/prompt-turn#1-user-message)
Prompt(ctx context.Context, params PromptRequest) (PromptResponse, error)
// Request parameters for resuming an existing session.
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)
// Request parameters for setting a session model.
SetSessionModel(ctx context.Context, params SetSessionModelRequest) (SetSessionModelResponse, error)
}
type AgentAuthCapabilities ¶
type AgentAuthCapabilities struct {
// The _meta property is reserved by ACP to allow clients and agents to attach additional
// metadata to their interactions. Implementations MUST NOT make assumptions about values at
// these keys.
//
// See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
Meta map[string]any `json:"_meta,omitempty"`
// Whether the agent supports the logout method.
//
// By supplying '{}' it means that 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.
Authentication-related capabilities supported by the agent.
type AgentCapabilities ¶
type AgentCapabilities struct {
// The _meta property is reserved by ACP to allow clients and agents to attach additional
// metadata to their interactions. Implementations MUST NOT make assumptions about values at
// these keys.
//
// See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
Meta map[string]any `json:"_meta,omitempty"`
// **UNSTABLE**
//
// This capability is not part of the spec yet, and may be removed or changed at any point.
//
// 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 {"http":false,"sse":false} if unset.
McpCapabilities McpCapabilities `json:"mcpCapabilities,omitempty"`
// **UNSTABLE**
//
// This capability is not part of the spec yet, and may be removed or changed at any point.
//
// NES (Next Edit Suggestions) capabilities supported by the agent.
Nes *NesCapabilities `json:"nes,omitempty"`
// **UNSTABLE**
//
// This capability is not part of the spec yet, and may be removed or changed at any point.
//
// The position encoding selected by the agent from the client's supported encodings.
PositionEncoding *PositionEncodingKind `json:"positionEncoding,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.
//
// By supplying '{}' it means that the agent supports provider configuration methods.
Providers *ProvidersCapabilities `json:"providers,omitempty"`
// 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/initialization#agent-capabilities)
func (AgentCapabilities) MarshalJSON ¶
func (v AgentCapabilities) MarshalJSON() ([]byte, error)
func (*AgentCapabilities) UnmarshalJSON ¶
func (v *AgentCapabilities) UnmarshalJSON(b []byte) error
type AgentError ¶
type AgentExperimental ¶
type AgentExperimental interface {
// Notification sent when a file is edited.
UnstableDidChangeDocument(ctx context.Context, params UnstableDidChangeDocumentNotification) error
// Notification sent when a file is closed.
UnstableDidCloseDocument(ctx context.Context, params UnstableDidCloseDocumentNotification) error
// Notification sent when a file becomes the active editor tab.
UnstableDidFocusDocument(ctx context.Context, params UnstableDidFocusDocumentNotification) error
// Notification sent when a file is opened in the editor.
UnstableDidOpenDocument(ctx context.Context, params UnstableDidOpenDocumentNotification) error
// Notification sent when a file is saved.
UnstableDidSaveDocument(ctx context.Context, params UnstableDidSaveDocumentNotification) error
// **UNSTABLE**
//
// This capability is not part of the spec yet, and may be removed or changed at any point.
//
// Request parameters for the logout method.
//
// Terminates the current authenticated session.
UnstableLogout(ctx context.Context, params UnstableLogoutRequest) (UnstableLogoutResponse, error)
// Notification sent when a suggestion is accepted.
UnstableAcceptNes(ctx context.Context, params UnstableAcceptNesNotification) error
// Request to close an NES session.
//
// The agent **must** cancel any ongoing work related to the NES session
// and then free up any resources associated with the session.
UnstableCloseNes(ctx context.Context, params UnstableCloseNesRequest) (UnstableCloseNesResponse, error)
// Notification sent when a suggestion is rejected.
UnstableRejectNes(ctx context.Context, params UnstableRejectNesNotification) error
// Request to start an NES session.
UnstableStartNes(ctx context.Context, params UnstableStartNesRequest) (UnstableStartNesResponse, error)
// Request for a code suggestion.
UnstableSuggestNes(ctx context.Context, params UnstableSuggestNesRequest) (UnstableSuggestNesResponse, error)
// **UNSTABLE**
//
// This capability is not part of the spec yet, and may be removed or changed at any point.
//
// Request parameters for 'providers/disable'.
UnstableDisableProviders(ctx context.Context, params UnstableDisableProvidersRequest) (UnstableDisableProvidersResponse, error)
// **UNSTABLE**
//
// This capability is not part of the spec yet, and may be removed or changed at any point.
//
// Request parameters for 'providers/list'.
UnstableListProviders(ctx context.Context, params UnstableListProvidersRequest) (UnstableListProvidersResponse, error)
// **UNSTABLE**
//
// This capability is not part of the spec yet, and may be removed or changed at any point.
//
// Request parameters for 'providers/set'.
//
// Replaces the full configuration for one provider id.
UnstableSetProviders(ctx context.Context, params UnstableSetProvidersRequest) (UnstableSetProvidersResponse, error)
// **UNSTABLE**
//
// This capability is not part of the spec yet, and may be removed or changed at any point.
//
// 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.
UnstableCloseSession(ctx context.Context, params UnstableCloseSessionRequest) (UnstableCloseSessionResponse, error)
// **UNSTABLE**
//
// This capability is not part of the spec yet, and may be removed or changed at any point.
//
// Request parameters for forking an existing session.
//
// Creates a new session based on the context of an existing one, allowing
// operations like generating summaries without affecting the original session's history.
//
// Only available if the Agent supports the 'session.fork' capability.
UnstableForkSession(ctx context.Context, params UnstableForkSessionRequest) (UnstableForkSessionResponse, error)
// **UNSTABLE**
//
// This capability is not part of the spec yet, and may be removed or changed at any point.
//
// Request parameters for 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.
UnstableResumeSession(ctx context.Context, params UnstableResumeSessionRequest) (UnstableResumeSessionResponse, error)
// **UNSTABLE**
//
// This capability is not part of the spec yet, and may be removed or changed at any point.
//
// Request parameters for setting a session model.
UnstableSetSessionModel(ctx context.Context, params UnstableSetSessionModelRequest) (UnstableSetSessionModelResponse, error)
}
AgentExperimental defines unstable methods that are not part of the official spec. These may change or be removed without notice.
type AgentLoader ¶
type AgentLoader interface {
// Request parameters for loading an existing session.
//
// Only available if the Agent supports the 'loadSession' capability.
//
// See protocol docs: [Loading Sessions](https://agentclientprotocol.com/protocol/session-setup#loading-sessions)
LoadSession(ctx context.Context, params LoadSessionRequest) (LoadSessionResponse, error)
}
AgentLoader defines optional support for loading sessions. Implement and advertise the capability to enable 'session/load'.
type AgentNotification ¶
type AgentNotification struct {
Method string `json:"method"`
Params any `json:"params,omitempty"`
}
func (*AgentNotification) Validate ¶
func (v *AgentNotification) Validate() error
type AgentRequest ¶
type AgentRequest struct {
Id RequestId `json:"id"`
Method string `json:"method"`
Params any `json:"params,omitempty"`
}
func (*AgentRequest) Validate ¶
func (v *AgentRequest) Validate() error
type AgentResponse ¶
type AgentResponse struct {
Result *AgentResult `json:"-"`
Error *AgentError `json:"-"`
}
func (AgentResponse) MarshalJSON ¶
func (u AgentResponse) MarshalJSON() ([]byte, error)
func (*AgentResponse) UnmarshalJSON ¶
func (u *AgentResponse) UnmarshalJSON(b []byte) error
type AgentResult ¶
type AgentResult struct {
Id RequestId `json:"id"`
// All possible responses that an agent can send to a client.
//
// This enum is used internally for routing RPC responses. You typically won't need
// to use this directly - the responses are handled automatically by the connection.
//
// These are responses to the corresponding 'ClientRequest' variants.
Result any `json:"result"`
}
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 ¶
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) 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 ¶
func (c *AgentSideConnection) KillTerminal(ctx context.Context, params KillTerminalRequest) (KillTerminalResponse, error)
func (*AgentSideConnection) NotifyExtension ¶
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) UnstableCompleteElicitation ¶
func (c *AgentSideConnection) UnstableCompleteElicitation(ctx context.Context, params UnstableCompleteElicitationNotification) error
func (*AgentSideConnection) UnstableCreateElicitation ¶
func (c *AgentSideConnection) UnstableCreateElicitation(ctx context.Context, params UnstableCreateElicitationRequest) (UnstableCreateElicitationResponse, 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 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/extensibility)
Meta map[string]any `json:"_meta,omitempty"`
Audience []Role `json:"audience,omitempty"`
LastModified *string `json:"lastModified,omitempty"`
Priority *float64 `json:"priority,omitempty"`
}
Optional annotations for the client. The client can use annotations to inform how objects are used or displayed
type AudioContent ¶
type AudioContent struct {
// The _meta property is reserved by ACP to allow clients and agents to attach additional
// metadata to their interactions. Implementations MUST NOT make assumptions about values at
// these keys.
//
// See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
Meta map[string]any `json:"_meta,omitempty"`
Annotations *Annotations `json:"annotations,omitempty"`
Data string `json:"data"`
MimeType string `json:"mimeType"`
}
Audio provided to or from an LLM.
type AuthCapabilities ¶
type AuthCapabilities struct {
// The _meta property is reserved by ACP to allow clients and agents to attach additional
// metadata to their interactions. Implementations MUST NOT make assumptions about values at
// these keys.
//
// See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
Meta map[string]any `json:"_meta,omitempty"`
// Whether the client supports 'terminal' authentication methods.
//
// When 'true', the agent may include 'terminal' entries in its authentication methods.
//
// Defaults to false if unset.
Terminal bool `json:"terminal,omitempty"`
}
**UNSTABLE**
This capability is not part of the spec yet, and may be removed or changed at any point.
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 ¶
func (v AuthCapabilities) MarshalJSON() ([]byte, error)
func (*AuthCapabilities) UnmarshalJSON ¶
func (v *AuthCapabilities) UnmarshalJSON(b []byte) error
type AuthEnvVar ¶
type AuthEnvVar struct {
// The _meta property is reserved by ACP to allow clients and agents to attach additional
// metadata to their interactions. Implementations MUST NOT make assumptions about values at
// these keys.
//
// See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
Meta map[string]any `json:"_meta,omitempty"`
// Human-readable label for this variable, displayed in client UI.
Label *string `json:"label,omitempty"`
// The environment variable name (e.g. '"OPENAI_API_KEY"').
Name string `json:"name"`
// Whether this variable is optional.
//
// Defaults to 'false'.
//
// Defaults to false if unset.
Optional bool `json:"optional,omitempty"`
// Whether this value is a secret (e.g. API key, token).
// Clients should use a password-style input for secret vars.
//
// Defaults to 'true'.
//
// Defaults to true if unset.
Secret bool `json:"secret,omitempty"`
}
**UNSTABLE**
This capability is not part of the spec yet, and may be removed or changed at any point.
Describes a single environment variable for an ['AuthMethodEnvVar'] authentication method.
func (AuthEnvVar) MarshalJSON ¶
func (v AuthEnvVar) MarshalJSON() ([]byte, error)
func (*AuthEnvVar) UnmarshalJSON ¶
func (v *AuthEnvVar) UnmarshalJSON(b []byte) error
type AuthMethod ¶
type AuthMethod struct {
// **UNSTABLE**
//
// This capability is not part of the spec yet, and may be removed or changed at any point.
//
// User provides a key that the client passes to the agent as an environment variable.
EnvVar *AuthMethodEnvVarInline `json:"-"`
// **UNSTABLE**
//
// This capability is not part of the spec yet, and may be removed or changed at any point.
//
// Client runs an interactive terminal for the user to authenticate via a TUI.
Terminal *AuthMethodTerminalInline `json:"-"`
// Agent handles authentication itself.
//
// This is the default when no 'type' is specified.
Agent *AuthMethodAgent `json:"-"`
}
func (AuthMethod) MarshalJSON ¶
func (u AuthMethod) MarshalJSON() ([]byte, error)
func (*AuthMethod) UnmarshalJSON ¶
func (u *AuthMethod) UnmarshalJSON(b []byte) error
type AuthMethodAgent ¶
type AuthMethodAgent struct {
// The _meta property is reserved by ACP to allow clients and agents to attach additional
// metadata to their interactions. Implementations MUST NOT make assumptions about values at
// these keys.
//
// See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
Meta map[string]any `json:"_meta,omitempty"`
// Optional description providing more details about this authentication method.
Description *string `json:"description,omitempty"`
// Unique identifier for this authentication method.
Id string `json:"id"`
// Human-readable name of the authentication method.
Name string `json:"name"`
}
Agent handles authentication itself.
This is the default authentication method type.
type AuthMethodEnvVar ¶
type AuthMethodEnvVar struct {
// The _meta property is reserved by ACP to allow clients and agents to attach additional
// metadata to their interactions. Implementations MUST NOT make assumptions about values at
// these keys.
//
// See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
Meta map[string]any `json:"_meta,omitempty"`
// Optional description providing more details about this authentication method.
Description *string `json:"description,omitempty"`
// Unique identifier for this authentication method.
Id string `json:"id"`
// Optional link to a page where the user can obtain their credentials.
Link *string `json:"link,omitempty"`
// Human-readable name of the authentication method.
Name string `json:"name"`
// The environment variables the client should set.
Vars []AuthEnvVar `json:"vars"`
}
**UNSTABLE**
This capability is not part of the spec yet, and may be removed or changed at any point.
Environment variable authentication method.
The user provides credentials that the client passes to the agent as environment variables.
type AuthMethodEnvVarInline ¶
type AuthMethodEnvVarInline struct {
// The _meta property is reserved by ACP to allow clients and agents to attach additional
// metadata to their interactions. Implementations MUST NOT make assumptions about values at
// these keys.
//
// See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
Meta map[string]any `json:"_meta,omitempty"`
// Optional description providing more details about this authentication method.
Description *string `json:"description,omitempty"`
// Unique identifier for this authentication method.
Id string `json:"id"`
// Optional link to a page where the user can obtain their credentials.
Link *string `json:"link,omitempty"`
// Human-readable name of the authentication method.
Name string `json:"name"`
Type string `json:"type"`
// The environment variables the client should set.
Vars []AuthEnvVar `json:"vars"`
}
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'. **UNSTABLE**
This capability is not part of the spec yet, and may be removed or changed at any point.
User provides a key that the client passes to the agent as an environment variable.
type AuthMethodTerminal ¶
type AuthMethodTerminal struct {
// The _meta property is reserved by ACP to allow clients and agents to attach additional
// metadata to their interactions. Implementations MUST NOT make assumptions about values at
// these keys.
//
// See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
Meta map[string]any `json:"_meta,omitempty"`
// Additional arguments to pass when running the agent binary for terminal auth.
Args []string `json:"args,omitempty"`
// Optional description providing more details about this authentication method.
Description *string `json:"description,omitempty"`
// Additional environment variables to set when running the agent binary for terminal auth.
Env map[string]any `json:"env,omitempty"`
// Unique identifier for this authentication method.
Id string `json:"id"`
// Human-readable name of the authentication method.
Name string `json:"name"`
}
**UNSTABLE**
This capability is not part of the spec yet, and may be removed or changed at any point.
Terminal-based authentication method.
The client runs an interactive terminal for the user to authenticate via a TUI.
type AuthMethodTerminalInline ¶
type AuthMethodTerminalInline struct {
// The _meta property is reserved by ACP to allow clients and agents to attach additional
// metadata to their interactions. Implementations MUST NOT make assumptions about values at
// these keys.
//
// See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
Meta map[string]any `json:"_meta,omitempty"`
// Additional arguments to pass when running the agent binary for terminal auth.
Args []string `json:"args,omitempty"`
// Optional description providing more details about this authentication method.
Description *string `json:"description,omitempty"`
// Additional environment variables to set when running the agent binary for terminal auth.
Env map[string]any `json:"env,omitempty"`
// Unique identifier for this authentication method.
Id string `json:"id"`
// Human-readable name of the authentication method.
Name string `json:"name"`
Type string `json:"type"`
}
**UNSTABLE**
This capability is not part of the spec yet, and may be removed or changed at any point.
Client runs an interactive terminal for the user to authenticate via a TUI.
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/extensibility)
Meta map[string]any `json:"_meta,omitempty"`
// The ID of the authentication method to use.
// Must be one of the methods advertised in the initialize response.
MethodId string `json:"methodId"`
}
Request parameters for the authenticate method.
Specifies which authentication method to use.
func (*AuthenticateRequest) Validate ¶
func (v *AuthenticateRequest) Validate() error
type AuthenticateResponse ¶
type AuthenticateResponse struct {
// The _meta property is reserved by ACP to allow clients and agents to attach additional
// metadata to their interactions. Implementations MUST NOT make assumptions about values at
// these keys.
//
// See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
Meta map[string]any `json:"_meta,omitempty"`
}
Response to the 'authenticate' method.
func (*AuthenticateResponse) Validate ¶
func (v *AuthenticateResponse) Validate() error
type AvailableCommand ¶
type AvailableCommand struct {
// The _meta property is reserved by ACP to allow clients and agents to attach additional
// metadata to their interactions. Implementations MUST NOT make assumptions about values at
// these keys.
//
// See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
Meta map[string]any `json:"_meta,omitempty"`
// Human-readable description of what the command does.
Description string `json:"description"`
// Input for the command if required
Input *AvailableCommandInput `json:"input,omitempty"`
// Command name (e.g., 'create_plan', 'research_codebase').
Name string `json:"name"`
}
Information about a command.
type AvailableCommandInput ¶
type AvailableCommandInput struct {
// All text that was typed after the command name is provided as input.
Unstructured *UnstructuredCommandInput `json:"-"`
}
The input specification for a command.
func (AvailableCommandInput) MarshalJSON ¶
func (u AvailableCommandInput) MarshalJSON() ([]byte, error)
func (*AvailableCommandInput) UnmarshalJSON ¶
func (u *AvailableCommandInput) UnmarshalJSON(b []byte) error
type AvailableCommandsUpdate ¶
type AvailableCommandsUpdate struct {
// The _meta property is reserved by ACP to allow clients and agents to attach additional
// metadata to their interactions. Implementations MUST NOT make assumptions about values at
// these keys.
//
// See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
Meta map[string]any `json:"_meta,omitempty"`
// Commands the agent can execute
AvailableCommands []AvailableCommand `json:"availableCommands"`
}
Available commands are ready or have changed
type BlobResourceContents ¶
type BlobResourceContents struct {
// The _meta property is reserved by ACP to allow clients and agents to attach additional
// metadata to their interactions. Implementations MUST NOT make assumptions about values at
// these keys.
//
// See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
Meta map[string]any `json:"_meta,omitempty"`
Blob string `json:"blob"`
MimeType *string `json:"mimeType,omitempty"`
Uri string `json:"uri"`
}
Binary resource contents.
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/extensibility)
Meta map[string]any `json:"_meta,omitempty"`
// The ID of the session to cancel operations for.
SessionId SessionId `json:"sessionId"`
}
Notification to cancel ongoing operations for a session.
See protocol docs: [Cancellation](https://agentclientprotocol.com/protocol/prompt-turn#cancellation)
func (*CancelNotification) Validate ¶
func (v *CancelNotification) Validate() error
type Client ¶
type Client interface {
// 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/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/prompt-turn#3-agent-reports-output)
SessionUpdate(ctx context.Context, params SessionNotification) error
// Request to create a new terminal and execute a command.
CreateTerminal(ctx context.Context, params CreateTerminalRequest) (CreateTerminalResponse, error)
// Request to kill a terminal without releasing it.
KillTerminal(ctx context.Context, params KillTerminalRequest) (KillTerminalResponse, error)
// Request to get the current output and status of a terminal.
TerminalOutput(ctx context.Context, params TerminalOutputRequest) (TerminalOutputResponse, error)
// Request to release a terminal and free its resources.
ReleaseTerminal(ctx context.Context, params ReleaseTerminalRequest) (ReleaseTerminalResponse, error)
// Request to wait for a terminal command to exit.
WaitForTerminalExit(ctx context.Context, params WaitForTerminalExitRequest) (WaitForTerminalExitResponse, error)
}
type ClientCapabilities ¶
type ClientCapabilities struct {
// The _meta property is reserved by ACP to allow clients and agents to attach additional
// metadata to their interactions. Implementations MUST NOT make assumptions about values at
// these keys.
//
// See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
Meta map[string]any `json:"_meta,omitempty"`
// **UNSTABLE**
//
// This capability is not part of the spec yet, and may be removed or changed at any point.
//
// 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"`
// **UNSTABLE**
//
// This capability is not part of the spec yet, and may be removed or changed at any point.
//
// Elicitation capabilities supported by the client.
// Determines which elicitation modes the agent may use.
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.
//
// NES (Next Edit Suggestions) capabilities supported by the client.
Nes *ClientNesCapabilities `json:"nes,omitempty"`
// **UNSTABLE**
//
// This capability is not part of the spec yet, and may be removed or changed at any point.
//
// The position encodings supported by the client, in order of preference.
PositionEncodings []PositionEncodingKind `json:"positionEncodings,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/initialization#client-capabilities)
func (ClientCapabilities) MarshalJSON ¶
func (v ClientCapabilities) MarshalJSON() ([]byte, error)
func (*ClientCapabilities) UnmarshalJSON ¶
func (v *ClientCapabilities) UnmarshalJSON(b []byte) error
type ClientError ¶
type ClientExperimental ¶
type ClientExperimental interface {
// **UNSTABLE**
//
// This capability is not part of the spec yet, and may be removed or changed at any point.
//
// Notification sent by the agent when a URL-based elicitation is complete.
UnstableCompleteElicitation(ctx context.Context, params UnstableCompleteElicitationNotification) error
// **UNSTABLE**
//
// This capability is not part of the spec yet, and may be removed or changed at any point.
//
// 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.
UnstableCreateElicitation(ctx context.Context, params UnstableCreateElicitationRequest) (UnstableCreateElicitationResponse, error)
}
ClientExperimental defines unstable methods that are not part of the official spec. These may change or be removed without notice.
type ClientNesCapabilities ¶
type ClientNesCapabilities struct {
// The _meta property is reserved by ACP to allow clients and agents to attach additional
// metadata to their interactions. Implementations MUST NOT make assumptions about values at
// these keys.
//
// See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
Meta map[string]any `json:"_meta,omitempty"`
// Whether the client supports the 'jump' suggestion kind.
Jump *NesJumpCapabilities `json:"jump,omitempty"`
// Whether the client supports the 'rename' suggestion kind.
Rename *NesRenameCapabilities `json:"rename,omitempty"`
// Whether the client supports the 'searchAndReplace' suggestion kind.
SearchAndReplace *NesSearchAndReplaceCapabilities `json:"searchAndReplace,omitempty"`
}
NES capabilities advertised by the client during initialization.
type ClientNotification ¶
type ClientNotification struct {
Method string `json:"method"`
Params any `json:"params,omitempty"`
}
func (*ClientNotification) Validate ¶
func (v *ClientNotification) Validate() error
type ClientRequest ¶
type ClientRequest struct {
Id RequestId `json:"id"`
Method string `json:"method"`
Params any `json:"params,omitempty"`
}
func (*ClientRequest) Validate ¶
func (v *ClientRequest) Validate() error
type ClientResponse ¶
type ClientResponse struct {
Result *ClientResult `json:"-"`
Error *ClientError `json:"-"`
}
func (ClientResponse) MarshalJSON ¶
func (u ClientResponse) MarshalJSON() ([]byte, error)
func (*ClientResponse) UnmarshalJSON ¶
func (u *ClientResponse) UnmarshalJSON(b []byte) error
type ClientResult ¶
type ClientResult struct {
Id RequestId `json:"id"`
// All possible responses that a client can send to an agent.
//
// This enum is used internally for routing RPC responses. You typically won't need
// to use this directly - the responses are handled automatically by the connection.
//
// These are responses to the corresponding 'AgentRequest' variants.
Result any `json:"result"`
}
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 ¶
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.15.0
func (c *ClientSideConnection) CloseSession(ctx context.Context, params CloseSessionRequest) (CloseSessionResponse, 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 ¶
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) NewSession ¶
func (c *ClientSideConnection) NewSession(ctx context.Context, params NewSessionRequest) (NewSessionResponse, error)
func (*ClientSideConnection) NotifyExtension ¶
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.15.0
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 ¶
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) SetSessionModel ¶ added in v0.15.0
func (c *ClientSideConnection) SetSessionModel(ctx context.Context, params SetSessionModelRequest) (SetSessionModelResponse, error)
func (*ClientSideConnection) UnstableAcceptNes ¶
func (c *ClientSideConnection) UnstableAcceptNes(ctx context.Context, params UnstableAcceptNesNotification) error
func (*ClientSideConnection) UnstableCloseNes ¶
func (c *ClientSideConnection) UnstableCloseNes(ctx context.Context, params UnstableCloseNesRequest) (UnstableCloseNesResponse, error)
func (*ClientSideConnection) UnstableCloseSession ¶
func (c *ClientSideConnection) UnstableCloseSession(ctx context.Context, params UnstableCloseSessionRequest) (UnstableCloseSessionResponse, error)
func (*ClientSideConnection) UnstableDidChangeDocument ¶
func (c *ClientSideConnection) UnstableDidChangeDocument(ctx context.Context, params UnstableDidChangeDocumentNotification) error
func (*ClientSideConnection) UnstableDidCloseDocument ¶
func (c *ClientSideConnection) UnstableDidCloseDocument(ctx context.Context, params UnstableDidCloseDocumentNotification) error
func (*ClientSideConnection) UnstableDidFocusDocument ¶
func (c *ClientSideConnection) UnstableDidFocusDocument(ctx context.Context, params UnstableDidFocusDocumentNotification) error
func (*ClientSideConnection) UnstableDidOpenDocument ¶
func (c *ClientSideConnection) UnstableDidOpenDocument(ctx context.Context, params UnstableDidOpenDocumentNotification) error
func (*ClientSideConnection) UnstableDidSaveDocument ¶
func (c *ClientSideConnection) UnstableDidSaveDocument(ctx context.Context, params UnstableDidSaveDocumentNotification) error
func (*ClientSideConnection) UnstableDisableProviders ¶
func (c *ClientSideConnection) UnstableDisableProviders(ctx context.Context, params UnstableDisableProvidersRequest) (UnstableDisableProvidersResponse, error)
func (*ClientSideConnection) UnstableForkSession ¶
func (c *ClientSideConnection) UnstableForkSession(ctx context.Context, params UnstableForkSessionRequest) (UnstableForkSessionResponse, error)
func (*ClientSideConnection) UnstableListProviders ¶
func (c *ClientSideConnection) UnstableListProviders(ctx context.Context, params UnstableListProvidersRequest) (UnstableListProvidersResponse, error)
func (*ClientSideConnection) UnstableLogout ¶
func (c *ClientSideConnection) UnstableLogout(ctx context.Context, params UnstableLogoutRequest) (UnstableLogoutResponse, error)
func (*ClientSideConnection) UnstableRejectNes ¶
func (c *ClientSideConnection) UnstableRejectNes(ctx context.Context, params UnstableRejectNesNotification) error
func (*ClientSideConnection) UnstableResumeSession ¶
func (c *ClientSideConnection) UnstableResumeSession(ctx context.Context, params UnstableResumeSessionRequest) (UnstableResumeSessionResponse, error)
func (*ClientSideConnection) UnstableSetProviders ¶
func (c *ClientSideConnection) UnstableSetProviders(ctx context.Context, params UnstableSetProvidersRequest) (UnstableSetProvidersResponse, error)
func (*ClientSideConnection) UnstableSetSessionModel ¶
func (c *ClientSideConnection) UnstableSetSessionModel(ctx context.Context, params UnstableSetSessionModelRequest) (UnstableSetSessionModelResponse, error)
func (*ClientSideConnection) UnstableStartNes ¶
func (c *ClientSideConnection) UnstableStartNes(ctx context.Context, params UnstableStartNesRequest) (UnstableStartNesResponse, error)
func (*ClientSideConnection) UnstableSuggestNes ¶
func (c *ClientSideConnection) UnstableSuggestNes(ctx context.Context, params UnstableSuggestNesRequest) (UnstableSuggestNesResponse, error)
type CloseSessionRequest ¶ added in v0.15.0
type CloseSessionRequest = UnstableCloseSessionRequest
**UNSTABLE**
This capability is not part of the spec yet, and may be removed or changed at any point.
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.
type CloseSessionResponse ¶ added in v0.15.0
type CloseSessionResponse = UnstableCloseSessionResponse
Response from closing a session.
type ConfigOptionUpdate ¶
type ConfigOptionUpdate struct {
// The _meta property is reserved by ACP to allow clients and agents to attach additional
// metadata to their interactions. Implementations MUST NOT make assumptions about values at
// these keys.
//
// See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
Meta map[string]any `json:"_meta,omitempty"`
// The full set of configuration options and their current values.
ConfigOptions []SessionConfigOption `json:"configOptions"`
}
Session configuration options have been updated.
type Connection ¶
type Connection struct {
// contains filtered or unexported fields
}
Connection is a 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.
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 ¶
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/extensibility)
Meta map[string]any `json:"_meta,omitempty"`
// The actual content block.
Content ContentBlock `json:"content"`
}
Standard content block (text, images, resources).
type ContentBlock ¶
type ContentBlock struct {
// Text content. May be plain text or formatted with Markdown.
//
// All agents MUST support text content blocks in prompts.
// Clients SHOULD render this text as Markdown.
Text *ContentBlockText `json:"-"`
// Images for visual context or analysis.
//
// Requires the 'image' prompt capability when included in prompts.
Image *ContentBlockImage `json:"-"`
// Audio data for transcription or analysis.
//
// Requires the 'audio' prompt capability when included in prompts.
Audio *ContentBlockAudio `json:"-"`
// References to resources that the agent can access.
//
// All agents MUST support resource links in prompts.
ResourceLink *ContentBlockResourceLink `json:"-"`
// Complete resource contents embedded directly in the message.
//
// Preferred for including context as it avoids extra round-trips.
//
// Requires the 'embeddedContext' prompt capability when included in prompts.
Resource *ContentBlockResource `json:"-"`
}
func 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/extensibility)
Meta map[string]any `json:"_meta,omitempty"`
Annotations *Annotations `json:"annotations,omitempty"`
Data string `json:"data"`
MimeType string `json:"mimeType"`
Type string `json:"type"`
}
Audio data for transcription or analysis.
Requires the 'audio' prompt capability when included in prompts.
type ContentBlockImage ¶
type ContentBlockImage struct {
// The _meta property is reserved by ACP to allow clients and agents to attach additional
// metadata to their interactions. Implementations MUST NOT make assumptions about values at
// these keys.
//
// See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
Meta map[string]any `json:"_meta,omitempty"`
Annotations *Annotations `json:"annotations,omitempty"`
Data string `json:"data"`
MimeType string `json:"mimeType"`
Type string `json:"type"`
Uri *string `json:"uri,omitempty"`
}
Images for visual context or analysis.
Requires the 'image' prompt capability when included in prompts.
type ContentBlockResource ¶
type ContentBlockResource struct {
// The _meta property is reserved by ACP to allow clients and agents to attach additional
// metadata to their interactions. Implementations MUST NOT make assumptions about values at
// these keys.
//
// See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
Meta map[string]any `json:"_meta,omitempty"`
Annotations *Annotations `json:"annotations,omitempty"`
Resource EmbeddedResourceResource `json:"resource"`
Type string `json:"type"`
}
Complete resource contents embedded directly in the message.
Preferred for including context as it avoids extra round-trips.
Requires the 'embeddedContext' prompt capability when included in prompts.
type ContentBlockResourceLink ¶
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/extensibility)
Meta map[string]any `json:"_meta,omitempty"`
Annotations *Annotations `json:"annotations,omitempty"`
Description *string `json:"description,omitempty"`
MimeType *string `json:"mimeType,omitempty"`
Name string `json:"name"`
Size *int `json:"size,omitempty"`
Title *string `json:"title,omitempty"`
Type string `json:"type"`
Uri string `json:"uri"`
}
References to resources that the agent can access.
All agents MUST support resource links in prompts.
type ContentBlockText ¶
type ContentBlockText struct {
// The _meta property is reserved by ACP to allow clients and agents to attach additional
// metadata to their interactions. Implementations MUST NOT make assumptions about values at
// these keys.
//
// See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
Meta map[string]any `json:"_meta,omitempty"`
Annotations *Annotations `json:"annotations,omitempty"`
Text string `json:"text"`
Type string `json:"type"`
}
Content blocks represent displayable information in the Agent Client Protocol.
They provide a structured way to handle various types of user-facing content—whether it's text from language models, images for analysis, or embedded resources for context.
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), enabling agents to seamlessly forward content from MCP tool outputs without transformation.
See protocol docs: Content(https://agentclientprotocol.com/protocol/content) Text content. May be plain text or formatted with Markdown.
All agents MUST support text content blocks in prompts. Clients SHOULD render this text as Markdown.
type ContentChunk ¶
type ContentChunk struct {
// The _meta property is reserved by ACP to allow clients and agents to attach additional
// metadata to their interactions. Implementations MUST NOT make assumptions about values at
// these keys.
//
// See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
Meta map[string]any `json:"_meta,omitempty"`
// A single item of content
Content ContentBlock `json:"content"`
// **UNSTABLE**
//
// This capability is not part of the spec yet, and may be removed or changed at any point.
//
// 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.
// Both clients and agents MUST use UUID format for message IDs.
MessageId *string `json:"messageId,omitempty"`
}
A streamed item of content
type Cost ¶
type Cost struct {
// Total cumulative cost for session.
Amount float64 `json:"amount"`
// ISO 4217 currency code (e.g., "USD", "EUR").
Currency string `json:"currency"`
}
**UNSTABLE**
This capability is not part of the spec yet, and may be removed or changed at any point.
Cost information for a session.
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/extensibility)
Meta map[string]any `json:"_meta,omitempty"`
// Array of command arguments.
Args []string `json:"args,omitempty"`
// The command to execute.
Command string `json:"command"`
// Working directory for the command (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 *int `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) 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/extensibility)
Meta map[string]any `json:"_meta,omitempty"`
// The unique identifier for the created terminal.
TerminalId string `json:"terminalId"`
}
Response containing the ID of the created terminal.
func (*CreateTerminalResponse) Validate ¶
func (v *CreateTerminalResponse) Validate() error
type CurrentModeUpdate ¶
type CurrentModeUpdate struct {
// The _meta property is reserved by ACP to allow clients and agents to attach additional
// metadata to their interactions. Implementations MUST NOT make assumptions about values at
// these keys.
//
// See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
Meta map[string]any `json:"_meta,omitempty"`
// The ID of the current mode
CurrentModeId SessionModeId `json:"currentModeId"`
}
The current mode of the session has changed
See protocol docs: [Session Modes](https://agentclientprotocol.com/protocol/session-modes)
type Diff ¶
type Diff struct {
// The _meta property is reserved by ACP to allow clients and agents to attach additional
// metadata to their interactions. Implementations MUST NOT make assumptions about values at
// these keys.
//
// See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
Meta map[string]any `json:"_meta,omitempty"`
// The new content after modification.
NewText string `json:"newText"`
// The original content (None for new files).
OldText *string `json:"oldText,omitempty"`
// The 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/tool-calls#content)
type ElicitationCapabilities ¶
type ElicitationCapabilities struct {
// The _meta property is reserved by ACP to allow clients and agents to attach additional
// metadata to their interactions. Implementations MUST NOT make assumptions about values at
// these keys.
//
// See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
Meta map[string]any `json:"_meta,omitempty"`
// Whether the client supports form-based elicitation.
Form *ElicitationFormCapabilities `json:"form,omitempty"`
// Whether the client supports URL-based elicitation.
Url *ElicitationUrlCapabilities `json:"url,omitempty"`
}
**UNSTABLE**
This capability is not part of the spec yet, and may be removed or changed at any point.
Elicitation capabilities supported by the client.
type ElicitationFormCapabilities ¶
type ElicitationFormCapabilities struct {
// The _meta property is reserved by ACP to allow clients and agents to attach additional
// metadata to their interactions. Implementations MUST NOT make assumptions about values at
// these keys.
//
// See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
Meta map[string]any `json:"_meta,omitempty"`
}
**UNSTABLE**
This capability is not part of the spec yet, and may be removed or changed at any point.
Form-based elicitation capabilities.
type ElicitationUrlCapabilities ¶
type ElicitationUrlCapabilities struct {
// The _meta property is reserved by ACP to allow clients and agents to attach additional
// metadata to their interactions. Implementations MUST NOT make assumptions about values at
// these keys.
//
// See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
Meta map[string]any `json:"_meta,omitempty"`
}
**UNSTABLE**
This capability is not part of the spec yet, and may be removed or changed at any point.
URL-based elicitation capabilities.
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/extensibility)
Meta map[string]any `json:"_meta,omitempty"`
Annotations *Annotations `json:"annotations,omitempty"`
Resource EmbeddedResourceResource `json:"resource"`
}
The contents of a resource, embedded into a prompt or tool call result.
type EmbeddedResourceResource ¶
type EmbeddedResourceResource struct {
TextResourceContents *TextResourceContents `json:"-"`
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 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/extensibility)
Meta map[string]any `json:"_meta,omitempty"`
// The name of the environment variable.
Name string `json:"name"`
// The value to set for the environment variable.
Value string `json:"value"`
}
An environment variable to set when launching an MCP server.
type Error ¶
type Error struct {
// A number indicating the error type that occurred.
// This must be an integer as defined in the JSON-RPC specification.
Code ErrorCode `json:"code"`
// Optional primitive or structured value that contains additional information about the error.
// This may include debugging information or context-specific details.
Data any `json:"data,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)
type ErrorCode ¶
type ErrorCode struct {
// **Parse error**: Invalid JSON was received by the server.
// An error occurred on the server while parsing the JSON text.
ParseError *ErrorCodeParseError `json:"-"`
// **Invalid request**: The JSON sent is not a valid Request object.
InvalidRequest *ErrorCodeInvalidRequest `json:"-"`
// **Method not found**: The method does not exist or is not available.
MethodNotFound *ErrorCodeMethodNotFound `json:"-"`
// **Invalid params**: Invalid method parameter(s).
InvalidParams *ErrorCodeInvalidParams `json:"-"`
// **Internal error**: Internal JSON-RPC error.
// Reserved for implementation-defined server errors.
InternalError *ErrorCodeInternalError `json:"-"`
// **Authentication required**: Authentication is required before this operation can be performed.
AuthenticationRequired *ErrorCodeAuthenticationRequired `json:"-"`
// **Resource not found**: A given resource, such as a file, was not found.
ResourceNotFound *ErrorCodeResourceNotFound `json:"-"`
// Other undefined error code.
Other *ErrorCodeOther `json:"-"`
}
func (ErrorCode) MarshalJSON ¶
func (*ErrorCode) UnmarshalJSON ¶
type ErrorCodeAuthenticationRequired ¶
type ErrorCodeAuthenticationRequired int
**Authentication required**: Authentication is required before this operation can be performed.
type ErrorCodeInternalError ¶
type ErrorCodeInternalError int
**Internal error**: Internal JSON-RPC error. Reserved for implementation-defined server errors.
type ErrorCodeInvalidParams ¶
type ErrorCodeInvalidParams int
**Invalid params**: Invalid method parameter(s).
type ErrorCodeInvalidRequest ¶
type ErrorCodeInvalidRequest int
**Invalid request**: The JSON sent is not a valid Request object.
type ErrorCodeMethodNotFound ¶
type ErrorCodeMethodNotFound int
**Method not found**: The method does not exist or is not available.
type ErrorCodeParseError ¶
type ErrorCodeParseError int
Predefined error codes for common JSON-RPC and ACP-specific errors.
These codes follow the JSON-RPC 2.0 specification for standard errors and use the reserved range (-32000 to -32099) for protocol-specific errors. **Parse error**: Invalid JSON was received by the server. An error occurred on the server while parsing the JSON text.
type ErrorCodeResourceNotFound ¶
type ErrorCodeResourceNotFound int
**Resource not found**: A given resource, such as a file, was not found.
type ExtNotification ¶
type ExtNotification any
Allows the Agent 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/extensibility) ExtNotification is a union or complex schema; represented generically.
type ExtRequest ¶
type ExtRequest any
Allows for sending an arbitrary request that is not part of the ACP spec. Extension methods provide a way to add custom functionality while maintaining protocol compatibility.
See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility) ExtRequest is a union or complex schema; represented generically.
type ExtResponse ¶
type ExtResponse any
Allows for sending an arbitrary response to an ['ExtRequest'] 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/extensibility) ExtResponse is a union or complex schema; represented generically.
type ExtensionMethodHandler ¶
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 ¶
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/extensibility)
Meta map[string]any `json:"_meta,omitempty"`
// Whether the Client supports 'fs/read_text_file' requests.
//
// Defaults to false if unset.
ReadTextFile bool `json:"readTextFile,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/initialization#filesystem)
func (FileSystemCapabilities) MarshalJSON ¶
func (v FileSystemCapabilities) MarshalJSON() ([]byte, error)
func (*FileSystemCapabilities) UnmarshalJSON ¶
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/extensibility)
Meta map[string]any `json:"_meta,omitempty"`
// The name of the HTTP header.
Name string `json:"name"`
// The value to set for the HTTP header.
Value string `json:"value"`
}
An HTTP header to set when making requests to the MCP server.
type 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/extensibility)
Meta map[string]any `json:"_meta,omitempty"`
Annotations *Annotations `json:"annotations,omitempty"`
Data string `json:"data"`
MimeType string `json:"mimeType"`
Uri *string `json:"uri,omitempty"`
}
An image provided to or from an LLM.
type Implementation ¶
type Implementation struct {
// The _meta property is reserved by ACP to allow clients and agents to attach additional
// metadata to their interactions. Implementations MUST NOT make assumptions about values at
// these keys.
//
// See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
Meta map[string]any `json:"_meta,omitempty"`
// Intended for programmatic or logical use, but can be used as a display
// name fallback if title isn’t present.
Name string `json:"name"`
// Intended for UI and end-user contexts — 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 MCP implementation, with an optional title for UI representation.
type InitializeProxyRequest ¶ added in v0.15.0
type InitializeProxyRequest struct {
Meta map[string]any `json:"_meta,omitempty"`
SessionId SessionId `json:"sessionId"`
ProxyId string `json:"proxyId"`
}
func (*InitializeProxyRequest) Validate ¶ added in v0.15.0
func (v *InitializeProxyRequest) Validate() 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/extensibility)
Meta map[string]any `json:"_meta,omitempty"`
// Capabilities supported by the client.
//
// Defaults to {"auth":{"terminal":false},"fs":{"readTextFile":false,"writeTextFile":false},"terminal":false} if unset.
ClientCapabilities ClientCapabilities `json:"clientCapabilities,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/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/extensibility)
Meta map[string]any `json:"_meta,omitempty"`
// Capabilities supported by the agent.
//
// Defaults to {"auth":{},"loadSession":false,"mcpCapabilities":{"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/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 KillTerminalRequest ¶
type KillTerminalRequest struct {
// The _meta property is reserved by ACP to allow clients and agents to attach additional
// metadata to their interactions. Implementations MUST NOT make assumptions about values at
// these keys.
//
// See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
Meta map[string]any `json:"_meta,omitempty"`
// The session ID for this request.
SessionId SessionId `json:"sessionId"`
// The ID of the terminal to kill.
TerminalId string `json:"terminalId"`
}
Request to kill a terminal without releasing it.
func (*KillTerminalRequest) Validate ¶
func (v *KillTerminalRequest) Validate() error
type KillTerminalResponse ¶
type KillTerminalResponse struct {
// The _meta property is reserved by ACP to allow clients and agents to attach additional
// metadata to their interactions. Implementations MUST NOT make assumptions about values at
// these keys.
//
// See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
Meta map[string]any `json:"_meta,omitempty"`
}
Response to 'terminal/kill' method
func (*KillTerminalResponse) Validate ¶
func (v *KillTerminalResponse) Validate() error
type ListSessionsRequest ¶
type ListSessionsRequest struct {
// The _meta property is reserved by ACP to allow clients and agents to attach additional
// metadata to their interactions. Implementations MUST NOT make assumptions about values at
// these keys.
//
// See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
Meta map[string]any `json:"_meta,omitempty"`
// **UNSTABLE**
//
// This capability is not part of the spec yet, and may be removed or changed at any point.
//
// Filter sessions by the exact ordered additional workspace roots. Each path must be absolute.
//
// This filter applies only when the field is present and non-empty. When
// omitted or empty, no additional-root filter is applied.
AdditionalDirectories []string `json:"additionalDirectories,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) Validate ¶
func (v *ListSessionsRequest) Validate() error
type ListSessionsResponse ¶
type ListSessionsResponse struct {
// The _meta property is reserved by ACP to allow clients and agents to attach additional
// metadata to their interactions. Implementations MUST NOT make assumptions about values at
// these keys.
//
// See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
Meta map[string]any `json:"_meta,omitempty"`
// Opaque cursor token. If present, pass this in the next request's cursor parameter
// to fetch the next page. If absent, there are no more results.
NextCursor *string `json:"nextCursor,omitempty"`
// Array of session information objects
Sessions []SessionInfo `json:"sessions"`
}
Response from listing sessions.
func (*ListSessionsResponse) Validate ¶
func (v *ListSessionsResponse) Validate() error
type LoadSessionRequest ¶
type LoadSessionRequest struct {
// The _meta property is reserved by ACP to allow clients and agents to attach additional
// metadata to their interactions. Implementations MUST NOT make assumptions about values at
// these keys.
//
// See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
Meta map[string]any `json:"_meta,omitempty"`
// **UNSTABLE**
//
// This capability is not part of the spec yet, and may be removed or changed at any point.
//
// 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.
AdditionalDirectories []string `json:"additionalDirectories,omitempty"`
// The working directory for this session.
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"`
}
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/session-setup#loading-sessions)
func (*LoadSessionRequest) Validate ¶
func (v *LoadSessionRequest) Validate() error
type LoadSessionResponse ¶
type LoadSessionResponse struct {
// The _meta property is reserved by ACP to allow clients and agents to attach additional
// metadata to their interactions. Implementations MUST NOT make assumptions about values at
// these keys.
//
// See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
Meta map[string]any `json:"_meta,omitempty"`
// Initial session configuration options if supported by the Agent.
ConfigOptions []SessionConfigOption `json:"configOptions,omitempty"`
// **UNSTABLE**
//
// This capability is not part of the spec yet, and may be removed or changed at any point.
//
// Initial model state if supported by the Agent
Models *SessionModelState `json:"models,omitempty"`
// Initial mode state if supported by the Agent
//
// See protocol docs: [Session Modes](https://agentclientprotocol.com/protocol/session-modes)
Modes *SessionModeState `json:"modes,omitempty"`
}
Response from loading an existing session.
func (*LoadSessionResponse) Validate ¶
func (v *LoadSessionResponse) Validate() error
type LogoutCapabilities ¶
type LogoutCapabilities struct {
// The _meta property is reserved by ACP to allow clients and agents to attach additional
// metadata to their interactions. Implementations MUST NOT make assumptions about values at
// these keys.
//
// See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
Meta map[string]any `json:"_meta,omitempty"`
}
**UNSTABLE**
This capability is not part of the spec yet, and may be removed or changed at any point.
Logout capabilities supported by the agent.
By supplying '{}' it means that the agent supports the logout method.
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/extensibility)
Meta map[string]any `json:"_meta,omitempty"`
// Agent supports ['McpServer::Http'].
//
// Defaults to false if unset.
Http bool `json:"http,omitempty"`
// Agent supports ['McpServer::Sse'].
//
// 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 McpConnectRequest ¶ added in v0.15.0
type McpConnectRequest struct {
Meta map[string]any `json:"_meta,omitempty"`
ProxyId string `json:"proxyId"`
Server McpServer `json:"server"`
}
func (*McpConnectRequest) Validate ¶ added in v0.15.0
func (v *McpConnectRequest) Validate() error
type McpConnectResponse ¶ added in v0.15.0
func (*McpConnectResponse) Validate ¶ added in v0.15.0
func (v *McpConnectResponse) Validate() error
type McpDisconnectNotification ¶ added in v0.15.0
type McpDisconnectNotification struct {
Meta map[string]any `json:"_meta,omitempty"`
ProxyId string `json:"proxyId"`
}
func (*McpDisconnectNotification) Validate ¶ added in v0.15.0
func (v *McpDisconnectNotification) Validate() error
type McpOverAcpMessage ¶ added in v0.15.0
type McpOverAcpMessage struct {
Meta map[string]any `json:"_meta,omitempty"`
ProxyId string `json:"proxyId"`
Message json.RawMessage `json:"message"`
}
func (*McpOverAcpMessage) Validate ¶ added in v0.15.0
func (v *McpOverAcpMessage) Validate() 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:"-"`
// Stdio transport configuration
//
// All Agents MUST support this transport.
Stdio *McpServerStdio `json:"-"`
}
func (McpServer) MarshalJSON ¶
func (*McpServer) UnmarshalJSON ¶
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/extensibility)
Meta map[string]any `json:"_meta,omitempty"`
// HTTP headers to set when making requests to the MCP server.
Headers []HttpHeader `json:"headers"`
// Human-readable name identifying this MCP server.
Name string `json:"name"`
// URL to the MCP server.
Url string `json:"url"`
}
HTTP transport configuration for MCP.
type McpServerHttpInline ¶
type McpServerHttpInline struct {
// The _meta property is reserved by ACP to allow clients and agents to attach additional
// metadata to their interactions. Implementations MUST NOT make assumptions about values at
// these keys.
//
// See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
Meta map[string]any `json:"_meta,omitempty"`
// HTTP headers to set when making requests to the MCP server.
Headers []HttpHeader `json:"headers"`
// Human-readable name identifying this MCP server.
Name string `json:"name"`
Type string `json:"type"`
// URL to the MCP server.
Url string `json:"url"`
}
Configuration for connecting to an MCP (Model Context Protocol) server.
MCP servers provide tools and context that the agent can use when processing prompts.
See protocol docs: [MCP Servers](https://agentclientprotocol.com/protocol/session-setup#mcp-servers) HTTP transport configuration
Only available when the Agent capabilities indicate 'mcp_capabilities.http' is 'true'.
type McpServerSse ¶
type McpServerSse struct {
// The _meta property is reserved by ACP to allow clients and agents to attach additional
// metadata to their interactions. Implementations MUST NOT make assumptions about values at
// these keys.
//
// See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
Meta map[string]any `json:"_meta,omitempty"`
// HTTP headers to set when making requests to the MCP server.
Headers []HttpHeader `json:"headers"`
// Human-readable name identifying this MCP server.
Name string `json:"name"`
// URL to the MCP server.
Url string `json:"url"`
}
SSE transport configuration for MCP.
type McpServerSseInline ¶
type McpServerSseInline struct {
// The _meta property is reserved by ACP to allow clients and agents to attach additional
// metadata to their interactions. Implementations MUST NOT make assumptions about values at
// these keys.
//
// See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
Meta map[string]any `json:"_meta,omitempty"`
// HTTP headers to set when making requests to the MCP server.
Headers []HttpHeader `json:"headers"`
// Human-readable name identifying this MCP server.
Name string `json:"name"`
Type string `json:"type"`
// URL to the MCP server.
Url string `json:"url"`
}
SSE transport configuration
Only available when the Agent capabilities indicate 'mcp_capabilities.sse' is 'true'.
type McpServerStdio ¶
type McpServerStdio struct {
// The _meta property is reserved by ACP to allow clients and agents to attach additional
// metadata to their interactions. Implementations MUST NOT make assumptions about values at
// these keys.
//
// See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
Meta map[string]any `json:"_meta,omitempty"`
// Command-line arguments to pass to the MCP server.
Args []string `json:"args"`
// Path to the MCP server executable.
Command string `json:"command"`
// Environment variables to set when launching the MCP server.
Env []EnvVariable `json:"env"`
// Human-readable name identifying this MCP server.
Name string `json:"name"`
}
Stdio transport configuration for MCP.
type MethodHandler ¶
type MethodHandler func(ctx context.Context, method string, params json.RawMessage) (any, *RequestError)
type ModelId ¶
type ModelId string
**UNSTABLE**
This capability is not part of the spec yet, and may be removed or changed at any point.
A unique identifier for a model.
type ModelInfo ¶
type ModelInfo struct {
// The _meta property is reserved by ACP to allow clients and agents to attach additional
// metadata to their interactions. Implementations MUST NOT make assumptions about values at
// these keys.
//
// See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
Meta map[string]any `json:"_meta,omitempty"`
// Optional description of the model.
Description *string `json:"description,omitempty"`
// Unique identifier for the model.
ModelId ModelId `json:"modelId"`
// Human-readable name of the model.
Name string `json:"name"`
}
**UNSTABLE**
This capability is not part of the spec yet, and may be removed or changed at any point.
Information about a selectable model.
type NesCapabilities ¶
type NesCapabilities struct {
// The _meta property is reserved by ACP to allow clients and agents to attach additional
// metadata to their interactions. Implementations MUST NOT make assumptions about values at
// these keys.
//
// See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
Meta map[string]any `json:"_meta,omitempty"`
// Context the agent wants attached to each suggestion request.
Context *NesContextCapabilities `json:"context,omitempty"`
// Events the agent wants to receive.
Events *NesEventCapabilities `json:"events,omitempty"`
}
NES capabilities advertised by the agent during initialization.
type NesContextCapabilities ¶
type NesContextCapabilities struct {
// The _meta property is reserved by ACP to allow clients and agents to attach additional
// metadata to their interactions. Implementations MUST NOT make assumptions about values at
// these keys.
//
// See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
Meta map[string]any `json:"_meta,omitempty"`
// Whether the agent wants diagnostics context.
Diagnostics *NesDiagnosticsCapabilities `json:"diagnostics,omitempty"`
// Whether the agent wants edit history context.
EditHistory *NesEditHistoryCapabilities `json:"editHistory,omitempty"`
// Whether the agent wants open files context.
OpenFiles *NesOpenFilesCapabilities `json:"openFiles,omitempty"`
// Whether the agent wants recent files context.
RecentFiles *NesRecentFilesCapabilities `json:"recentFiles,omitempty"`
// Whether the agent wants related snippets context.
RelatedSnippets *NesRelatedSnippetsCapabilities `json:"relatedSnippets,omitempty"`
// Whether the agent wants user actions context.
UserActions *NesUserActionsCapabilities `json:"userActions,omitempty"`
}
Context capabilities the agent wants attached to each suggestion request.
type NesDiagnosticsCapabilities ¶
type NesDiagnosticsCapabilities struct {
// The _meta property is reserved by ACP to allow clients and agents to attach additional
// metadata to their interactions. Implementations MUST NOT make assumptions about values at
// these keys.
//
// See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
Meta map[string]any `json:"_meta,omitempty"`
}
Capabilities for diagnostics context.
type NesDocumentDidChangeCapabilities ¶
type NesDocumentDidChangeCapabilities struct {
// The _meta property is reserved by ACP to allow clients and agents to attach additional
// metadata to their interactions. Implementations MUST NOT make assumptions about values at
// these keys.
//
// See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
Meta map[string]any `json:"_meta,omitempty"`
// The sync kind the agent wants: '"full"' or '"incremental"'.
SyncKind TextDocumentSyncKind `json:"syncKind"`
}
Capabilities for 'document/didChange' events.
type NesDocumentDidCloseCapabilities ¶
type NesDocumentDidCloseCapabilities struct {
// The _meta property is reserved by ACP to allow clients and agents to attach additional
// metadata to their interactions. Implementations MUST NOT make assumptions about values at
// these keys.
//
// See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
Meta map[string]any `json:"_meta,omitempty"`
}
Marker for 'document/didClose' capability support.
type NesDocumentDidFocusCapabilities ¶
type NesDocumentDidFocusCapabilities struct {
// The _meta property is reserved by ACP to allow clients and agents to attach additional
// metadata to their interactions. Implementations MUST NOT make assumptions about values at
// these keys.
//
// See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
Meta map[string]any `json:"_meta,omitempty"`
}
Marker for 'document/didFocus' capability support.
type NesDocumentDidOpenCapabilities ¶
type NesDocumentDidOpenCapabilities struct {
// The _meta property is reserved by ACP to allow clients and agents to attach additional
// metadata to their interactions. Implementations MUST NOT make assumptions about values at
// these keys.
//
// See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
Meta map[string]any `json:"_meta,omitempty"`
}
Marker for 'document/didOpen' capability support.
type NesDocumentDidSaveCapabilities ¶
type NesDocumentDidSaveCapabilities struct {
// The _meta property is reserved by ACP to allow clients and agents to attach additional
// metadata to their interactions. Implementations MUST NOT make assumptions about values at
// these keys.
//
// See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
Meta map[string]any `json:"_meta,omitempty"`
}
Marker for 'document/didSave' capability support.
type NesDocumentEventCapabilities ¶
type NesDocumentEventCapabilities struct {
// The _meta property is reserved by ACP to allow clients and agents to attach additional
// metadata to their interactions. Implementations MUST NOT make assumptions about values at
// these keys.
//
// See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
Meta map[string]any `json:"_meta,omitempty"`
// Whether the agent wants 'document/didChange' events, and the sync kind.
DidChange *NesDocumentDidChangeCapabilities `json:"didChange,omitempty"`
// Whether the agent wants 'document/didClose' events.
DidClose *NesDocumentDidCloseCapabilities `json:"didClose,omitempty"`
// Whether the agent wants 'document/didFocus' events.
DidFocus *NesDocumentDidFocusCapabilities `json:"didFocus,omitempty"`
// Whether the agent wants 'document/didOpen' events.
DidOpen *NesDocumentDidOpenCapabilities `json:"didOpen,omitempty"`
// Whether the agent wants 'document/didSave' events.
DidSave *NesDocumentDidSaveCapabilities `json:"didSave,omitempty"`
}
Document event capabilities the agent wants to receive.
type NesEditHistoryCapabilities ¶
type NesEditHistoryCapabilities struct {
// The _meta property is reserved by ACP to allow clients and agents to attach additional
// metadata to their interactions. Implementations MUST NOT make assumptions about values at
// these keys.
//
// See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
Meta map[string]any `json:"_meta,omitempty"`
// Maximum number of edit history entries the agent can use.
MaxCount *int `json:"maxCount,omitempty"`
}
Capabilities for edit history context.
type NesEventCapabilities ¶
type NesEventCapabilities struct {
// The _meta property is reserved by ACP to allow clients and agents to attach additional
// metadata to their interactions. Implementations MUST NOT make assumptions about values at
// these keys.
//
// See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
Meta map[string]any `json:"_meta,omitempty"`
// Document event capabilities.
Document *NesDocumentEventCapabilities `json:"document,omitempty"`
}
Event capabilities the agent can consume.
type NesJumpCapabilities ¶
type NesJumpCapabilities struct {
// The _meta property is reserved by ACP to allow clients and agents to attach additional
// metadata to their interactions. Implementations MUST NOT make assumptions about values at
// these keys.
//
// See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
Meta map[string]any `json:"_meta,omitempty"`
}
Marker for jump suggestion support.
type NesOpenFilesCapabilities ¶
type NesOpenFilesCapabilities struct {
// The _meta property is reserved by ACP to allow clients and agents to attach additional
// metadata to their interactions. Implementations MUST NOT make assumptions about values at
// these keys.
//
// See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
Meta map[string]any `json:"_meta,omitempty"`
}
Capabilities for open files context.
type NesRecentFilesCapabilities ¶
type NesRecentFilesCapabilities struct {
// The _meta property is reserved by ACP to allow clients and agents to attach additional
// metadata to their interactions. Implementations MUST NOT make assumptions about values at
// these keys.
//
// See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
Meta map[string]any `json:"_meta,omitempty"`
// Maximum number of recent files the agent can use.
MaxCount *int `json:"maxCount,omitempty"`
}
Capabilities for recent files context.
type NesRelatedSnippetsCapabilities ¶
type NesRelatedSnippetsCapabilities struct {
// The _meta property is reserved by ACP to allow clients and agents to attach additional
// metadata to their interactions. Implementations MUST NOT make assumptions about values at
// these keys.
//
// See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
Meta map[string]any `json:"_meta,omitempty"`
}
Capabilities for related snippets context.
type NesRenameCapabilities ¶
type NesRenameCapabilities struct {
// The _meta property is reserved by ACP to allow clients and agents to attach additional
// metadata to their interactions. Implementations MUST NOT make assumptions about values at
// these keys.
//
// See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
Meta map[string]any `json:"_meta,omitempty"`
}
Marker for rename suggestion support.
type NesSearchAndReplaceCapabilities ¶
type NesSearchAndReplaceCapabilities struct {
// The _meta property is reserved by ACP to allow clients and agents to attach additional
// metadata to their interactions. Implementations MUST NOT make assumptions about values at
// these keys.
//
// See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
Meta map[string]any `json:"_meta,omitempty"`
}
Marker for search and replace suggestion support.
type NesUserActionsCapabilities ¶
type NesUserActionsCapabilities struct {
// The _meta property is reserved by ACP to allow clients and agents to attach additional
// metadata to their interactions. Implementations MUST NOT make assumptions about values at
// these keys.
//
// See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
Meta map[string]any `json:"_meta,omitempty"`
// Maximum number of user actions the agent can use.
MaxCount *int `json:"maxCount,omitempty"`
}
Capabilities for user actions context.
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/extensibility)
Meta map[string]any `json:"_meta,omitempty"`
// **UNSTABLE**
//
// This capability is not part of the spec yet, and may be removed or changed at any point.
//
// 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"`
// 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"`
}
Request parameters for creating a new session.
See protocol docs: [Creating a Session](https://agentclientprotocol.com/protocol/session-setup#creating-a-session)
func (*NewSessionRequest) Validate ¶
func (v *NewSessionRequest) Validate() error
type NewSessionResponse ¶
type NewSessionResponse struct {
// The _meta property is reserved by ACP to allow clients and agents to attach additional
// metadata to their interactions. Implementations MUST NOT make assumptions about values at
// these keys.
//
// See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
Meta map[string]any `json:"_meta,omitempty"`
// Initial session configuration options if supported by the Agent.
ConfigOptions []SessionConfigOption `json:"configOptions,omitempty"`
// **UNSTABLE**
//
// This capability is not part of the spec yet, and may be removed or changed at any point.
//
// Initial model state if supported by the Agent
Models *SessionModelState `json:"models,omitempty"`
// Initial mode state if supported by the Agent
//
// See protocol docs: [Session Modes](https://agentclientprotocol.com/protocol/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/session-setup#creating-a-session)
func (*NewSessionResponse) Validate ¶
func (v *NewSessionResponse) Validate() error
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/extensibility)
Meta map[string]any `json:"_meta,omitempty"`
// Hint about the nature of this permission option.
Kind PermissionOptionKind `json:"kind"`
// Human-readable label to display to the user.
Name string `json:"name"`
// Unique identifier for this permission option.
OptionId PermissionOptionId `json:"optionId"`
}
An option presented to the user when requesting permission.
type PermissionOptionKind ¶
type PermissionOptionKind string
The type of permission option being presented to the user.
Helps clients choose appropriate icons and UI treatment.
const ( PermissionOptionKindAllowOnce PermissionOptionKind = "allow_once" PermissionOptionKindAllowAlways PermissionOptionKind = "allow_always" PermissionOptionKindRejectOnce PermissionOptionKind = "reject_once" PermissionOptionKindRejectAlways PermissionOptionKind = "reject_always" )
type Plan ¶
type Plan struct {
// The _meta property is reserved by ACP to allow clients and agents to attach additional
// metadata to their interactions. Implementations MUST NOT make assumptions about values at
// these keys.
//
// See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
Meta map[string]any `json:"_meta,omitempty"`
// The list of tasks to be accomplished.
//
// When updating a plan, the agent must send a complete list of all entries
// with their current status. The client replaces the entire plan with each update.
Entries []PlanEntry `json:"entries"`
}
An execution plan for accomplishing complex tasks.
Plans consist of multiple entries representing individual tasks or goals. Agents report plans to clients to provide visibility into their execution strategy. Plans can evolve during execution as the agent discovers new requirements or completes tasks.
See protocol docs: [Agent Plan](https://agentclientprotocol.com/protocol/agent-plan)
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/extensibility)
Meta map[string]any `json:"_meta,omitempty"`
// Human-readable description of what this task aims to accomplish.
Content string `json:"content"`
// The relative importance of this task.
// Used to indicate which tasks are most critical to the overall goal.
Priority PlanEntryPriority `json:"priority"`
// Current execution status of this task.
Status PlanEntryStatus `json:"status"`
}
A single entry in the execution plan.
Represents a task or goal that the assistant intends to accomplish as part of fulfilling the user's request. See protocol docs: [Plan Entries](https://agentclientprotocol.com/protocol/agent-plan#plan-entries)
func NewPlanEntry ¶ added in v0.14.0
func NewPlanEntry(content string, status PlanEntryStatus, priority PlanEntryPriority) PlanEntry
NewPlanEntry constructs a PlanEntry with the given content, status, and priority.
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/agent-plan#plan-entries)
const ( PlanEntryPriorityHigh PlanEntryPriority = "high" PlanEntryPriorityMedium PlanEntryPriority = "medium" PlanEntryPriorityLow PlanEntryPriority = "low" )
func ParsePlanEntryPriority ¶ added in v0.14.0
func ParsePlanEntryPriority(s string) PlanEntryPriority
ParsePlanEntryPriority maps a raw string to a PlanEntryPriority. Recognised values are "high" and "low" (case-insensitive). Any other value (including the empty string) returns PlanEntryPriorityMedium.
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/agent-plan#plan-entries)
const ( PlanEntryStatusPending PlanEntryStatus = "pending" PlanEntryStatusInProgress PlanEntryStatus = "in_progress" PlanEntryStatusCompleted PlanEntryStatus = "completed" )
func ParsePlanEntryStatus ¶ added in v0.14.0
func ParsePlanEntryStatus(s string) PlanEntryStatus
ParsePlanEntryStatus maps a raw string to a PlanEntryStatus. Recognised values are "in_progress" and "completed" (case-insensitive). Any other value (including the empty string) returns PlanEntryStatusPending.
type PositionEncodingKind ¶
type PositionEncodingKind string
The encoding used for character offsets in positions.
Follows the same conventions as LSP 3.17. The default is UTF-16.
const ( PositionEncodingKindUtf16 PositionEncodingKind = "utf-16" PositionEncodingKindUtf32 PositionEncodingKind = "utf-32" PositionEncodingKindUtf8 PositionEncodingKind = "utf-8" )
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/extensibility)
Meta map[string]any `json:"_meta,omitempty"`
// Agent supports ['ContentBlock::Audio'].
//
// 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 ['ContentBlock::Resource']
// 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 ['ContentBlock::Image'].
//
// 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 ['ContentBlock::Text'] and ['ContentBlock::ResourceLink'] 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/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/extensibility)
Meta map[string]any `json:"_meta,omitempty"`
// **UNSTABLE**
//
// This capability is not part of the spec yet, and may be removed or changed at any point.
//
// A client-generated unique identifier for this user message.
//
// If provided, the Agent SHOULD echo this value as 'userMessageId' in the
// ['PromptResponse'] to confirm it was recorded.
// Both clients and agents MUST use UUID format for message IDs.
MessageId *string `json:"messageId,omitempty"`
// The blocks of content that compose the user's message.
//
// As a baseline, the Agent MUST support ['ContentBlock::Text'] and ['ContentBlock::ResourceLink'],
// 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
// ['ContentBlock::Resource'] or ['ContentBlock::ResourceLink'].
//
// When available, ['ContentBlock::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/prompt-turn#1-user-message)
func (*PromptRequest) Validate ¶
func (v *PromptRequest) Validate() error
type PromptResponse ¶
type PromptResponse struct {
// The _meta property is reserved by ACP to allow clients and agents to attach additional
// metadata to their interactions. Implementations MUST NOT make assumptions about values at
// these keys.
//
// See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
Meta map[string]any `json:"_meta,omitempty"`
// Indicates why the agent stopped processing the turn.
StopReason StopReason `json:"stopReason"`
// **UNSTABLE**
//
// This capability is not part of the spec yet, and may be removed or changed at any point.
//
// Token usage for this turn (optional).
Usage *Usage `json:"usage,omitempty"`
// **UNSTABLE**
//
// This capability is not part of the spec yet, and may be removed or changed at any point.
//
// The acknowledged user message ID.
//
// If the client provided a 'messageId' in the ['PromptRequest'], the agent echoes it here
// to confirm it was recorded. If the client did not provide one, the agent MAY assign one
// and return it here. Absence of this field indicates the agent did not record a message ID.
UserMessageId *string `json:"userMessageId,omitempty"`
}
Response from processing a user prompt.
See protocol docs: [Check for Completion](https://agentclientprotocol.com/protocol/prompt-turn#4-check-for-completion)
func (*PromptResponse) Validate ¶
func (v *PromptResponse) Validate() error
type ProtocolVersion ¶
type ProtocolVersion int
Protocol version identifier.
This version is only bumped for breaking changes. Non-breaking changes should be introduced via capabilities.
type ProvidersCapabilities ¶
type ProvidersCapabilities struct {
// The _meta property is reserved by ACP to allow clients and agents to attach additional
// metadata to their interactions. Implementations MUST NOT make assumptions about values at
// these keys.
//
// See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
Meta map[string]any `json:"_meta,omitempty"`
}
**UNSTABLE**
This capability is not part of the spec yet, and may be removed or changed at any point.
Provider configuration capabilities supported by the agent.
By supplying '{}' it means that the agent supports provider configuration methods.
type ReadTextFileRequest ¶
type ReadTextFileRequest struct {
// The _meta property is reserved by ACP to allow clients and agents to attach additional
// metadata to their interactions. Implementations MUST NOT make assumptions about values at
// these keys.
//
// See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
Meta map[string]any `json:"_meta,omitempty"`
// Maximum number of lines to read.
Limit *int `json:"limit,omitempty"`
// Line number to start reading from (1-based).
Line *int `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) 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/extensibility)
Meta map[string]any `json:"_meta,omitempty"`
Content string `json:"content"`
}
Response containing the contents of a text file.
func (*ReadTextFileResponse) Validate ¶
func (v *ReadTextFileResponse) Validate() error
type ReleaseTerminalRequest ¶
type ReleaseTerminalRequest struct {
// The _meta property is reserved by ACP to allow clients and agents to attach additional
// metadata to their interactions. Implementations MUST NOT make assumptions about values at
// these keys.
//
// See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
Meta map[string]any `json:"_meta,omitempty"`
// The session ID for this request.
SessionId SessionId `json:"sessionId"`
// The ID of the terminal to release.
TerminalId string `json:"terminalId"`
}
Request to release a terminal and free its resources.
func (*ReleaseTerminalRequest) Validate ¶
func (v *ReleaseTerminalRequest) Validate() error
type ReleaseTerminalResponse ¶
type ReleaseTerminalResponse struct {
// The _meta property is reserved by ACP to allow clients and agents to attach additional
// metadata to their interactions. Implementations MUST NOT make assumptions about values at
// these keys.
//
// See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
Meta map[string]any `json:"_meta,omitempty"`
}
Response to terminal/release method
func (*ReleaseTerminalResponse) Validate ¶
func (v *ReleaseTerminalResponse) Validate() error
type RequestError ¶
type RequestError struct {
Code int `json:"code"`
Message string `json:"message"`
Data any `json:"data,omitempty"`
}
RequestError represents a JSON-RPC error response.
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 ¶
func NewRequestCancelled(data any) *RequestError
func (*RequestError) Error ¶
func (e *RequestError) Error() string
type RequestId ¶
type RequestId struct {
Null *RequestIdNull `json:"-"`
Number *RequestIdNumber `json:"-"`
Str *RequestIdStr `json:"-"`
}
func (RequestId) MarshalJSON ¶
func (*RequestId) UnmarshalJSON ¶
type RequestIdNull ¶
type RequestIdNull struct{}
JSON RPC Request Id
An identifier established by the Client that MUST contain a String, Number, or NULL value if included. If it is not included it is assumed to be a notification. The value SHOULD normally not be Null [1] and Numbers SHOULD NOT contain fractional parts [2]
The Server MUST reply with the same value in the Response object if included. This member is used to correlate the context between the two objects.
[1] The use of Null as a value for the id member in a Request object is discouraged, because this specification uses a value of Null for Responses with an unknown id. Also, because JSON-RPC 1.0 uses an id value of Null for Notifications this could cause confusion in handling.
[2] Fractional parts may be problematic, since many decimal fractions cannot be represented exactly as binary fractions.
type RequestIdNumber ¶
type RequestIdNumber int
type RequestIdStr ¶
type RequestIdStr string
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/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/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/extensibility)
Meta map[string]any `json:"_meta,omitempty"`
// The ID of the option the user selected.
OptionId PermissionOptionId `json:"optionId"`
Outcome string `json:"outcome"`
}
The user selected one of the provided options.
type RequestPermissionRequest ¶
type RequestPermissionRequest struct {
// The _meta property is reserved by ACP to allow clients and agents to attach additional
// metadata to their interactions. Implementations MUST NOT make assumptions about values at
// these keys.
//
// See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
Meta map[string]any `json:"_meta,omitempty"`
// Available permission options for the user to choose from.
Options []PermissionOption `json:"options"`
// The session ID for this request.
SessionId SessionId `json:"sessionId"`
// Details about the tool call requiring permission.
ToolCall ToolCallUpdate `json:"toolCall"`
}
Request for user permission to execute a tool call.
Sent when the agent needs authorization before performing a sensitive operation.
See protocol docs: [Requesting Permission](https://agentclientprotocol.com/protocol/tool-calls#requesting-permission)
func (*RequestPermissionRequest) Validate ¶
func (v *RequestPermissionRequest) Validate() error
type RequestPermissionResponse ¶
type RequestPermissionResponse struct {
// The _meta property is reserved by ACP to allow clients and agents to attach additional
// metadata to their interactions. Implementations MUST NOT make assumptions about values at
// these keys.
//
// See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
Meta map[string]any `json:"_meta,omitempty"`
// The user's decision on the permission request.
Outcome RequestPermissionOutcome `json:"outcome"`
}
Response to a permission request.
func (*RequestPermissionResponse) Validate ¶
func (v *RequestPermissionResponse) Validate() error
type 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/extensibility)
Meta map[string]any `json:"_meta,omitempty"`
Annotations *Annotations `json:"annotations,omitempty"`
Description *string `json:"description,omitempty"`
MimeType *string `json:"mimeType,omitempty"`
Name string `json:"name"`
Size *int `json:"size,omitempty"`
Title *string `json:"title,omitempty"`
Uri string `json:"uri"`
}
A resource that the server is capable of reading, included in a prompt or tool call result.
type ResumeSessionRequest ¶ added in v0.15.0
type ResumeSessionRequest = UnstableResumeSessionRequest
**UNSTABLE**
This capability is not part of the spec yet, and may be removed or changed at any point.
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.
type ResumeSessionResponse ¶ added in v0.15.0
type ResumeSessionResponse = UnstableResumeSessionResponse
Response from resuming an existing session.
type SelectedPermissionOutcome ¶
type SelectedPermissionOutcome struct {
// The _meta property is reserved by ACP to allow clients and agents to attach additional
// metadata to their interactions. Implementations MUST NOT make assumptions about values at
// these keys.
//
// See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
Meta map[string]any `json:"_meta,omitempty"`
// The ID of the option the user selected.
OptionId PermissionOptionId `json:"optionId"`
}
The user selected one of the provided options.
type SessionAdditionalDirectoriesCapabilities ¶
type SessionAdditionalDirectoriesCapabilities struct {
// The _meta property is reserved by ACP to allow clients and agents to attach additional
// metadata to their interactions. Implementations MUST NOT make assumptions about values at
// these keys.
//
// See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
Meta map[string]any `json:"_meta,omitempty"`
}
**UNSTABLE**
This capability is not part of the spec yet, and may be removed or changed at any point.
Capabilities for additional session directories support.
By supplying '{}' it means that the agent supports the 'additionalDirectories' field on supported session lifecycle requests and 'session/list'.
type SessionAvailableCommandsUpdate ¶
type SessionAvailableCommandsUpdate struct {
// The _meta property is reserved by ACP to allow clients and agents to attach additional
// metadata to their interactions. Implementations MUST NOT make assumptions about values at
// these keys.
//
// See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
Meta map[string]any `json:"_meta,omitempty"`
// Commands the agent can execute
AvailableCommands []AvailableCommand `json:"availableCommands"`
SessionUpdate string `json:"sessionUpdate"`
}
Available commands are ready or have changed
type SessionCapabilities ¶
type SessionCapabilities struct {
// The _meta property is reserved by ACP to allow clients and agents to attach additional
// metadata to their interactions. Implementations MUST NOT make assumptions about values at
// these keys.
//
// See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
Meta map[string]any `json:"_meta,omitempty"`
// **UNSTABLE**
//
// This capability is not part of the spec yet, and may be removed or changed at any point.
//
// Whether the agent supports 'additionalDirectories' on supported session lifecycle requests and 'session/list'.
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/close'.
Close *SessionCloseCapabilities `json:"close,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'.
Fork *SessionForkCapabilities `json:"fork,omitempty"`
// Whether the agent supports 'session/list'.
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/resume'.
Resume *SessionResumeCapabilities `json:"resume,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 'load_session' capability. This will be unified in future versions of the protocol.
See protocol docs: [Session Capabilities](https://agentclientprotocol.com/protocol/initialization#session-capabilities)
type SessionCloseCapabilities ¶
type SessionCloseCapabilities struct {
// The _meta property is reserved by ACP to allow clients and agents to attach additional
// metadata to their interactions. Implementations MUST NOT make assumptions about values at
// these keys.
//
// See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
Meta map[string]any `json:"_meta,omitempty"`
}
**UNSTABLE**
This capability is not part of the spec yet, and may be removed or changed at any point.
Capabilities for the 'session/close' method.
By supplying '{}' it means that the agent supports closing of sessions.
type SessionConfigBoolean ¶
type SessionConfigBoolean struct {
// The current value of the boolean option.
CurrentValue bool `json:"currentValue"`
}
**UNSTABLE**
This capability is not part of the spec yet, and may be removed or changed at any point.
A boolean on/off toggle session configuration option payload.
type SessionConfigGroupId ¶
type SessionConfigGroupId string
Unique identifier for a session configuration option value group.
type SessionConfigId ¶
type SessionConfigId string
Unique identifier for a session configuration option.
type SessionConfigOption ¶
type SessionConfigOption struct {
// Single-value selector (dropdown).
Select *SessionConfigOptionSelect `json:"-"`
// **UNSTABLE**
//
// This capability is not part of the spec yet, and may be removed or changed at any point.
//
// Boolean on/off toggle.
Boolean *SessionConfigOptionBoolean `json:"-"`
}
func NewSessionConfigOptionBoolean ¶
func NewSessionConfigOptionBoolean(currentValue bool) SessionConfigOption
NewSessionConfigOptionBoolean constructs a SessionConfigOption using the 'boolean' variant.
func NewSessionConfigOptionSelect ¶
func NewSessionConfigOptionSelect(currentValue SessionConfigValueId, options SessionConfigSelectOptions) SessionConfigOption
NewSessionConfigOptionSelect constructs a SessionConfigOption using the 'select' variant.
func (SessionConfigOption) MarshalJSON ¶
func (u SessionConfigOption) MarshalJSON() ([]byte, error)
func (*SessionConfigOption) UnmarshalJSON ¶
func (u *SessionConfigOption) UnmarshalJSON(b []byte) error
func (*SessionConfigOption) Validate ¶
func (u *SessionConfigOption) Validate() error
type SessionConfigOptionBoolean ¶
type SessionConfigOptionBoolean struct {
// The _meta property is reserved by ACP to allow clients and agents to attach additional
// metadata to their interactions. Implementations MUST NOT make assumptions about values at
// these keys.
//
// See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
Meta map[string]any `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"`
}
**UNSTABLE**
This capability is not part of the spec yet, and may be removed or changed at any point.
Boolean on/off toggle.
type SessionConfigOptionCategory ¶
type SessionConfigOptionCategory struct {
// Unknown / uncategorized selector.
Other *SessionConfigOptionCategoryOther `json:"-"`
}
func (SessionConfigOptionCategory) MarshalJSON ¶
func (u SessionConfigOptionCategory) MarshalJSON() ([]byte, error)
func (*SessionConfigOptionCategory) UnmarshalJSON ¶
func (u *SessionConfigOptionCategory) UnmarshalJSON(b []byte) error
type SessionConfigOptionCategoryOther ¶
type SessionConfigOptionCategoryOther 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. Unknown / uncategorized selector.
type SessionConfigOptionSelect ¶
type SessionConfigOptionSelect struct {
// The _meta property is reserved by ACP to allow clients and agents to attach additional
// metadata to their interactions. Implementations MUST NOT make assumptions about values at
// these keys.
//
// See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
Meta map[string]any `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).
type SessionConfigOptionUpdate ¶
type SessionConfigOptionUpdate struct {
// The _meta property is reserved by ACP to allow clients and agents to attach additional
// metadata to their interactions. Implementations MUST NOT make assumptions about values at
// these keys.
//
// See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
Meta map[string]any `json:"_meta,omitempty"`
// The full set of configuration options and their current values.
ConfigOptions []SessionConfigOption `json:"configOptions"`
SessionUpdate string `json:"sessionUpdate"`
}
Session configuration options have been updated.
type SessionConfigSelect ¶
type SessionConfigSelect struct {
// The currently selected value.
CurrentValue SessionConfigValueId `json:"currentValue"`
// The set of selectable options.
Options SessionConfigSelectOptions `json:"options"`
}
A single-value selector (dropdown) session configuration option payload.
type SessionConfigSelectGroup ¶
type SessionConfigSelectGroup struct {
// The _meta property is reserved by ACP to allow clients and agents to attach additional
// metadata to their interactions. Implementations MUST NOT make assumptions about values at
// these keys.
//
// See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
Meta map[string]any `json:"_meta,omitempty"`
// Unique identifier for this group.
Group SessionConfigGroupId `json:"group"`
// Human-readable label for this group.
Name string `json:"name"`
// The set of option values in this group.
Options []SessionConfigSelectOption `json:"options"`
}
A group of possible values for a session configuration option.
type SessionConfigSelectOption ¶
type SessionConfigSelectOption struct {
// The _meta property is reserved by ACP to allow clients and agents to attach additional
// metadata to their interactions. Implementations MUST NOT make assumptions about values at
// these keys.
//
// See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
Meta map[string]any `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.
type SessionConfigSelectOptions ¶
type SessionConfigSelectOptions struct {
// A flat list of options with no grouping.
Ungrouped *SessionConfigSelectOptionsUngrouped `json:"-"`
// A list of options grouped under headers.
Grouped *SessionConfigSelectOptionsGrouped `json:"-"`
}
func (SessionConfigSelectOptions) MarshalJSON ¶
func (u SessionConfigSelectOptions) MarshalJSON() ([]byte, error)
func (*SessionConfigSelectOptions) UnmarshalJSON ¶
func (u *SessionConfigSelectOptions) UnmarshalJSON(b []byte) error
type SessionConfigSelectOptionsGrouped ¶
type SessionConfigSelectOptionsGrouped []SessionConfigSelectGroup
A list of options grouped under headers.
type SessionConfigSelectOptionsUngrouped ¶
type SessionConfigSelectOptionsUngrouped []SessionConfigSelectOption
Possible values for a session configuration option. A flat list of options with no grouping.
type SessionConfigValueId ¶
type SessionConfigValueId string
Unique identifier for a session configuration option value.
type SessionCurrentModeUpdate ¶
type SessionCurrentModeUpdate struct {
// The _meta property is reserved by ACP to allow clients and agents to attach additional
// metadata to their interactions. Implementations MUST NOT make assumptions about values at
// these keys.
//
// See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
Meta map[string]any `json:"_meta,omitempty"`
// The ID of the current mode
CurrentModeId SessionModeId `json:"currentModeId"`
SessionUpdate string `json:"sessionUpdate"`
}
The current mode of the session has changed
See protocol docs: [Session Modes](https://agentclientprotocol.com/protocol/session-modes)
type SessionForkCapabilities ¶
type SessionForkCapabilities struct {
// The _meta property is reserved by ACP to allow clients and agents to attach additional
// metadata to their interactions. Implementations MUST NOT make assumptions about values at
// these keys.
//
// See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
Meta map[string]any `json:"_meta,omitempty"`
}
**UNSTABLE**
This capability is not part of the spec yet, and may be removed or changed at any point.
Capabilities for the 'session/fork' method.
By supplying '{}' it means that the agent supports forking of sessions.
type SessionId ¶
type SessionId string
A unique identifier for a conversation session between a client and agent.
Sessions maintain their own context, conversation history, and state, allowing multiple independent interactions with the same agent.
See protocol docs: [Session ID](https://agentclientprotocol.com/protocol/session-setup#session-id)
type SessionInfo ¶
type SessionInfo struct {
// The _meta property is reserved by ACP to allow clients and agents to attach additional
// metadata to their interactions. Implementations MUST NOT make assumptions about values at
// these keys.
//
// See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
Meta map[string]any `json:"_meta,omitempty"`
// **UNSTABLE**
//
// This capability is not part of the spec yet, and may be removed or changed at any point.
//
// Authoritative ordered additional workspace roots for this session. Each path must be absolute.
//
// When omitted or empty, there are no additional roots for the session.
AdditionalDirectories []string `json:"additionalDirectories,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
type SessionInfoUpdate ¶
type SessionInfoUpdate struct {
// The _meta property is reserved by ACP to allow clients and agents to attach additional
// metadata to their interactions. Implementations MUST NOT make assumptions about values at
// these keys.
//
// See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
Meta map[string]any `json:"_meta,omitempty"`
// Human-readable title for the session. Set to null to clear.
Title *string `json:"title,omitempty"`
// ISO 8601 timestamp of last activity. Set to null to clear.
UpdatedAt *string `json:"updatedAt,omitempty"`
}
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. This allows clients to display dynamic session names and track session state changes.
type SessionListCapabilities ¶
type SessionListCapabilities struct {
// The _meta property is reserved by ACP to allow clients and agents to attach additional
// metadata to their interactions. Implementations MUST NOT make assumptions about values at
// these keys.
//
// See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
Meta map[string]any `json:"_meta,omitempty"`
}
Capabilities for the 'session/list' method.
By supplying '{}' it means that the agent supports listing of sessions.
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/extensibility)
Meta map[string]any `json:"_meta,omitempty"`
Description *string `json:"description,omitempty"`
Id SessionModeId `json:"id"`
Name string `json:"name"`
}
A mode the agent can operate in.
See protocol docs: [Session Modes](https://agentclientprotocol.com/protocol/session-modes)
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/extensibility)
Meta map[string]any `json:"_meta,omitempty"`
// The set of modes that the Agent can operate in
AvailableModes []SessionMode `json:"availableModes"`
// The current mode the Agent is in.
CurrentModeId SessionModeId `json:"currentModeId"`
}
The set of modes and the one currently active.
type SessionModelState ¶
type SessionModelState struct {
// The _meta property is reserved by ACP to allow clients and agents to attach additional
// metadata to their interactions. Implementations MUST NOT make assumptions about values at
// these keys.
//
// See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
Meta map[string]any `json:"_meta,omitempty"`
// The set of models that the Agent can use
AvailableModels []ModelInfo `json:"availableModels"`
// The current model the Agent is in.
CurrentModelId ModelId `json:"currentModelId"`
}
**UNSTABLE**
This capability is not part of the spec yet, and may be removed or changed at any point.
The set of models and the one currently active.
type SessionNotification ¶
type SessionNotification struct {
// The _meta property is reserved by ACP to allow clients and agents to attach additional
// metadata to their interactions. Implementations MUST NOT make assumptions about values at
// these keys.
//
// See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
Meta map[string]any `json:"_meta,omitempty"`
// The ID of the session this update pertains to.
SessionId SessionId `json:"sessionId"`
// The actual update content.
Update SessionUpdate `json:"update"`
}
Notification containing a session update from the agent.
Used to stream real-time progress and results during prompt processing.
See protocol docs: [Agent Reports Output](https://agentclientprotocol.com/protocol/prompt-turn#3-agent-reports-output)
func (*SessionNotification) Validate ¶
func (v *SessionNotification) Validate() error
type SessionResumeCapabilities ¶
type SessionResumeCapabilities struct {
// The _meta property is reserved by ACP to allow clients and agents to attach additional
// metadata to their interactions. Implementations MUST NOT make assumptions about values at
// these keys.
//
// See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
Meta map[string]any `json:"_meta,omitempty"`
}
**UNSTABLE**
This capability is not part of the spec yet, and may be removed or changed at any point.
Capabilities for the 'session/resume' method.
By supplying '{}' it means that the agent supports resuming of sessions.
type SessionSessionInfoUpdate ¶
type SessionSessionInfoUpdate struct {
// The _meta property is reserved by ACP to allow clients and agents to attach additional
// metadata to their interactions. Implementations MUST NOT make assumptions about values at
// these keys.
//
// See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
Meta map[string]any `json:"_meta,omitempty"`
SessionUpdate string `json:"sessionUpdate"`
// Human-readable title for the session. Set to null to clear.
Title *string `json:"title,omitempty"`
// ISO 8601 timestamp of last activity. Set to null to clear.
UpdatedAt *string `json:"updatedAt,omitempty"`
}
Session metadata has been updated (title, timestamps, custom metadata)
type SessionToolCallUpdate ¶
type SessionToolCallUpdate struct {
// The _meta property is reserved by ACP to allow clients and agents to attach additional
// metadata to their interactions. Implementations MUST NOT make assumptions about values at
// these keys.
//
// See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
Meta map[string]any `json:"_meta,omitempty"`
// Replace the content collection.
Content []ToolCallContent `json:"content,omitempty"`
// Update the tool kind.
Kind *ToolKind `json:"kind,omitempty"`
// Replace the locations collection.
Locations []ToolCallLocation `json:"locations,omitempty"`
// Update the raw input.
RawInput any `json:"rawInput,omitempty"`
// Update the raw output.
RawOutput any `json:"rawOutput,omitempty"`
SessionUpdate string `json:"sessionUpdate"`
// Update the execution status.
Status *ToolCallStatus `json:"status,omitempty"`
// Update the human-readable title.
Title *string `json:"title,omitempty"`
// The ID of the tool call being updated.
ToolCallId ToolCallId `json:"toolCallId"`
}
Update on the status or results of a tool call.
type SessionUpdate ¶
type SessionUpdate struct {
// A chunk of the user's message being streamed.
UserMessageChunk *SessionUpdateUserMessageChunk `json:"-"`
// A chunk of the agent's response being streamed.
AgentMessageChunk *SessionUpdateAgentMessageChunk `json:"-"`
// A chunk of the agent's internal reasoning being streamed.
AgentThoughtChunk *SessionUpdateAgentThoughtChunk `json:"-"`
// Notification that a new tool call has been initiated.
ToolCall *SessionUpdateToolCall `json:"-"`
// Update on the status or results of a tool call.
ToolCallUpdate *SessionToolCallUpdate `json:"-"`
// The agent's execution plan for complex tasks.
// See protocol docs: [Agent Plan](https://agentclientprotocol.com/protocol/agent-plan)
Plan *SessionUpdatePlan `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/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:"-"`
// **UNSTABLE**
//
// This capability is not part of the spec yet, and may be removed or changed at any point.
//
// Context window and cost update for the session.
UsageUpdate *SessionUsageUpdate `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 StartPlan ¶ added in v0.15.0
func StartPlan(entries ...PlanEntry) SessionUpdate
StartPlan constructs a plan update with the provided entries.
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 StartToolCallStreaming ¶
func StartToolCallStreaming(id ToolCallId, title string, kind ToolKind, opts ...ToolCallStartOpt) SessionUpdate
StartToolCallStreaming constructs a minimal tool_call update suitable for sending as soon as a tool name is known but before the full input has been streamed. It sets status=pending with the provided kind and an empty rawInput so clients can display the tool immediately while input continues to arrive.
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 UpdateAvailableCommands ¶ added in v0.15.0
func UpdateAvailableCommands(commands ...AvailableCommand) SessionUpdate
UpdateAvailableCommands constructs an available_commands update with the provided commands.
func UpdateConfigOptions ¶
func UpdateConfigOptions(opts []SessionConfigOption) SessionUpdate
UpdateConfigOptions constructs a config_option_update that replaces the full set of configuration options visible to the client.
func UpdateCurrentMode ¶
func UpdateCurrentMode(modeID SessionModeId) SessionUpdate
UpdateCurrentMode constructs a current_mode_update that reports the active permission mode to the client.
func UpdatePlan ¶
func UpdatePlan(entries ...PlanEntry) SessionUpdate
UpdatePlan constructs a plan update with the provided entries.
func UpdateSessionInfo ¶ added in v0.15.0
func UpdateSessionInfo(update SessionInfoUpdate) SessionUpdate
UpdateSessionInfo constructs a session_info_update with the provided patch.
func UpdateSessionTitle ¶
func UpdateSessionTitle(title string) SessionUpdate
UpdateSessionTitle constructs a session_info_update that sets the human-readable session title visible in client session lists.
func UpdateToolCall ¶
func UpdateToolCall(id ToolCallId, opts ...ToolCallUpdateOpt) SessionUpdate
UpdateToolCall constructs a tool_call_update with the given ID and applies optional modifiers.
func UpdateUsage ¶
func UpdateUsage(used, size int, cost ...Cost) SessionUpdate
UpdateUsage constructs an unstable usage_update with the current token counts. used is the number of tokens currently in context, size is the total context window. An optional Cost may be provided to report cumulative session cost.
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/extensibility)
Meta map[string]any `json:"_meta,omitempty"`
// A single item of content
Content ContentBlock `json:"content"`
// **UNSTABLE**
//
// This capability is not part of the spec yet, and may be removed or changed at any point.
//
// 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.
// Both clients and agents MUST use UUID format for message IDs.
MessageId *string `json:"messageId,omitempty"`
SessionUpdate string `json:"sessionUpdate"`
}
A chunk of the agent's response being streamed.
type SessionUpdateAgentThoughtChunk ¶
type SessionUpdateAgentThoughtChunk struct {
// The _meta property is reserved by ACP to allow clients and agents to attach additional
// metadata to their interactions. Implementations MUST NOT make assumptions about values at
// these keys.
//
// See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
Meta map[string]any `json:"_meta,omitempty"`
// A single item of content
Content ContentBlock `json:"content"`
// **UNSTABLE**
//
// This capability is not part of the spec yet, and may be removed or changed at any point.
//
// 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.
// Both clients and agents MUST use UUID format for message IDs.
MessageId *string `json:"messageId,omitempty"`
SessionUpdate string `json:"sessionUpdate"`
}
A chunk of the agent's internal reasoning being streamed.
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/extensibility)
Meta map[string]any `json:"_meta,omitempty"`
// The list of tasks to be accomplished.
//
// When updating a plan, the agent must send a complete list of all entries
// with their current status. The client replaces the entire plan with each update.
Entries []PlanEntry `json:"entries"`
SessionUpdate string `json:"sessionUpdate"`
}
The agent's execution plan for complex tasks. See protocol docs: [Agent Plan](https://agentclientprotocol.com/protocol/agent-plan)
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/extensibility)
Meta map[string]any `json:"_meta,omitempty"`
// Content produced by the tool call.
Content []ToolCallContent `json:"content,omitempty"`
// The category of tool being invoked.
// Helps clients choose appropriate icons and UI treatment.
Kind ToolKind `json:"kind,omitempty"`
// File locations affected by this tool call.
// Enables "follow-along" features in clients.
Locations []ToolCallLocation `json:"locations,omitempty"`
// Raw input parameters sent to the tool.
RawInput any `json:"rawInput,omitempty"`
// Raw output returned by the tool.
RawOutput any `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.
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/extensibility)
Meta map[string]any `json:"_meta,omitempty"`
// A single item of content
Content ContentBlock `json:"content"`
// **UNSTABLE**
//
// This capability is not part of the spec yet, and may be removed or changed at any point.
//
// 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.
// Both clients and agents MUST use UUID format for message IDs.
MessageId *string `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/prompt-turn#3-agent-reports-output) A chunk of the user's message being streamed.
type SessionUsageUpdate ¶
type SessionUsageUpdate struct {
// The _meta property is reserved by ACP to allow clients and agents to attach additional
// metadata to their interactions. Implementations MUST NOT make assumptions about values at
// these keys.
//
// See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
Meta map[string]any `json:"_meta,omitempty"`
// Cumulative session cost (optional).
Cost *Cost `json:"cost,omitempty"`
SessionUpdate string `json:"sessionUpdate"`
// Total context window size in tokens.
Size int `json:"size"`
// Tokens currently in context.
Used int `json:"used"`
}
**UNSTABLE**
This capability is not part of the spec yet, and may be removed or changed at any point.
Context window and cost update for the session.
type SetSessionConfigOptionBoolean ¶
type SetSessionConfigOptionBoolean struct {
// The _meta property is reserved by ACP to allow clients and agents to attach additional
// metadata to their interactions. Implementations MUST NOT make assumptions about values at
// these keys.
//
// See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
Meta map[string]any `json:"_meta,omitempty"`
// The ID of the configuration option to set.
ConfigId SessionConfigId `json:"configId"`
// The ID of the session to set the configuration option for.
SessionId SessionId `json:"sessionId"`
Type string `json:"type"`
// The boolean value.
Value bool `json:"value"`
}
Request parameters for setting a session configuration option. A boolean value ('type: "boolean"').
type SetSessionConfigOptionRequest ¶
type SetSessionConfigOptionRequest struct {
// A boolean value ('type: "boolean"').
Boolean *SetSessionConfigOptionBoolean `json:"-"`
// A ['SessionConfigValueId'] string value.
//
// This is the default when 'type' is absent on the wire. Unknown 'type'
// values with string payloads also gracefully deserialize into this
// variant.
ValueId *SetSessionConfigOptionValueId `json:"-"`
}
func (SetSessionConfigOptionRequest) MarshalJSON ¶
func (u SetSessionConfigOptionRequest) MarshalJSON() ([]byte, error)
func (*SetSessionConfigOptionRequest) UnmarshalJSON ¶
func (u *SetSessionConfigOptionRequest) UnmarshalJSON(b []byte) error
func (*SetSessionConfigOptionRequest) Validate ¶
func (v *SetSessionConfigOptionRequest) Validate() error
type SetSessionConfigOptionResponse ¶
type SetSessionConfigOptionResponse struct {
// The _meta property is reserved by ACP to allow clients and agents to attach additional
// metadata to their interactions. Implementations MUST NOT make assumptions about values at
// these keys.
//
// See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
Meta map[string]any `json:"_meta,omitempty"`
// The full set of configuration options and their current values.
ConfigOptions []SessionConfigOption `json:"configOptions"`
}
Response to 'session/set_config_option' method.
func (*SetSessionConfigOptionResponse) Validate ¶
func (v *SetSessionConfigOptionResponse) Validate() error
type SetSessionConfigOptionValueId ¶
type SetSessionConfigOptionValueId struct {
// The _meta property is reserved by ACP to allow clients and agents to attach additional
// metadata to their interactions. Implementations MUST NOT make assumptions about values at
// these keys.
//
// See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
Meta map[string]any `json:"_meta,omitempty"`
// The ID of the configuration option to set.
ConfigId SessionConfigId `json:"configId"`
// The ID of the session to set the configuration option for.
SessionId SessionId `json:"sessionId"`
// The value ID.
Value SessionConfigValueId `json:"value"`
}
A ['SessionConfigValueId'] string value.
This is the default when 'type' is absent on the wire. Unknown 'type' values with string payloads also gracefully deserialize into this variant.
type SetSessionModeRequest ¶
type SetSessionModeRequest struct {
// The _meta property is reserved by ACP to allow clients and agents to attach additional
// metadata to their interactions. Implementations MUST NOT make assumptions about values at
// these keys.
//
// See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
Meta map[string]any `json:"_meta,omitempty"`
// The ID of the mode to set.
ModeId SessionModeId `json:"modeId"`
// The ID of the session to set the mode for.
SessionId SessionId `json:"sessionId"`
}
Request parameters for setting a session mode.
func (*SetSessionModeRequest) Validate ¶
func (v *SetSessionModeRequest) Validate() error
type SetSessionModeResponse ¶
type SetSessionModeResponse struct {
// The _meta property is reserved by ACP to allow clients and agents to attach additional
// metadata to their interactions. Implementations MUST NOT make assumptions about values at
// these keys.
//
// See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
Meta map[string]any `json:"_meta,omitempty"`
}
Response to 'session/set_mode' method.
func (*SetSessionModeResponse) Validate ¶
func (v *SetSessionModeResponse) Validate() error
type SetSessionModelRequest ¶ added in v0.15.0
type SetSessionModelRequest = UnstableSetSessionModelRequest
Request parameters for setting a session model.
type SetSessionModelResponse ¶ added in v0.15.0
type SetSessionModelResponse = UnstableSetSessionModelResponse
Response to 'session/set_model' method.
type StopReason ¶
type StopReason string
Reasons why an agent stops processing a prompt turn.
See protocol docs: [Stop Reasons](https://agentclientprotocol.com/protocol/prompt-turn#stop-reasons)
const ( StopReasonEndTurn StopReason = "end_turn" StopReasonMaxTokens StopReason = "max_tokens" StopReasonMaxTurnRequests StopReason = "max_turn_requests" StopReasonRefusal StopReason = "refusal" StopReasonCancelled StopReason = "cancelled" )
type SuccessorMessage ¶ added in v0.15.0
type SuccessorMessage struct {
Meta map[string]any `json:"_meta,omitempty"`
ProxyId string `json:"proxyId"`
Message string `json:"message"`
}
func (*SuccessorMessage) Validate ¶ added in v0.15.0
func (v *SuccessorMessage) Validate() error
type Terminal ¶
type Terminal struct {
// The _meta property is reserved by ACP to allow clients and agents to attach additional
// metadata to their interactions. Implementations MUST NOT make assumptions about values at
// these keys.
//
// See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
Meta map[string]any `json:"_meta,omitempty"`
TerminalId string `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/terminals)
type TerminalExitStatus ¶
type TerminalExitStatus struct {
// The _meta property is reserved by ACP to allow clients and agents to attach additional
// metadata to their interactions. Implementations MUST NOT make assumptions about values at
// these keys.
//
// See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
Meta map[string]any `json:"_meta,omitempty"`
// The process exit code (may be null if terminated by signal).
ExitCode *int `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.
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/extensibility)
Meta map[string]any `json:"_meta,omitempty"`
// The session ID for this request.
SessionId SessionId `json:"sessionId"`
// The ID of the terminal to get output from.
TerminalId string `json:"terminalId"`
}
Request to get the current output and status of a terminal.
func (*TerminalOutputRequest) Validate ¶
func (v *TerminalOutputRequest) Validate() error
type TerminalOutputResponse ¶
type TerminalOutputResponse struct {
// The _meta property is reserved by ACP to allow clients and agents to attach additional
// metadata to their interactions. Implementations MUST NOT make assumptions about values at
// these keys.
//
// See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
Meta map[string]any `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) 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/extensibility)
Meta map[string]any `json:"_meta,omitempty"`
Annotations *Annotations `json:"annotations,omitempty"`
Text string `json:"text"`
}
Text provided to or from an LLM.
type TextDocumentSyncKind ¶
type TextDocumentSyncKind string
How the agent wants document changes delivered.
const ( TextDocumentSyncKindFull TextDocumentSyncKind = "full" TextDocumentSyncKindIncremental TextDocumentSyncKind = "incremental" )
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/extensibility)
Meta map[string]any `json:"_meta,omitempty"`
MimeType *string `json:"mimeType,omitempty"`
Text string `json:"text"`
Uri string `json:"uri"`
}
Text-based resource contents.
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/extensibility)
Meta map[string]any `json:"_meta,omitempty"`
// Content produced by the tool call.
Content []ToolCallContent `json:"content,omitempty"`
// The category of tool being invoked.
// Helps clients choose appropriate icons and UI treatment.
Kind ToolKind `json:"kind,omitempty"`
// File locations affected by this tool call.
// Enables "follow-along" features in clients.
Locations []ToolCallLocation `json:"locations,omitempty"`
// Raw input parameters sent to the tool.
RawInput any `json:"rawInput,omitempty"`
// Raw output returned by the tool.
RawOutput any `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/tool-calls)
type ToolCallContent ¶
type ToolCallContent struct {
// Standard content block (text, images, resources).
Content *ToolCallContentContent `json:"-"`
// File modification shown as a diff.
Diff *ToolCallContentDiff `json:"-"`
// Embed a terminal created with 'terminal/create' by its id.
//
// The terminal must be added before calling 'terminal/release'.
//
// See protocol docs: [Terminal](https://agentclientprotocol.com/protocol/terminals)
Terminal *ToolCallContentTerminal `json:"-"`
}
func ToolContent ¶
func ToolContent(block ContentBlock, opts ...ToolContentOpt) 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 ToolDiffContentWithOptions ¶ added in v0.15.0
func ToolDiffContentWithOptions(path string, newText string, oldText *string, opts ...ToolDiffContentOpt) ToolCallContent
ToolDiffContentWithOptions constructs a diff tool-call content with explicit metadata support.
func ToolTerminalRef ¶
func ToolTerminalRef(terminalID string, opts ...ToolTerminalContentOpt) 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/extensibility)
Meta map[string]any `json:"_meta,omitempty"`
// The actual content block.
Content ContentBlock `json:"content"`
Type string `json:"type"`
}
Content produced by a tool call.
Tool calls can produce different types of content including standard content blocks (text, images) or file diffs.
See protocol docs: Content(https://agentclientprotocol.com/protocol/tool-calls#content) Standard content block (text, images, resources).
type ToolCallContentDiff ¶
type ToolCallContentDiff struct {
// The _meta property is reserved by ACP to allow clients and agents to attach additional
// metadata to their interactions. Implementations MUST NOT make assumptions about values at
// these keys.
//
// See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
Meta map[string]any `json:"_meta,omitempty"`
// The new content after modification.
NewText string `json:"newText"`
// The original content (None for new files).
OldText *string `json:"oldText,omitempty"`
// The file path being modified.
Path string `json:"path"`
Type string `json:"type"`
}
File modification shown as a diff.
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/extensibility)
Meta map[string]any `json:"_meta,omitempty"`
TerminalId string `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/terminals)
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/extensibility)
Meta map[string]any `json:"_meta,omitempty"`
// Optional line number within the file.
Line *int `json:"line,omitempty"`
// The 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/tool-calls#following-the-agent)
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 and, if a single path is provided and rawInput is empty, mirrors it as rawInput.path.
func WithStartMeta ¶
func WithStartMeta(meta map[string]any) ToolCallStartOpt
WithStartMeta sets the _meta field for a tool_call start update.
func WithStartRawInput ¶
func WithStartRawInput(v any) ToolCallStartOpt
WithStartRawInput sets rawInput for a tool_call start update.
func WithStartRawOutput ¶
func WithStartRawOutput(v any) ToolCallStartOpt
WithStartRawOutput sets rawOutput for a tool_call start update.
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/tool-calls#status)
const ( ToolCallStatusPending ToolCallStatus = "pending" ToolCallStatusInProgress ToolCallStatus = "in_progress" ToolCallStatusCompleted ToolCallStatus = "completed" ToolCallStatusFailed ToolCallStatus = "failed" )
type ToolCallUpdate ¶
type ToolCallUpdate struct {
// The _meta property is reserved by ACP to allow clients and agents to attach additional
// metadata to their interactions. Implementations MUST NOT make assumptions about values at
// these keys.
//
// See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
Meta map[string]any `json:"_meta,omitempty"`
// Replace the content collection.
Content []ToolCallContent `json:"content,omitempty"`
// Update the tool kind.
Kind *ToolKind `json:"kind,omitempty"`
// Replace the locations collection.
Locations []ToolCallLocation `json:"locations,omitempty"`
// Update the raw input.
RawInput any `json:"rawInput,omitempty"`
// Update the raw output.
RawOutput any `json:"rawOutput,omitempty"`
// Update the execution status.
Status *ToolCallStatus `json:"status,omitempty"`
// Update the human-readable title.
Title *string `json:"title,omitempty"`
// 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/tool-calls#updating)
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.
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.
func WithUpdateMeta ¶
func WithUpdateMeta(meta map[string]any) ToolCallUpdateOpt
WithUpdateMeta sets the _meta field for a tool_call_update.
func WithUpdateRawInput ¶
func WithUpdateRawInput(v any) ToolCallUpdateOpt
WithUpdateRawInput sets rawInput for a tool_call_update.
func WithUpdateRawOutput ¶
func WithUpdateRawOutput(v any) ToolCallUpdateOpt
WithUpdateRawOutput sets rawOutput for a tool_call_update.
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 ToolContentOpt ¶ added in v0.15.0
type ToolContentOpt func(*ToolCallContentContent)
func WithToolContentMeta ¶ added in v0.15.0
func WithToolContentMeta(meta map[string]any) ToolContentOpt
WithToolContentMeta sets the _meta field on standard tool content.
type ToolDiffContentOpt ¶ added in v0.15.0
type ToolDiffContentOpt func(*ToolCallContentDiff)
func WithToolDiffMeta ¶ added in v0.15.0
func WithToolDiffMeta(meta map[string]any) ToolDiffContentOpt
WithToolDiffMeta sets the _meta field on diff tool content.
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/tool-calls#creating)
const ( ToolKindRead ToolKind = "read" ToolKindEdit ToolKind = "edit" ToolKindDelete ToolKind = "delete" ToolKindMove ToolKind = "move" ToolKindSearch ToolKind = "search" ToolKindExecute ToolKind = "execute" ToolKindThink ToolKind = "think" ToolKindFetch ToolKind = "fetch" ToolKindSwitchMode ToolKind = "switch_mode" ToolKindOther ToolKind = "other" )
type ToolTerminalContentOpt ¶ added in v0.15.0
type ToolTerminalContentOpt func(*ToolCallContentTerminal)
func WithToolTerminalMeta ¶ added in v0.15.0
func WithToolTerminalMeta(meta map[string]any) ToolTerminalContentOpt
WithToolTerminalMeta sets the _meta field on terminal tool content.
type UnstableAcceptNesNotification ¶
type UnstableAcceptNesNotification struct {
// The _meta property is reserved by ACP to allow clients and agents to attach additional
// metadata to their interactions. Implementations MUST NOT make assumptions about values at
// these keys.
//
// See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
Meta map[string]any `json:"_meta,omitempty"`
// The ID of the accepted suggestion.
Id string `json:"id"`
// The session ID for this notification.
SessionId SessionId `json:"sessionId"`
}
Notification sent when a suggestion is accepted.
func (*UnstableAcceptNesNotification) Validate ¶
func (v *UnstableAcceptNesNotification) Validate() error
type UnstableCancelRequestNotification ¶
type UnstableCancelRequestNotification struct {
// The _meta property is reserved by ACP to allow clients and agents to attach additional
// metadata to their interactions. Implementations MUST NOT make assumptions about values at
// these keys.
//
// See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
Meta map[string]any `json:"_meta,omitempty"`
// The ID of the request to cancel.
RequestId RequestId `json:"requestId"`
}
**UNSTABLE**
This capability is not part of the spec yet, and may be removed or changed at any point.
Notification to cancel an ongoing request.
See protocol docs: [Cancellation](https://agentclientprotocol.com/protocol/cancellation)
func (*UnstableCancelRequestNotification) Validate ¶
func (v *UnstableCancelRequestNotification) Validate() error
type UnstableCloseNesRequest ¶
type UnstableCloseNesRequest struct {
// The _meta property is reserved by ACP to allow clients and agents to attach additional
// metadata to their interactions. Implementations MUST NOT make assumptions about values at
// these keys.
//
// See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
Meta map[string]any `json:"_meta,omitempty"`
// The ID of the NES session to close.
SessionId SessionId `json:"sessionId"`
}
Request to close an NES session.
The agent **must** cancel any ongoing work related to the NES session and then free up any resources associated with the session.
func (*UnstableCloseNesRequest) Validate ¶
func (v *UnstableCloseNesRequest) Validate() error
type UnstableCloseNesResponse ¶
type UnstableCloseNesResponse struct {
// The _meta property is reserved by ACP to allow clients and agents to attach additional
// metadata to their interactions. Implementations MUST NOT make assumptions about values at
// these keys.
//
// See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
Meta map[string]any `json:"_meta,omitempty"`
}
Response from closing an NES session.
func (*UnstableCloseNesResponse) Validate ¶
func (v *UnstableCloseNesResponse) Validate() error
type UnstableCloseSessionRequest ¶
type UnstableCloseSessionRequest struct {
// The _meta property is reserved by ACP to allow clients and agents to attach additional
// metadata to their interactions. Implementations MUST NOT make assumptions about values at
// these keys.
//
// See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
Meta map[string]any `json:"_meta,omitempty"`
// The ID of the session to close.
SessionId SessionId `json:"sessionId"`
}
func (*UnstableCloseSessionRequest) Validate ¶
func (v *UnstableCloseSessionRequest) Validate() error
type UnstableCloseSessionResponse ¶
type UnstableCloseSessionResponse struct {
// The _meta property is reserved by ACP to allow clients and agents to attach additional
// metadata to their interactions. Implementations MUST NOT make assumptions about values at
// these keys.
//
// See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
Meta map[string]any `json:"_meta,omitempty"`
}
**UNSTABLE**
This capability is not part of the spec yet, and may be removed or changed at any point.
Response from closing a session.
func (*UnstableCloseSessionResponse) Validate ¶
func (v *UnstableCloseSessionResponse) Validate() error
type UnstableCompleteElicitationNotification ¶
type UnstableCompleteElicitationNotification struct {
// The _meta property is reserved by ACP to allow clients and agents to attach additional
// metadata to their interactions. Implementations MUST NOT make assumptions about values at
// these keys.
//
// See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
Meta map[string]any `json:"_meta,omitempty"`
// The ID of the elicitation that completed.
ElicitationId UnstableElicitationId `json:"elicitationId"`
}
**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 a URL-based elicitation is complete.
func (*UnstableCompleteElicitationNotification) Validate ¶
func (v *UnstableCompleteElicitationNotification) Validate() error
type UnstableCreateElicitationAccept ¶
type UnstableCreateElicitationAccept struct {
// The _meta property is reserved by ACP to allow clients and agents to attach additional
// metadata to their interactions. Implementations MUST NOT make assumptions about values at
// these keys.
//
// See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
Meta map[string]any `json:"_meta,omitempty"`
Action string `json:"action"`
// The user-provided content, if any, as an object matching the requested schema.
Content map[string]any `json:"content,omitempty"`
}
**UNSTABLE**
This capability is not part of the spec yet, and may be removed or changed at any point.
Response from the client to an elicitation request. The user accepted and provided content.
type UnstableCreateElicitationCancel ¶
type UnstableCreateElicitationCancel struct {
// The _meta property is reserved by ACP to allow clients and agents to attach additional
// metadata to their interactions. Implementations MUST NOT make assumptions about values at
// these keys.
//
// See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
Meta map[string]any `json:"_meta,omitempty"`
Action string `json:"action"`
}
The elicitation was cancelled.
type UnstableCreateElicitationDecline ¶
type UnstableCreateElicitationDecline struct {
// The _meta property is reserved by ACP to allow clients and agents to attach additional
// metadata to their interactions. Implementations MUST NOT make assumptions about values at
// these keys.
//
// See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
Meta map[string]any `json:"_meta,omitempty"`
Action string `json:"action"`
}
The user declined the elicitation.
type UnstableCreateElicitationForm ¶
type UnstableCreateElicitationForm struct {
// The _meta property is reserved by ACP to allow clients and agents to attach additional
// metadata to their interactions. Implementations MUST NOT make assumptions about values at
// these keys.
//
// See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
Meta map[string]any `json:"_meta,omitempty"`
// A human-readable message describing what input is needed.
Message string `json:"message"`
Mode string `json:"mode"`
// A JSON Schema describing the form fields to present to the user.
RequestedSchema UnstableElicitationSchema `json:"requestedSchema"`
}
**UNSTABLE**
This capability is not part of the spec yet, and may be removed or changed at any point.
Request from the agent to elicit structured user input.
The agent sends this to the client to request information from the user, either via a form or by directing them to a URL. Elicitations are tied to a session (optionally a tool call) or a request. Form-based elicitation where the client renders a form from the provided schema.
type UnstableCreateElicitationRequest ¶
type UnstableCreateElicitationRequest struct {
// Form-based elicitation where the client renders a form from the provided schema.
Form *UnstableCreateElicitationForm `json:"-"`
// URL-based elicitation where the client directs the user to a URL.
Url *UnstableCreateElicitationUrl `json:"-"`
}
func NewUnstableCreateElicitationRequestForm ¶
func NewUnstableCreateElicitationRequestForm(requestedSchema UnstableElicitationSchema) UnstableCreateElicitationRequest
NewUnstableCreateElicitationRequestForm constructs a UnstableCreateElicitationRequest using the 'form' variant.
func NewUnstableCreateElicitationRequestUrl ¶
func NewUnstableCreateElicitationRequestUrl(elicitationId UnstableElicitationId, url string) UnstableCreateElicitationRequest
NewUnstableCreateElicitationRequestUrl constructs a UnstableCreateElicitationRequest using the 'url' variant.
func (UnstableCreateElicitationRequest) MarshalJSON ¶
func (u UnstableCreateElicitationRequest) MarshalJSON() ([]byte, error)
func (*UnstableCreateElicitationRequest) UnmarshalJSON ¶
func (u *UnstableCreateElicitationRequest) UnmarshalJSON(b []byte) error
func (*UnstableCreateElicitationRequest) Validate ¶
func (u *UnstableCreateElicitationRequest) Validate() error
type UnstableCreateElicitationResponse ¶
type UnstableCreateElicitationResponse struct {
// The user accepted and provided content.
Accept *UnstableCreateElicitationAccept `json:"-"`
// The user declined the elicitation.
Decline *UnstableCreateElicitationDecline `json:"-"`
// The elicitation was cancelled.
Cancel *UnstableCreateElicitationCancel `json:"-"`
}
func NewUnstableCreateElicitationResponseAccept ¶
func NewUnstableCreateElicitationResponseAccept() UnstableCreateElicitationResponse
NewUnstableCreateElicitationResponseAccept constructs a UnstableCreateElicitationResponse using the 'accept' variant.
func NewUnstableCreateElicitationResponseCancel ¶
func NewUnstableCreateElicitationResponseCancel() UnstableCreateElicitationResponse
NewUnstableCreateElicitationResponseCancel constructs a UnstableCreateElicitationResponse using the 'cancel' variant.
func NewUnstableCreateElicitationResponseDecline ¶
func NewUnstableCreateElicitationResponseDecline() UnstableCreateElicitationResponse
NewUnstableCreateElicitationResponseDecline constructs a UnstableCreateElicitationResponse using the 'decline' variant.
func (UnstableCreateElicitationResponse) MarshalJSON ¶
func (u UnstableCreateElicitationResponse) MarshalJSON() ([]byte, error)
func (*UnstableCreateElicitationResponse) UnmarshalJSON ¶
func (u *UnstableCreateElicitationResponse) UnmarshalJSON(b []byte) error
func (*UnstableCreateElicitationResponse) Validate ¶
func (u *UnstableCreateElicitationResponse) Validate() error
type UnstableCreateElicitationUrl ¶
type UnstableCreateElicitationUrl struct {
// The _meta property is reserved by ACP to allow clients and agents to attach additional
// metadata to their interactions. Implementations MUST NOT make assumptions about values at
// these keys.
//
// See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
Meta map[string]any `json:"_meta,omitempty"`
// The unique identifier for this elicitation.
ElicitationId UnstableElicitationId `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"`
}
URL-based elicitation where the client directs the user to a URL.
type UnstableDidChangeDocumentNotification ¶
type UnstableDidChangeDocumentNotification struct {
// The _meta property is reserved by ACP to allow clients and agents to attach additional
// metadata to their interactions. Implementations MUST NOT make assumptions about values at
// these keys.
//
// See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
Meta map[string]any `json:"_meta,omitempty"`
// The content changes.
ContentChanges []UnstableTextDocumentContentChangeEvent `json:"contentChanges"`
// The session ID for this notification.
SessionId SessionId `json:"sessionId"`
// The URI of the changed document.
Uri string `json:"uri"`
// The new version number of the document.
Version int `json:"version"`
}
Notification sent when a file is edited.
func (*UnstableDidChangeDocumentNotification) Validate ¶
func (v *UnstableDidChangeDocumentNotification) Validate() error
type UnstableDidCloseDocumentNotification ¶
type UnstableDidCloseDocumentNotification struct {
// The _meta property is reserved by ACP to allow clients and agents to attach additional
// metadata to their interactions. Implementations MUST NOT make assumptions about values at
// these keys.
//
// See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
Meta map[string]any `json:"_meta,omitempty"`
// The session ID for this notification.
SessionId SessionId `json:"sessionId"`
// The URI of the closed document.
Uri string `json:"uri"`
}
Notification sent when a file is closed.
func (*UnstableDidCloseDocumentNotification) Validate ¶
func (v *UnstableDidCloseDocumentNotification) Validate() error
type UnstableDidFocusDocumentNotification ¶
type UnstableDidFocusDocumentNotification struct {
// The _meta property is reserved by ACP to allow clients and agents to attach additional
// metadata to their interactions. Implementations MUST NOT make assumptions about values at
// these keys.
//
// See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
Meta map[string]any `json:"_meta,omitempty"`
// The current cursor position.
Position UnstablePosition `json:"position"`
// The session ID for this notification.
SessionId SessionId `json:"sessionId"`
// The URI of the focused document.
Uri string `json:"uri"`
// The version number of the document.
Version int `json:"version"`
// The portion of the file currently visible in the editor viewport.
VisibleRange UnstableRange `json:"visibleRange"`
}
Notification sent when a file becomes the active editor tab.
func (*UnstableDidFocusDocumentNotification) Validate ¶
func (v *UnstableDidFocusDocumentNotification) Validate() error
type UnstableDidOpenDocumentNotification ¶
type UnstableDidOpenDocumentNotification struct {
// The _meta property is reserved by ACP to allow clients and agents to attach additional
// metadata to their interactions. Implementations MUST NOT make assumptions about values at
// these keys.
//
// See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
Meta map[string]any `json:"_meta,omitempty"`
// The language identifier of the document (e.g., "rust", "python").
LanguageId string `json:"languageId"`
// The session ID for this notification.
SessionId SessionId `json:"sessionId"`
// The full text content of the document.
Text string `json:"text"`
// The URI of the opened document.
Uri string `json:"uri"`
// The version number of the document.
Version int `json:"version"`
}
Notification sent when a file is opened in the editor.
func (*UnstableDidOpenDocumentNotification) Validate ¶
func (v *UnstableDidOpenDocumentNotification) Validate() error
type UnstableDidSaveDocumentNotification ¶
type UnstableDidSaveDocumentNotification struct {
// The _meta property is reserved by ACP to allow clients and agents to attach additional
// metadata to their interactions. Implementations MUST NOT make assumptions about values at
// these keys.
//
// See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
Meta map[string]any `json:"_meta,omitempty"`
// The session ID for this notification.
SessionId SessionId `json:"sessionId"`
// The URI of the saved document.
Uri string `json:"uri"`
}
Notification sent when a file is saved.
func (*UnstableDidSaveDocumentNotification) Validate ¶
func (v *UnstableDidSaveDocumentNotification) Validate() error
type UnstableDisableProvidersRequest ¶
type UnstableDisableProvidersRequest struct {
// The _meta property is reserved by ACP to allow clients and agents to attach additional
// metadata to their interactions. Implementations MUST NOT make assumptions about values at
// these keys.
//
// See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
Meta map[string]any `json:"_meta,omitempty"`
// Provider id to disable.
Id string `json:"id"`
}
**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 (*UnstableDisableProvidersRequest) Validate ¶
func (v *UnstableDisableProvidersRequest) Validate() error
type UnstableDisableProvidersResponse ¶
type UnstableDisableProvidersResponse struct {
// The _meta property is reserved by ACP to allow clients and agents to attach additional
// metadata to their interactions. Implementations MUST NOT make assumptions about values at
// these keys.
//
// See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
Meta map[string]any `json:"_meta,omitempty"`
}
**UNSTABLE**
This capability is not part of the spec yet, and may be removed or changed at any point.
Response to 'providers/disable'.
func (*UnstableDisableProvidersResponse) Validate ¶
func (v *UnstableDisableProvidersResponse) Validate() error
type UnstableElicitationAcceptAction ¶
type UnstableElicitationAcceptAction struct {
// The user-provided content, if any, as an object matching the requested schema.
Content map[string]any `json:"content,omitempty"`
}
**UNSTABLE**
This capability is not part of the spec yet, and may be removed or changed at any point.
The user accepted the elicitation and provided content.
type UnstableElicitationFormMode ¶
type UnstableElicitationFormMode struct {
// Tied to a session, optionally to a specific tool call within that session.
Session *UnstableElicitationSessionScope `json:"-"`
// Tied to a specific JSON-RPC request outside of a session
// (e.g., during auth/configuration phases before any session is started).
Request *UnstableElicitationRequestScope `json:"-"`
}
**UNSTABLE**
This capability is not part of the spec yet, and may be removed or changed at any point.
Form-based elicitation mode where the client renders a form from the provided schema.
func (UnstableElicitationFormMode) MarshalJSON ¶
func (u UnstableElicitationFormMode) MarshalJSON() ([]byte, error)
func (*UnstableElicitationFormMode) UnmarshalJSON ¶
func (u *UnstableElicitationFormMode) UnmarshalJSON(b []byte) error
type UnstableElicitationId ¶
type UnstableElicitationId string
**UNSTABLE**
This capability is not part of the spec yet, and may be removed or changed at any point.
Unique identifier for an elicitation.
type UnstableElicitationRequestScope ¶
type UnstableElicitationRequestScope struct {
// The request this elicitation is tied to.
RequestId RequestId `json:"requestId"`
}
**UNSTABLE**
This capability is not part of the spec yet, and may be removed or changed at any point.
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 UnstableElicitationSchema ¶
type UnstableElicitationSchema struct {
// Optional description of what this schema represents.
Description *string `json:"description,omitempty"`
// Property definitions (must be primitive types).
//
// Defaults to {} if unset.
Properties map[string]any `json:"properties"`
// List of required property names.
Required []string `json:"required,omitempty"`
// Optional title for the schema.
Title *string `json:"title,omitempty"`
// Type discriminator. Always '"object"'.
//
// Defaults to "object" if unset.
Type UnstableElicitationSchemaType `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 (UnstableElicitationSchema) MarshalJSON ¶
func (v UnstableElicitationSchema) MarshalJSON() ([]byte, error)
func (*UnstableElicitationSchema) UnmarshalJSON ¶
func (v *UnstableElicitationSchema) UnmarshalJSON(b []byte) error
type UnstableElicitationSchemaType ¶
type UnstableElicitationSchemaType string
Type discriminator for elicitation schemas.
const (
UnstableElicitationSchemaTypeObject UnstableElicitationSchemaType = "object"
)
type UnstableElicitationSessionScope ¶
type UnstableElicitationSessionScope struct {
// The session this elicitation is tied to.
SessionId SessionId `json:"sessionId"`
// Optional tool call within the session.
ToolCallId *ToolCallId `json:"toolCallId,omitempty"`
}
**UNSTABLE**
This capability is not part of the spec yet, and may be removed or changed at any point.
Session-scoped elicitation, optionally tied to a specific tool call.
When 'tool_call_id' is set, the elicitation is tied to a specific tool call. This is useful when an agent receives an elicitation from an MCP server during a tool call and needs to redirect it to the user.
type UnstableElicitationUrlMode ¶
type UnstableElicitationUrlMode struct {
// Tied to a session, optionally to a specific tool call within that session.
Session *UnstableElicitationSessionScope `json:"-"`
// Tied to a specific JSON-RPC request outside of a session
// (e.g., during auth/configuration phases before any session is started).
Request *UnstableElicitationRequestScope `json:"-"`
}
**UNSTABLE**
This capability is not part of the spec yet, and may be removed or changed at any point.
URL-based elicitation mode where the client directs the user to a URL.
func (UnstableElicitationUrlMode) MarshalJSON ¶
func (u UnstableElicitationUrlMode) MarshalJSON() ([]byte, error)
func (*UnstableElicitationUrlMode) UnmarshalJSON ¶
func (u *UnstableElicitationUrlMode) UnmarshalJSON(b []byte) error
type UnstableForkSessionRequest ¶
type UnstableForkSessionRequest struct {
// The _meta property is reserved by ACP to allow clients and agents to attach additional
// metadata to their interactions. Implementations MUST NOT make assumptions about values at
// these keys.
//
// See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
Meta map[string]any `json:"_meta,omitempty"`
// **UNSTABLE**
//
// This capability is not part of the spec yet, and may be removed or changed at any point.
//
// Additional workspace roots to activate for this session. Each path must be absolute.
//
// When omitted or empty, no additional roots are activated. When non-empty,
// this is the complete resulting additional-root list for the forked
// session.
AdditionalDirectories []string `json:"additionalDirectories,omitempty"`
// The working directory for this session.
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"`
}
**UNSTABLE**
This capability is not part of the spec yet, and may be removed or changed at any point.
Request parameters for forking an existing session.
Creates a new session based on the context of an existing one, allowing operations like generating summaries without affecting the original session's history.
Only available if the Agent supports the 'session.fork' capability.
func (*UnstableForkSessionRequest) Validate ¶
func (v *UnstableForkSessionRequest) Validate() error
type UnstableForkSessionResponse ¶
type UnstableForkSessionResponse struct {
// The _meta property is reserved by ACP to allow clients and agents to attach additional
// metadata to their interactions. Implementations MUST NOT make assumptions about values at
// these keys.
//
// See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
Meta map[string]any `json:"_meta,omitempty"`
// Initial session configuration options if supported by the Agent.
ConfigOptions []UnstableSessionConfigOption `json:"configOptions,omitempty"`
// **UNSTABLE**
//
// This capability is not part of the spec yet, and may be removed or changed at any point.
//
// Initial model state if supported by the Agent
Models *UnstableSessionModelState `json:"models,omitempty"`
// Initial mode state if supported by the Agent
//
// See protocol docs: [Session Modes](https://agentclientprotocol.com/protocol/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) Validate ¶
func (v *UnstableForkSessionResponse) Validate() error
type UnstableListProvidersRequest ¶
type UnstableListProvidersRequest struct {
// The _meta property is reserved by ACP to allow clients and agents to attach additional
// metadata to their interactions. Implementations MUST NOT make assumptions about values at
// these keys.
//
// See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
Meta map[string]any `json:"_meta,omitempty"`
}
**UNSTABLE**
This capability is not part of the spec yet, and may be removed or changed at any point.
Request parameters for 'providers/list'.
func (*UnstableListProvidersRequest) Validate ¶
func (v *UnstableListProvidersRequest) Validate() error
type UnstableListProvidersResponse ¶
type UnstableListProvidersResponse struct {
// The _meta property is reserved by ACP to allow clients and agents to attach additional
// metadata to their interactions. Implementations MUST NOT make assumptions about values at
// these keys.
//
// See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
Meta map[string]any `json:"_meta,omitempty"`
// Configurable providers with current routing info suitable for UI display.
Providers []UnstableProviderInfo `json:"providers"`
}
**UNSTABLE**
This capability is not part of the spec yet, and may be removed or changed at any point.
Response to 'providers/list'.
func (*UnstableListProvidersResponse) Validate ¶
func (v *UnstableListProvidersResponse) Validate() error
type UnstableLlmProtocol ¶
type UnstableLlmProtocol struct {
// Unknown or custom protocol.
Other *UnstableLlmProtocolOther `json:"-"`
}
func (UnstableLlmProtocol) MarshalJSON ¶
func (u UnstableLlmProtocol) MarshalJSON() ([]byte, error)
func (*UnstableLlmProtocol) UnmarshalJSON ¶
func (u *UnstableLlmProtocol) UnmarshalJSON(b []byte) error
type UnstableLlmProtocolOther ¶
type UnstableLlmProtocolOther 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. Unknown or custom protocol.
type UnstableLogoutRequest ¶
type UnstableLogoutRequest struct {
// The _meta property is reserved by ACP to allow clients and agents to attach additional
// metadata to their interactions. Implementations MUST NOT make assumptions about values at
// these keys.
//
// See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
Meta map[string]any `json:"_meta,omitempty"`
}
**UNSTABLE**
This capability is not part of the spec yet, and may be removed or changed at any point.
Request parameters for the logout method.
Terminates the current authenticated session.
func (*UnstableLogoutRequest) Validate ¶
func (v *UnstableLogoutRequest) Validate() error
type UnstableLogoutResponse ¶
type UnstableLogoutResponse struct {
// The _meta property is reserved by ACP to allow clients and agents to attach additional
// metadata to their interactions. Implementations MUST NOT make assumptions about values at
// these keys.
//
// See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
Meta map[string]any `json:"_meta,omitempty"`
}
**UNSTABLE**
This capability is not part of the spec yet, and may be removed or changed at any point.
Response to the 'logout' method.
func (*UnstableLogoutResponse) Validate ¶
func (v *UnstableLogoutResponse) Validate() error
type UnstableModelId ¶
type UnstableModelId string
**UNSTABLE**
This capability is not part of the spec yet, and may be removed or changed at any point.
A unique identifier for a model.
type UnstableModelInfo ¶
type UnstableModelInfo struct {
// The _meta property is reserved by ACP to allow clients and agents to attach additional
// metadata to their interactions. Implementations MUST NOT make assumptions about values at
// these keys.
//
// See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
Meta map[string]any `json:"_meta,omitempty"`
// Optional description of the model.
Description *string `json:"description,omitempty"`
// Unique identifier for the model.
ModelId UnstableModelId `json:"modelId"`
// Human-readable name of the model.
Name string `json:"name"`
}
**UNSTABLE**
This capability is not part of the spec yet, and may be removed or changed at any point.
Information about a selectable model.
type UnstableNesDiagnostic ¶
type UnstableNesDiagnostic struct {
// The diagnostic message.
Message string `json:"message"`
// The range of the diagnostic.
Range UnstableRange `json:"range"`
// The severity of the diagnostic.
Severity UnstableNesDiagnosticSeverity `json:"severity"`
// The URI of the file containing the diagnostic.
Uri string `json:"uri"`
}
A diagnostic (error, warning, etc.).
type UnstableNesDiagnosticSeverity ¶
type UnstableNesDiagnosticSeverity string
Severity of a diagnostic.
const ( UnstableNesDiagnosticSeverityError UnstableNesDiagnosticSeverity = "error" UnstableNesDiagnosticSeverityWarning UnstableNesDiagnosticSeverity = "warning" UnstableNesDiagnosticSeverityInformation UnstableNesDiagnosticSeverity = "information" UnstableNesDiagnosticSeverityHint UnstableNesDiagnosticSeverity = "hint" )
type UnstableNesEditHistoryEntry ¶
type UnstableNesEditHistoryEntry struct {
// A diff representing the edit.
Diff string `json:"diff"`
// The URI of the edited file.
Uri string `json:"uri"`
}
An entry in the edit history.
type UnstableNesEditSuggestion ¶
type UnstableNesEditSuggestion struct {
// Optional suggested cursor position after applying edits.
CursorPosition *UnstablePosition `json:"cursorPosition,omitempty"`
// The text edits to apply.
Edits []UnstableNesTextEdit `json:"edits"`
// Unique identifier for accept/reject tracking.
Id string `json:"id"`
// The URI of the file to edit.
Uri string `json:"uri"`
}
A text edit suggestion.
type UnstableNesExcerpt ¶
type UnstableNesExcerpt struct {
// The end line of the excerpt (zero-based).
EndLine int `json:"endLine"`
// The start line of the excerpt (zero-based).
StartLine int `json:"startLine"`
// The text content of the excerpt.
Text string `json:"text"`
}
A code excerpt from a file.
type UnstableNesJumpSuggestion ¶
type UnstableNesJumpSuggestion struct {
// Unique identifier for accept/reject tracking.
Id string `json:"id"`
// The target position within the file.
Position UnstablePosition `json:"position"`
// The file to navigate to.
Uri string `json:"uri"`
}
A jump-to-location suggestion.
type UnstableNesOpenFile ¶
type UnstableNesOpenFile struct {
// The language identifier.
LanguageId string `json:"languageId"`
// Timestamp in milliseconds since epoch of when the file was last focused.
LastFocusedMs *int `json:"lastFocusedMs,omitempty"`
// The URI of the file.
Uri string `json:"uri"`
// The visible range in the editor, if any.
VisibleRange *UnstableRange `json:"visibleRange,omitempty"`
}
An open file in the editor.
type UnstableNesRecentFile ¶
type UnstableNesRecentFile struct {
// The language identifier.
LanguageId string `json:"languageId"`
// The full text content of the file.
Text string `json:"text"`
// The URI of the file.
Uri string `json:"uri"`
}
A recently accessed file.
type UnstableNesRejectReason ¶
type UnstableNesRejectReason string
The reason a suggestion was rejected.
const ( UnstableNesRejectReasonRejected UnstableNesRejectReason = "rejected" UnstableNesRejectReasonIgnored UnstableNesRejectReason = "ignored" UnstableNesRejectReasonReplaced UnstableNesRejectReason = "replaced" UnstableNesRejectReasonCancelled UnstableNesRejectReason = "cancelled" )
type UnstableNesRelatedSnippet ¶
type UnstableNesRelatedSnippet struct {
// The code excerpts.
Excerpts []UnstableNesExcerpt `json:"excerpts"`
// The URI of the file containing the snippets.
Uri string `json:"uri"`
}
A related code snippet from a file.
type UnstableNesRenameSuggestion ¶
type UnstableNesRenameSuggestion struct {
// Unique identifier for accept/reject tracking.
Id string `json:"id"`
// The new name for the symbol.
NewName string `json:"newName"`
// The position of the symbol to rename.
Position UnstablePosition `json:"position"`
// The file URI containing the symbol.
Uri string `json:"uri"`
}
A rename symbol suggestion.
type UnstableNesRepository ¶
type UnstableNesRepository struct {
// The repository name.
Name string `json:"name"`
// The repository owner.
Owner string `json:"owner"`
// The remote URL of the repository.
RemoteUrl string `json:"remoteUrl"`
}
Repository metadata for an NES session.
type UnstableNesSearchAndReplaceSuggestion ¶
type UnstableNesSearchAndReplaceSuggestion struct {
// Unique identifier for accept/reject tracking.
Id string `json:"id"`
// Whether 'search' is a regular expression. Defaults to 'false'.
IsRegex *bool `json:"isRegex,omitempty"`
// The replacement text.
Replace string `json:"replace"`
// The text or pattern to find.
Search string `json:"search"`
// The file URI to search within.
Uri string `json:"uri"`
}
A search-and-replace suggestion.
type UnstableNesSuggestContext ¶
type UnstableNesSuggestContext struct {
// The _meta property is reserved by ACP to allow clients and agents to attach additional
// metadata to their interactions. Implementations MUST NOT make assumptions about values at
// these keys.
//
// See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
Meta map[string]any `json:"_meta,omitempty"`
// Current diagnostics (errors, warnings).
Diagnostics []UnstableNesDiagnostic `json:"diagnostics,omitempty"`
// Recent edit history.
EditHistory []UnstableNesEditHistoryEntry `json:"editHistory,omitempty"`
// Currently open files in the editor.
OpenFiles []UnstableNesOpenFile `json:"openFiles,omitempty"`
// Recently accessed files.
RecentFiles []UnstableNesRecentFile `json:"recentFiles,omitempty"`
// Related code snippets.
RelatedSnippets []UnstableNesRelatedSnippet `json:"relatedSnippets,omitempty"`
// Recent user actions (typing, navigation, etc.).
UserActions []UnstableNesUserAction `json:"userActions,omitempty"`
}
Context attached to a suggestion request.
type UnstableNesSuggestion ¶
type UnstableNesSuggestion struct {
// A text edit suggestion.
Edit *UnstableNesSuggestionEdit `json:"-"`
// A jump-to-location suggestion.
Jump *UnstableNesSuggestionJump `json:"-"`
// A rename symbol suggestion.
Rename *UnstableNesSuggestionRename `json:"-"`
// A search-and-replace suggestion.
SearchAndReplace *UnstableNesSuggestionSearchAndReplace `json:"-"`
}
func NewUnstableNesSuggestionEdit ¶
func NewUnstableNesSuggestionEdit(id string, uri string, edits []UnstableNesTextEdit) UnstableNesSuggestion
NewUnstableNesSuggestionEdit constructs a UnstableNesSuggestion using the 'edit' variant.
func NewUnstableNesSuggestionJump ¶
func NewUnstableNesSuggestionJump(id string, uri string, position UnstablePosition) UnstableNesSuggestion
NewUnstableNesSuggestionJump constructs a UnstableNesSuggestion using the 'jump' variant.
func NewUnstableNesSuggestionRename ¶
func NewUnstableNesSuggestionRename(id string, uri string, position UnstablePosition, newName string) UnstableNesSuggestion
NewUnstableNesSuggestionRename constructs a UnstableNesSuggestion using the 'rename' variant.
func NewUnstableNesSuggestionSearchAndReplace ¶
func NewUnstableNesSuggestionSearchAndReplace(id string, uri string, search string, replace string) UnstableNesSuggestion
NewUnstableNesSuggestionSearchAndReplace constructs a UnstableNesSuggestion using the 'searchAndReplace' variant.
func (UnstableNesSuggestion) MarshalJSON ¶
func (u UnstableNesSuggestion) MarshalJSON() ([]byte, error)
func (*UnstableNesSuggestion) UnmarshalJSON ¶
func (u *UnstableNesSuggestion) UnmarshalJSON(b []byte) error
func (*UnstableNesSuggestion) Validate ¶
func (u *UnstableNesSuggestion) Validate() error
type UnstableNesSuggestionEdit ¶
type UnstableNesSuggestionEdit struct {
// Optional suggested cursor position after applying edits.
CursorPosition *UnstablePosition `json:"cursorPosition,omitempty"`
// The text edits to apply.
Edits []UnstableNesTextEdit `json:"edits"`
// Unique identifier for accept/reject tracking.
Id string `json:"id"`
Kind string `json:"kind"`
// The URI of the file to edit.
Uri string `json:"uri"`
}
A suggestion returned by the agent. A text edit suggestion.
type UnstableNesSuggestionJump ¶
type UnstableNesSuggestionJump struct {
// Unique identifier for accept/reject tracking.
Id string `json:"id"`
Kind string `json:"kind"`
// The target position within the file.
Position UnstablePosition `json:"position"`
// The file to navigate to.
Uri string `json:"uri"`
}
A jump-to-location suggestion.
type UnstableNesSuggestionRename ¶
type UnstableNesSuggestionRename struct {
// Unique identifier for accept/reject tracking.
Id string `json:"id"`
Kind string `json:"kind"`
// The new name for the symbol.
NewName string `json:"newName"`
// The position of the symbol to rename.
Position UnstablePosition `json:"position"`
// The file URI containing the symbol.
Uri string `json:"uri"`
}
A rename symbol suggestion.
type UnstableNesSuggestionSearchAndReplace ¶
type UnstableNesSuggestionSearchAndReplace struct {
// Unique identifier for accept/reject tracking.
Id string `json:"id"`
// Whether 'search' is a regular expression. Defaults to 'false'.
IsRegex *bool `json:"isRegex,omitempty"`
Kind string `json:"kind"`
// The replacement text.
Replace string `json:"replace"`
// The text or pattern to find.
Search string `json:"search"`
// The file URI to search within.
Uri string `json:"uri"`
}
A search-and-replace suggestion.
type UnstableNesTextEdit ¶
type UnstableNesTextEdit struct {
// The replacement text.
NewText string `json:"newText"`
// The range to replace.
Range UnstableRange `json:"range"`
}
A text edit within a suggestion.
type UnstableNesTriggerKind ¶
type UnstableNesTriggerKind string
What triggered the suggestion request.
const ( UnstableNesTriggerKindAutomatic UnstableNesTriggerKind = "automatic" UnstableNesTriggerKindDiagnostic UnstableNesTriggerKind = "diagnostic" UnstableNesTriggerKindManual UnstableNesTriggerKind = "manual" )
type UnstableNesUserAction ¶
type UnstableNesUserAction struct {
// The kind of action (e.g., "insertChar", "cursorMovement").
Action string `json:"action"`
// The position where the action occurred.
Position UnstablePosition `json:"position"`
// Timestamp in milliseconds since epoch.
TimestampMs int `json:"timestampMs"`
// The URI of the file where the action occurred.
Uri string `json:"uri"`
}
A user action (typing, cursor movement, etc.).
type UnstablePosition ¶
type UnstablePosition struct {
// Zero-based character offset (encoding-dependent).
Character int `json:"character"`
// Zero-based line number.
Line int `json:"line"`
}
A zero-based position in a text document.
The meaning of 'character' depends on the negotiated position encoding.
type UnstableProviderCurrentConfig ¶
type UnstableProviderCurrentConfig struct {
// Protocol currently used by this provider.
ApiType UnstableLlmProtocol `json:"apiType"`
// Base URL currently used by this provider.
BaseUrl string `json:"baseUrl"`
}
**UNSTABLE**
This capability is not part of the spec yet, and may be removed or changed at any point.
Current effective non-secret routing configuration for a provider.
type UnstableProviderInfo ¶
type UnstableProviderInfo struct {
// The _meta property is reserved by ACP to allow clients and agents to attach additional
// metadata to their interactions. Implementations MUST NOT make assumptions about values at
// these keys.
//
// See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
Meta map[string]any `json:"_meta,omitempty"`
// Current effective non-secret routing config.
// Null means provider is disabled.
Current *UnstableProviderCurrentConfig `json:"current"`
// Provider identifier, for example "main" or "openai".
Id string `json:"id"`
// Whether this provider is mandatory and cannot be disabled via 'providers/disable'.
// If true, clients must not call 'providers/disable' for this id.
Required bool `json:"required"`
// Supported protocol types for this provider.
Supported []UnstableLlmProtocol `json:"supported"`
}
**UNSTABLE**
This capability is not part of the spec yet, and may be removed or changed at any point.
Information about a configurable LLM provider.
type UnstableRange ¶
type UnstableRange struct {
// The end position (exclusive).
End UnstablePosition `json:"end"`
// The start position (inclusive).
Start UnstablePosition `json:"start"`
}
A range in a text document, expressed as start and end positions.
type UnstableRejectNesNotification ¶
type UnstableRejectNesNotification struct {
// The _meta property is reserved by ACP to allow clients and agents to attach additional
// metadata to their interactions. Implementations MUST NOT make assumptions about values at
// these keys.
//
// See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
Meta map[string]any `json:"_meta,omitempty"`
// The ID of the rejected suggestion.
Id string `json:"id"`
// The reason for rejection.
Reason *UnstableNesRejectReason `json:"reason,omitempty"`
// The session ID for this notification.
SessionId SessionId `json:"sessionId"`
}
Notification sent when a suggestion is rejected.
func (*UnstableRejectNesNotification) Validate ¶
func (v *UnstableRejectNesNotification) Validate() error
type UnstableResumeSessionRequest ¶
type UnstableResumeSessionRequest struct {
// The _meta property is reserved by ACP to allow clients and agents to attach additional
// metadata to their interactions. Implementations MUST NOT make assumptions about values at
// these keys.
//
// See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
Meta map[string]any `json:"_meta,omitempty"`
// **UNSTABLE**
//
// This capability is not part of the spec yet, and may be removed or changed at any point.
//
// 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.
AdditionalDirectories []string `json:"additionalDirectories,omitempty"`
// The working directory for this session.
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"`
}
func (*UnstableResumeSessionRequest) Validate ¶
func (v *UnstableResumeSessionRequest) Validate() error
type UnstableResumeSessionResponse ¶
type UnstableResumeSessionResponse struct {
// The _meta property is reserved by ACP to allow clients and agents to attach additional
// metadata to their interactions. Implementations MUST NOT make assumptions about values at
// these keys.
//
// See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
Meta map[string]any `json:"_meta,omitempty"`
// Initial session configuration options if supported by the Agent.
ConfigOptions []UnstableSessionConfigOption `json:"configOptions,omitempty"`
// **UNSTABLE**
//
// This capability is not part of the spec yet, and may be removed or changed at any point.
//
// Initial model state if supported by the Agent
Models *UnstableSessionModelState `json:"models,omitempty"`
// Initial mode state if supported by the Agent
//
// See protocol docs: [Session Modes](https://agentclientprotocol.com/protocol/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 resuming an existing session.
func (*UnstableResumeSessionResponse) Validate ¶
func (v *UnstableResumeSessionResponse) Validate() error
type UnstableSessionConfigBoolean ¶
type UnstableSessionConfigBoolean struct {
// The current value of the boolean option.
CurrentValue bool `json:"currentValue"`
}
**UNSTABLE**
This capability is not part of the spec yet, and may be removed or changed at any point.
A boolean on/off toggle session configuration option payload.
type UnstableSessionConfigOption ¶
type UnstableSessionConfigOption struct {
// Single-value selector (dropdown).
Select *UnstableSessionConfigOptionSelect `json:"-"`
// **UNSTABLE**
//
// This capability is not part of the spec yet, and may be removed or changed at any point.
//
// Boolean on/off toggle.
Boolean *UnstableSessionConfigOptionBoolean `json:"-"`
}
func NewUnstableSessionConfigOptionBoolean ¶
func NewUnstableSessionConfigOptionBoolean(currentValue bool) UnstableSessionConfigOption
NewUnstableSessionConfigOptionBoolean constructs a UnstableSessionConfigOption using the 'boolean' variant.
func NewUnstableSessionConfigOptionSelect ¶
func NewUnstableSessionConfigOptionSelect(currentValue SessionConfigValueId, options SessionConfigSelectOptions) UnstableSessionConfigOption
NewUnstableSessionConfigOptionSelect constructs a UnstableSessionConfigOption using the 'select' variant.
func (UnstableSessionConfigOption) MarshalJSON ¶
func (u UnstableSessionConfigOption) MarshalJSON() ([]byte, error)
func (*UnstableSessionConfigOption) UnmarshalJSON ¶
func (u *UnstableSessionConfigOption) UnmarshalJSON(b []byte) error
func (*UnstableSessionConfigOption) Validate ¶
func (u *UnstableSessionConfigOption) Validate() error
type UnstableSessionConfigOptionBoolean ¶
type UnstableSessionConfigOptionBoolean struct {
// The _meta property is reserved by ACP to allow clients and agents to attach additional
// metadata to their interactions. Implementations MUST NOT make assumptions about values at
// these keys.
//
// See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
Meta map[string]any `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"`
}
**UNSTABLE**
This capability is not part of the spec yet, and may be removed or changed at any point.
Boolean on/off toggle.
type UnstableSessionConfigOptionSelect ¶
type UnstableSessionConfigOptionSelect struct {
// The _meta property is reserved by ACP to allow clients and agents to attach additional
// metadata to their interactions. Implementations MUST NOT make assumptions about values at
// these keys.
//
// See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
Meta map[string]any `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).
type UnstableSessionModelState ¶
type UnstableSessionModelState struct {
// The _meta property is reserved by ACP to allow clients and agents to attach additional
// metadata to their interactions. Implementations MUST NOT make assumptions about values at
// these keys.
//
// See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
Meta map[string]any `json:"_meta,omitempty"`
// The set of models that the Agent can use
AvailableModels []UnstableModelInfo `json:"availableModels"`
// The current model the Agent is in.
CurrentModelId UnstableModelId `json:"currentModelId"`
}
**UNSTABLE**
This capability is not part of the spec yet, and may be removed or changed at any point.
The set of models and the one currently active.
type UnstableSetProvidersRequest ¶
type UnstableSetProvidersRequest struct {
// The _meta property is reserved by ACP to allow clients and agents to attach additional
// metadata to their interactions. Implementations MUST NOT make assumptions about values at
// these keys.
//
// See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
Meta map[string]any `json:"_meta,omitempty"`
// Protocol type for this provider.
ApiType UnstableLlmProtocol `json:"apiType"`
// Base URL for requests sent through this provider.
BaseUrl string `json:"baseUrl"`
// Full headers map for this provider.
// May include authorization, routing, or other integration-specific headers.
Headers map[string]any `json:"headers,omitempty"`
// Provider id to configure.
Id string `json:"id"`
}
**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 (*UnstableSetProvidersRequest) Validate ¶
func (v *UnstableSetProvidersRequest) Validate() error
type UnstableSetProvidersResponse ¶
type UnstableSetProvidersResponse struct {
// The _meta property is reserved by ACP to allow clients and agents to attach additional
// metadata to their interactions. Implementations MUST NOT make assumptions about values at
// these keys.
//
// See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
Meta map[string]any `json:"_meta,omitempty"`
}
**UNSTABLE**
This capability is not part of the spec yet, and may be removed or changed at any point.
Response to 'providers/set'.
func (*UnstableSetProvidersResponse) Validate ¶
func (v *UnstableSetProvidersResponse) Validate() error
type UnstableSetSessionModelRequest ¶
type UnstableSetSessionModelRequest struct {
// The _meta property is reserved by ACP to allow clients and agents to attach additional
// metadata to their interactions. Implementations MUST NOT make assumptions about values at
// these keys.
//
// See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
Meta map[string]any `json:"_meta,omitempty"`
// The ID of the model to set.
ModelId UnstableModelId `json:"modelId"`
// The ID of the session to set the model for.
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 setting a session model.
func (*UnstableSetSessionModelRequest) Validate ¶
func (v *UnstableSetSessionModelRequest) Validate() error
type UnstableSetSessionModelResponse ¶
type UnstableSetSessionModelResponse struct {
// The _meta property is reserved by ACP to allow clients and agents to attach additional
// metadata to their interactions. Implementations MUST NOT make assumptions about values at
// these keys.
//
// See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
Meta map[string]any `json:"_meta,omitempty"`
}
**UNSTABLE**
This capability is not part of the spec yet, and may be removed or changed at any point.
Response to 'session/set_model' method.
func (*UnstableSetSessionModelResponse) Validate ¶
func (v *UnstableSetSessionModelResponse) Validate() error
type UnstableStartNesRequest ¶
type UnstableStartNesRequest struct {
// The _meta property is reserved by ACP to allow clients and agents to attach additional
// metadata to their interactions. Implementations MUST NOT make assumptions about values at
// these keys.
//
// See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
Meta map[string]any `json:"_meta,omitempty"`
// Repository metadata, if the workspace is a git repository.
Repository *UnstableNesRepository `json:"repository,omitempty"`
// The workspace folders.
WorkspaceFolders []UnstableWorkspaceFolder `json:"workspaceFolders,omitempty"`
// The root URI of the workspace.
WorkspaceUri *string `json:"workspaceUri,omitempty"`
}
Request to start an NES session.
func (*UnstableStartNesRequest) Validate ¶
func (v *UnstableStartNesRequest) Validate() error
type UnstableStartNesResponse ¶
type UnstableStartNesResponse struct {
// The _meta property is reserved by ACP to allow clients and agents to attach additional
// metadata to their interactions. Implementations MUST NOT make assumptions about values at
// these keys.
//
// See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
Meta map[string]any `json:"_meta,omitempty"`
// The session ID for the newly started NES session.
SessionId SessionId `json:"sessionId"`
}
Response to 'nes/start'.
func (*UnstableStartNesResponse) Validate ¶
func (v *UnstableStartNesResponse) Validate() error
type UnstableSuggestNesRequest ¶
type UnstableSuggestNesRequest struct {
// The _meta property is reserved by ACP to allow clients and agents to attach additional
// metadata to their interactions. Implementations MUST NOT make assumptions about values at
// these keys.
//
// See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
Meta map[string]any `json:"_meta,omitempty"`
// Context for the suggestion, included based on agent capabilities.
Context *UnstableNesSuggestContext `json:"context,omitempty"`
// The current cursor position.
Position UnstablePosition `json:"position"`
// The current text selection range, if any.
Selection *UnstableRange `json:"selection,omitempty"`
// The session ID for this request.
SessionId SessionId `json:"sessionId"`
// What triggered this suggestion request.
TriggerKind UnstableNesTriggerKind `json:"triggerKind"`
// The URI of the document to suggest for.
Uri string `json:"uri"`
// The version number of the document.
Version int `json:"version"`
}
Request for a code suggestion.
func (*UnstableSuggestNesRequest) Validate ¶
func (v *UnstableSuggestNesRequest) Validate() error
type UnstableSuggestNesResponse ¶
type UnstableSuggestNesResponse struct {
// The _meta property is reserved by ACP to allow clients and agents to attach additional
// metadata to their interactions. Implementations MUST NOT make assumptions about values at
// these keys.
//
// See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
Meta map[string]any `json:"_meta,omitempty"`
// The list of suggestions.
Suggestions []UnstableNesSuggestion `json:"suggestions"`
}
Response to 'nes/suggest'.
func (*UnstableSuggestNesResponse) Validate ¶
func (v *UnstableSuggestNesResponse) Validate() error
type UnstableTextDocumentContentChangeEvent ¶
type UnstableTextDocumentContentChangeEvent struct {
// The range of the document that changed. If 'None', the entire content is replaced.
Range *UnstableRange `json:"range,omitempty"`
// The new text for the range, or the full document content if 'range' is 'None'.
Text string `json:"text"`
}
A content change event for a document.
When 'range' is 'None', 'text' is the full content of the document. When 'range' is 'Some', 'text' replaces the given range.
type UnstableWorkspaceFolder ¶
type UnstableWorkspaceFolder struct {
// The display name of the folder.
Name string `json:"name"`
// The URI of the folder.
Uri string `json:"uri"`
}
A workspace folder.
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/extensibility)
Meta map[string]any `json:"_meta,omitempty"`
// A hint to display when the input hasn't been provided yet
Hint string `json:"hint"`
}
All text that was typed after the command name is provided as input.
type Usage ¶
type Usage struct {
// Total cache read tokens.
CachedReadTokens *int `json:"cachedReadTokens,omitempty"`
// Total cache write tokens.
CachedWriteTokens *int `json:"cachedWriteTokens,omitempty"`
// Total input tokens across all turns.
InputTokens int `json:"inputTokens"`
// Total output tokens across all turns.
OutputTokens int `json:"outputTokens"`
// Total thought/reasoning tokens
ThoughtTokens *int `json:"thoughtTokens,omitempty"`
// Sum of all token types across session.
TotalTokens int `json:"totalTokens"`
}
**UNSTABLE**
This capability is not part of the spec yet, and may be removed or changed at any point.
Token usage information for a prompt turn.
type UsageUpdate ¶
type UsageUpdate struct {
// The _meta property is reserved by ACP to allow clients and agents to attach additional
// metadata to their interactions. Implementations MUST NOT make assumptions about values at
// these keys.
//
// See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
Meta map[string]any `json:"_meta,omitempty"`
// Cumulative session cost (optional).
Cost *Cost `json:"cost,omitempty"`
// Total context window size in tokens.
Size int `json:"size"`
// Tokens currently in context.
Used int `json:"used"`
}
**UNSTABLE**
This capability is not part of the spec yet, and may be removed or changed at any point.
Context window and cost update for a session.
type WaitForTerminalExitRequest ¶
type WaitForTerminalExitRequest struct {
// The _meta property is reserved by ACP to allow clients and agents to attach additional
// metadata to their interactions. Implementations MUST NOT make assumptions about values at
// these keys.
//
// See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
Meta map[string]any `json:"_meta,omitempty"`
// The session ID for this request.
SessionId SessionId `json:"sessionId"`
// The ID of the terminal to wait for.
TerminalId string `json:"terminalId"`
}
Request to wait for a terminal command to exit.
func (*WaitForTerminalExitRequest) Validate ¶
func (v *WaitForTerminalExitRequest) Validate() error
type WaitForTerminalExitResponse ¶
type WaitForTerminalExitResponse struct {
// The _meta property is reserved by ACP to allow clients and agents to attach additional
// metadata to their interactions. Implementations MUST NOT make assumptions about values at
// these keys.
//
// See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
Meta map[string]any `json:"_meta,omitempty"`
// The process exit code (may be null if terminated by signal).
ExitCode *int `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) 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/extensibility)
Meta map[string]any `json:"_meta,omitempty"`
// The text content to write to the file.
Content string `json:"content"`
// Absolute path to the file to write.
Path string `json:"path"`
// The session ID for this request.
SessionId SessionId `json:"sessionId"`
}
Request to write content to a text file.
Only available if the client supports the 'fs.writeTextFile' capability.
func (*WriteTextFileRequest) Validate ¶
func (v *WriteTextFileRequest) Validate() error
type WriteTextFileResponse ¶
type WriteTextFileResponse struct {
// The _meta property is reserved by ACP to allow clients and agents to attach additional
// metadata to their interactions. Implementations MUST NOT make assumptions about values at
// these keys.
//
// See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
Meta map[string]any `json:"_meta,omitempty"`
}
Response to 'fs/write_text_file'
func (*WriteTextFileResponse) Validate ¶
func (v *WriteTextFileResponse) Validate() error