Versions in this module Expand all Collapse all v0 v0.2.0 Sep 5, 2026 Changes in this version type PromptResponse + Usage *Usage + func (r *PromptResponse) UnmarshalJSON(data []byte) error + type Usage struct + CachedReadTokens *uint64 + CachedWriteTokens *uint64 + InputTokens uint64 + Meta Meta + OutputTokens uint64 + ThoughtTokens *uint64 + TotalTokens uint64 + func (u *Usage) UnmarshalJSON(data []byte) error v0.1.0 Aug 12, 2026 Changes in this version + const MethodAuthenticate + const MethodCancelRequest + const MethodElicitationComplete + const MethodElicitationCreate + const MethodFSReadTextFile + const MethodFSWriteTextFile + const MethodInitialize + const MethodLogout + const MethodSessionCancel + const MethodSessionClose + const MethodSessionDelete + const MethodSessionList + const MethodSessionLoad + const MethodSessionNew + const MethodSessionPrompt + const MethodSessionRequestPermission + const MethodSessionResume + const MethodSessionSetConfigOption + const MethodSessionSetMode + const MethodSessionUpdate + const MethodTerminalCreate + const MethodTerminalKill + const MethodTerminalOutput + const MethodTerminalRelease + const MethodTerminalWaitForExit + var ErrBufferFull = errors.New("acp: buffered message limit exceeded") + var ErrClosed = errors.New("acp: connection closed") + var ErrFrameTooLarge = errors.New("acp: frame too large") + var ErrInvalidResponse = errors.New("acp: invalid response") + var ErrQueueFull = errors.New("acp: notification queue full") + var ErrTooManyRequests = errors.New("acp: too many concurrent requests") + type AgentAuthCapabilities struct + Logout *LogoutCapabilities + Meta Meta + func (c *AgentAuthCapabilities) UnmarshalJSON(data []byte) error + type AgentCaller struct + func (a *AgentCaller) Authenticate(ctx context.Context, req *AuthenticateRequest) (*AuthenticateResponse, error) + func (a *AgentCaller) Call(ctx context.Context, method string, params, result any) error + func (a *AgentCaller) Cancel(ctx context.Context, notification *CancelNotification) error + func (a *AgentCaller) CloseSession(ctx context.Context, req *CloseSessionRequest) (*CloseSessionResponse, error) + func (a *AgentCaller) DeleteSession(ctx context.Context, req *DeleteSessionRequest) (*DeleteSessionResponse, error) + func (a *AgentCaller) Initialize(ctx context.Context, req *InitializeRequest) (*InitializeResponse, error) + func (a *AgentCaller) ListSessions(ctx context.Context, req *ListSessionsRequest) (*ListSessionsResponse, error) + func (a *AgentCaller) LoadSession(ctx context.Context, req *LoadSessionRequest) (*LoadSessionResponse, error) + func (a *AgentCaller) Logout(ctx context.Context, req *LogoutRequest) (*LogoutResponse, error) + func (a *AgentCaller) NewSession(ctx context.Context, req *NewSessionRequest) (*NewSessionResponse, error) + func (a *AgentCaller) Notify(ctx context.Context, method string, params any) error + func (a *AgentCaller) Prompt(ctx context.Context, req *PromptRequest) (*PromptResponse, error) + func (a *AgentCaller) ResumeSession(ctx context.Context, req *ResumeSessionRequest) (*ResumeSessionResponse, error) + func (a *AgentCaller) SetSessionConfigOption(ctx context.Context, req *SetSessionConfigOptionRequest) (*SetSessionConfigOptionResponse, error) + func (a *AgentCaller) SetSessionMode(ctx context.Context, req *SetSessionModeRequest) (*SetSessionModeResponse, error) + type AgentCapabilities struct + Auth *AgentAuthCapabilities + LoadSession bool + MCPCapabilities *MCPCapabilities + Meta Meta + PromptCapabilities *PromptCapabilities + SessionCapabilities *SessionCapabilities + func (c *AgentCapabilities) UnmarshalJSON(data []byte) error + type AgentHandler interface + Cancel func(context.Context, *CancelNotification) error + Initialize func(context.Context, *InitializeRequest) (*InitializeResponse, error) + NewSession func(context.Context, *NewSessionRequest) (*NewSessionResponse, error) + Prompt func(context.Context, *PromptRequest) (*PromptResponse, error) + type Annotations struct + Audience *[]Role + LastModified *string + Meta Meta + Priority *float64 + func (a *Annotations) UnmarshalJSON(data []byte) error + type AudioContent struct + Annotations *Annotations + Data string + MIMEType string + Meta Meta + func (c *AudioContent) UnmarshalJSON(data []byte) error + type AuthMethod struct + Description *string + ID AuthMethodID + Meta Meta + Name string + func AgentAuthMethod(id AuthMethodID, name string) AuthMethod + func (m *AuthMethod) UnmarshalJSON(data []byte) error + type AuthMethodAgent struct + Description *string + ID AuthMethodID + Meta Meta + Name string + func (a *AuthMethodAgent) UnmarshalJSON(data []byte) error + type AuthMethodID string + type AuthenticateHandler interface + Authenticate func(context.Context, *AuthenticateRequest) (*AuthenticateResponse, error) + type AuthenticateRequest struct + Meta Meta + MethodID AuthMethodID + type AuthenticateResponse struct + Meta Meta + type AvailableCommand struct + Description string + Input *AvailableCommandInput + Meta Meta + Name string + func (c *AvailableCommand) UnmarshalJSON(data []byte) error + type AvailableCommandInput struct + Hint string + Meta Meta + func UnstructuredAvailableCommandInput(hint string) AvailableCommandInput + func (i *AvailableCommandInput) UnmarshalJSON(data []byte) error + type AvailableCommandsUpdate struct + AvailableCommands []AvailableCommand + Meta Meta + func (u *AvailableCommandsUpdate) UnmarshalJSON(data []byte) error + func (u AvailableCommandsUpdate) MarshalJSON() ([]byte, error) + type BlobResourceContents struct + Blob string + MIMEType *string + Meta Meta + URI string + func (c *BlobResourceContents) UnmarshalJSON(data []byte) error + type BooleanConfigOptionCapabilities struct + Meta Meta + type BooleanPropertySchema struct + Default *bool + Description *string + Meta Meta + Title *string + func (s *BooleanPropertySchema) UnmarshalJSON(data []byte) error + type CancelNotification struct + Meta Meta + SessionID SessionID + type CancelRequestNotification struct + Meta Meta + RequestID RequestID + type ClientCaller struct + func (c *ClientCaller) Call(ctx context.Context, method string, params, result any) error + func (c *ClientCaller) CompleteElicitation(ctx context.Context, notification *CompleteElicitationNotification) error + func (c *ClientCaller) CreateElicitation(ctx context.Context, req *CreateElicitationRequest) (*CreateElicitationResponse, error) + func (c *ClientCaller) CreateTerminal(ctx context.Context, req *CreateTerminalRequest) (*CreateTerminalResponse, error) + func (c *ClientCaller) KillTerminal(ctx context.Context, req *KillTerminalRequest) (*KillTerminalResponse, error) + func (c *ClientCaller) Notify(ctx context.Context, method string, params any) error + func (c *ClientCaller) ReadTextFile(ctx context.Context, req *ReadTextFileRequest) (*ReadTextFileResponse, error) + func (c *ClientCaller) ReleaseTerminal(ctx context.Context, req *ReleaseTerminalRequest) (*ReleaseTerminalResponse, error) + func (c *ClientCaller) RequestPermission(ctx context.Context, req *RequestPermissionRequest) (*RequestPermissionResponse, error) + func (c *ClientCaller) TerminalOutput(ctx context.Context, req *TerminalOutputRequest) (*TerminalOutputResponse, error) + func (c *ClientCaller) Update(ctx context.Context, notification *SessionNotification) error + func (c *ClientCaller) WaitForTerminalExit(ctx context.Context, req *WaitForTerminalExitRequest) (*WaitForTerminalExitResponse, error) + func (c *ClientCaller) WriteTextFile(ctx context.Context, req *WriteTextFileRequest) (*WriteTextFileResponse, error) + type ClientCapabilities struct + Elicitation *ElicitationCapabilities + Fs *FileSystemCapabilities + Meta Meta + Session *ClientSessionCapabilities + Terminal bool + func (c *ClientCapabilities) UnmarshalJSON(data []byte) error + type ClientHandler interface + RequestPermission func(context.Context, *RequestPermissionRequest) (*RequestPermissionResponse, error) + Update func(context.Context, *SessionNotification) error + type ClientSessionCapabilities struct + ConfigOptions *SessionConfigOptionsCapabilities + Meta Meta + func (c *ClientSessionCapabilities) UnmarshalJSON(data []byte) error + type CloseSessionHandler interface + CloseSession func(context.Context, *CloseSessionRequest) (*CloseSessionResponse, error) + type CloseSessionRequest struct + Meta Meta + SessionID SessionID + type CloseSessionResponse struct + Meta Meta + type CompleteElicitationHandler interface + CompleteElicitation func(context.Context, *CompleteElicitationNotification) error + type CompleteElicitationNotification struct + ElicitationID ElicitationID + Meta Meta + func (n *CompleteElicitationNotification) UnmarshalJSON(data []byte) error + type ConfigOptionUpdate struct + ConfigOptions []SessionConfigOption + Meta Meta + func (u *ConfigOptionUpdate) UnmarshalJSON(data []byte) error + func (u ConfigOptionUpdate) MarshalJSON() ([]byte, error) + type Conn struct + func New(input io.ReadCloser, output io.Writer, handler Handler, opts ...Option) (*Conn, error) + func NewAgent(input io.ReadCloser, output io.Writer, ...) (*Conn, error) + func NewClient(input io.ReadCloser, output io.Writer, ...) (*Conn, error) + func (c *Conn) Call(ctx context.Context, method string, params, result any) error + func (c *Conn) Close() error + func (c *Conn) Done() <-chan struct{} + func (c *Conn) Err() error + func (c *Conn) Notify(ctx context.Context, method string, params any) error + type Content struct + Content ContentBlock + Meta Meta + type ContentBlock struct + Annotations *Annotations + Data string + Description *string + MIMEType *string + Meta Meta + Name string + Resource EmbeddedResourceContents + Size *int64 + Text string + Title *string + Type ContentBlockType + URI *string + func AudioContentBlock(data string, mimeType string) ContentBlock + func ImageContentBlock(data string, mimeType string) ContentBlock + func ResourceContentBlock(resource EmbeddedResourceContents) ContentBlock + func ResourceLinkContentBlock(name string, uri string) ContentBlock + func TextContentBlock(text string) ContentBlock + func (b *ContentBlock) UnmarshalJSON(data []byte) error + func (b ContentBlock) MarshalJSON() ([]byte, error) + type ContentBlockType string + const ContentBlockTypeAudio + const ContentBlockTypeImage + const ContentBlockTypeResource + const ContentBlockTypeResourceLink + const ContentBlockTypeText + func (t *ContentBlockType) UnmarshalJSON(data []byte) error + type ContentChunk struct + Content ContentBlock + MessageID *MessageID + Meta Meta + func (c *ContentChunk) UnmarshalJSON(data []byte) error + type Cost struct + Amount float64 + Currency string + Meta Meta + func (c *Cost) UnmarshalJSON(data []byte) error + type CreateElicitationHandler interface + CreateElicitation func(context.Context, *CreateElicitationRequest) (*CreateElicitationResponse, error) + type CreateElicitationRequest struct + ElicitationID ElicitationID + Fields map[string]json.RawMessage + Message string + Meta Meta + Mode CreateElicitationRequestType + RequestID RequestID + RequestedSchema ElicitationSchema + SessionID SessionID + ToolCallID *ToolCallID + URL string + func RequestFormCreateElicitationRequest(message string, requestedSchema ElicitationSchema, requestID RequestID) CreateElicitationRequest + func RequestOtherCreateElicitationRequest(message string, mode string, requestID RequestID, ...) CreateElicitationRequest + func RequestURLCreateElicitationRequest(message string, elicitationID ElicitationID, url string, requestID RequestID) CreateElicitationRequest + func SessionFormCreateElicitationRequest(message string, requestedSchema ElicitationSchema, sessionID SessionID) CreateElicitationRequest + func SessionOtherCreateElicitationRequest(message string, mode string, sessionID SessionID, ...) CreateElicitationRequest + func SessionURLCreateElicitationRequest(message string, elicitationID ElicitationID, url string, sessionID SessionID) CreateElicitationRequest + func (r *CreateElicitationRequest) UnmarshalJSON(data []byte) error + func (r CreateElicitationRequest) MarshalJSON() ([]byte, error) + type CreateElicitationRequestType string + const CreateElicitationRequestTypeForm + const CreateElicitationRequestTypeURL + type CreateElicitationResponse struct + Action CreateElicitationResponseType + Content *map[string]ElicitationContentValue + Fields map[string]json.RawMessage + Meta Meta + func AcceptCreateElicitationResponse() CreateElicitationResponse + func CancelCreateElicitationResponse() CreateElicitationResponse + func DeclineCreateElicitationResponse() CreateElicitationResponse + func OtherCreateElicitationResponse(action string, fields map[string]json.RawMessage) CreateElicitationResponse + func (r *CreateElicitationResponse) UnmarshalJSON(data []byte) error + func (r CreateElicitationResponse) MarshalJSON() ([]byte, error) + type CreateElicitationResponseType string + const CreateElicitationResponseTypeAccept + const CreateElicitationResponseTypeCancel + const CreateElicitationResponseTypeDecline + type CreateTerminalRequest struct + Args []string + Command string + Cwd *string + Env []EnvVariable + Meta Meta + OutputByteLimit *uint64 + SessionID SessionID + func (r *CreateTerminalRequest) UnmarshalJSON(data []byte) error + type CreateTerminalResponse struct + Meta Meta + TerminalID TerminalID + type CurrentModeUpdate struct + CurrentModeID SessionModeID + Meta Meta + type DeleteSessionHandler interface + DeleteSession func(context.Context, *DeleteSessionRequest) (*DeleteSessionResponse, error) + type DeleteSessionRequest struct + Meta Meta + SessionID SessionID + type DeleteSessionResponse struct + Meta Meta + type Diff struct + Meta Meta + NewText string + OldText *string + Path string + func (d *Diff) UnmarshalJSON(data []byte) error + type ElicitationAcceptAction struct + Content *map[string]ElicitationContentValue + type ElicitationCapabilities struct + Form *ElicitationFormCapabilities + Meta Meta + URL *ElicitationURLCapabilities + func (c *ElicitationCapabilities) SupportsForm() bool + func (c *ElicitationCapabilities) SupportsURL() bool + func (c *ElicitationCapabilities) UnmarshalJSON(data []byte) error + type ElicitationContentValue json.RawMessage + func NewElicitationContentValue(value any) (ElicitationContentValue, error) + func (v *ElicitationContentValue) UnmarshalJSON(data []byte) error + func (v ElicitationContentValue) MarshalJSON() ([]byte, error) + type ElicitationFormCapabilities struct + Meta Meta + type ElicitationFormMode struct + RequestID *RequestID + RequestedSchema ElicitationSchema + SessionID *SessionID + ToolCallID *ToolCallID + func RequestElicitationFormMode(requestedSchema ElicitationSchema, requestID RequestID) ElicitationFormMode + func SessionElicitationFormMode(requestedSchema ElicitationSchema, sessionID SessionID) ElicitationFormMode + func (m *ElicitationFormMode) UnmarshalJSON(data []byte) error + type ElicitationID string + type ElicitationPropertySchema struct + Default any + Description *string + Enum *[]string + Fields map[string]json.RawMessage + Format *StringFormat + Items MultiSelectItems + MaxItems *uint64 + MaxLength *uint32 + Maximum any + Meta Meta + MinItems *uint64 + MinLength *uint32 + Minimum any + OneOf *[]EnumOption + Pattern *string + Title *string + Type ElicitationPropertySchemaType + func ArrayElicitationPropertySchema(items MultiSelectItems) ElicitationPropertySchema + func BooleanElicitationPropertySchema() ElicitationPropertySchema + func IntegerElicitationPropertySchema() ElicitationPropertySchema + func NumberElicitationPropertySchema() ElicitationPropertySchema + func OtherElicitationPropertySchema(typeName string, fields map[string]json.RawMessage) ElicitationPropertySchema + func StringElicitationPropertySchema() ElicitationPropertySchema + func (s *ElicitationPropertySchema) UnmarshalJSON(data []byte) error + func (s ElicitationPropertySchema) MarshalJSON() ([]byte, error) + type ElicitationPropertySchemaType string + const ElicitationPropertySchemaTypeArray + const ElicitationPropertySchemaTypeBoolean + const ElicitationPropertySchemaTypeInteger + const ElicitationPropertySchemaTypeNumber + const ElicitationPropertySchemaTypeString + type ElicitationRequestScope struct + RequestID RequestID + func (s *ElicitationRequestScope) UnmarshalJSON(data []byte) error + type ElicitationSchema struct + Description *string + Meta Meta + Properties map[string]ElicitationPropertySchema + Required *[]string + Title *string + Type ElicitationSchemaType + func (s *ElicitationSchema) UnmarshalJSON(data []byte) error + func (s ElicitationSchema) MarshalJSON() ([]byte, error) + type ElicitationSchemaType string + const ElicitationSchemaTypeObject + type ElicitationSessionScope struct + SessionID SessionID + ToolCallID *ToolCallID + func (s *ElicitationSessionScope) UnmarshalJSON(data []byte) error + type ElicitationURLCapabilities struct + Meta Meta + type ElicitationURLMode struct + ElicitationID ElicitationID + RequestID *RequestID + SessionID *SessionID + ToolCallID *ToolCallID + URL string + func RequestElicitationURLMode(elicitationID ElicitationID, url string, requestID RequestID) ElicitationURLMode + func SessionElicitationURLMode(elicitationID ElicitationID, url string, sessionID SessionID) ElicitationURLMode + func (m *ElicitationURLMode) UnmarshalJSON(data []byte) error + type EmbeddedResource struct + Annotations *Annotations + Meta Meta + Resource EmbeddedResourceContents + func (r *EmbeddedResource) UnmarshalJSON(data []byte) error + type EmbeddedResourceContents struct + Blob *string + MIMEType *string + Meta Meta + Text *string + URI string + func BlobEmbeddedResourceContents(blob string, uri string) EmbeddedResourceContents + func TextEmbeddedResourceContents(text string, uri string) EmbeddedResourceContents + func (r *EmbeddedResourceContents) UnmarshalJSON(data []byte) error + type EnumOption struct + Const string + Description *string + Meta Meta + Title string + func (o *EnumOption) UnmarshalJSON(data []byte) error + type EnvVariable struct + Meta Meta + Name string + Value string + func (e *EnvVariable) UnmarshalJSON(data []byte) error + type Error struct + Code ErrorCode + Data any + Message string + func (e *Error) Error() string + func (e *Error) UnmarshalJSON(data []byte) error + type ErrorCode int32 + const ErrorCodeAuthenticationRequired + const ErrorCodeInternalError + const ErrorCodeInvalidParams + const ErrorCodeInvalidRequest + const ErrorCodeMethodNotFound + const ErrorCodeParseError + const ErrorCodeRequestCanceled + const ErrorCodeResourceNotFound + type ExtNotification any + type ExtRequest any + type ExtResponse any + type ExtensionNotificationHandler interface + HandleNotification func(context.Context, string, json.RawMessage) error + type ExtensionRequestHandler interface + HandleRequest func(context.Context, string, json.RawMessage) (any, error) + type FileSystemCapabilities struct + Meta Meta + ReadTextFile bool + WriteTextFile bool + func (c *FileSystemCapabilities) UnmarshalJSON(data []byte) error + type GroupedSessionConfigSelectOptions []SessionConfigSelectGroup + type HTTPHeader struct + Meta Meta + Name string + Value string + func (h *HTTPHeader) UnmarshalJSON(data []byte) error + type Handler func(context.Context, string, json.RawMessage) (any, error) + type ImageContent struct + Annotations *Annotations + Data string + MIMEType string + Meta Meta + URI *string + func (c *ImageContent) UnmarshalJSON(data []byte) error + type Implementation struct + Meta Meta + Name string + Title *string + Version string + func (i *Implementation) UnmarshalJSON(data []byte) error + type InitializeRequest struct + ClientCapabilities *ClientCapabilities + ClientInfo *Implementation + Meta Meta + ProtocolVersion ProtocolVersion + func (r *InitializeRequest) UnmarshalJSON(data []byte) error + type InitializeResponse struct + AgentCapabilities *AgentCapabilities + AgentInfo *Implementation + AuthMethods []AuthMethod + Meta Meta + ProtocolVersion ProtocolVersion + func (r *InitializeResponse) UnmarshalJSON(data []byte) error + type IntegerPropertySchema struct + Default *int64 + Description *string + Maximum *int64 + Meta Meta + Minimum *int64 + Title *string + func (s *IntegerPropertySchema) UnmarshalJSON(data []byte) error + type KillTerminalRequest struct + Meta Meta + SessionID SessionID + TerminalID TerminalID + type KillTerminalResponse struct + Meta Meta + type ListSessionsHandler interface + ListSessions func(context.Context, *ListSessionsRequest) (*ListSessionsResponse, error) + type ListSessionsRequest struct + Cursor *string + Cwd *string + Meta Meta + type ListSessionsResponse struct + Meta Meta + NextCursor *string + Sessions []SessionInfo + func (r *ListSessionsResponse) UnmarshalJSON(data []byte) error + func (r ListSessionsResponse) MarshalJSON() ([]byte, error) + type LoadSessionHandler interface + LoadSession func(context.Context, *LoadSessionRequest) (*LoadSessionResponse, error) + type LoadSessionRequest struct + AdditionalDirectories []string + Cwd string + MCPServers []MCPServer + Meta Meta + SessionID SessionID + func (r *LoadSessionRequest) UnmarshalJSON(data []byte) error + func (r LoadSessionRequest) MarshalJSON() ([]byte, error) + type LoadSessionResponse struct + ConfigOptions *[]SessionConfigOption + Meta Meta + Modes *SessionModeState + func (r *LoadSessionResponse) UnmarshalJSON(data []byte) error + type LogoutCapabilities struct + Meta Meta + type LogoutHandler interface + Logout func(context.Context, *LogoutRequest) (*LogoutResponse, error) + type LogoutRequest struct + Meta Meta + type LogoutResponse struct + Meta Meta + type MCPCapabilities struct + HTTP bool + Meta Meta + SSE bool + func (c *MCPCapabilities) UnmarshalJSON(data []byte) error + type MCPServer struct + Args []string + Command string + Env []EnvVariable + Headers []HTTPHeader + Meta Meta + Name string + Type MCPServerType + URL string + func HTTPMCPServer(name string, url string, headers []HTTPHeader) MCPServer + func SSEMCPServer(name string, url string, headers []HTTPHeader) MCPServer + func StdioMCPServer(name string, command string, args []string, env []EnvVariable) MCPServer + func (s *MCPServer) UnmarshalJSON(data []byte) error + func (s MCPServer) MarshalJSON() ([]byte, error) + type MCPServerHTTP struct + Headers []HTTPHeader + Meta Meta + Name string + URL string + func (h MCPServerHTTP) MarshalJSON() ([]byte, error) + type MCPServerSSE struct + Headers []HTTPHeader + Meta Meta + Name string + URL string + func (s MCPServerSSE) MarshalJSON() ([]byte, error) + type MCPServerStdio struct + Args []string + Command string + Env []EnvVariable + Meta Meta + Name string + func (s MCPServerStdio) MarshalJSON() ([]byte, error) + type MCPServerType string + const MCPServerTypeHTTP + const MCPServerTypeSSE + func (t *MCPServerType) UnmarshalJSON(data []byte) error + type MessageID string + type Meta map[string]any + func (m *Meta) UnmarshalJSON(data []byte) error + type MultiSelectItems struct + AnyOf []EnumOption + Enum []string + Fields map[string]json.RawMessage + Meta Meta + Type MultiSelectItemsType + func NewStringMultiSelectItems(enum []string) MultiSelectItems + func NewTitledMultiSelectItems(anyOf []EnumOption) MultiSelectItems + func OtherMultiSelectItems(typeName string, fields map[string]json.RawMessage) MultiSelectItems + func (i *MultiSelectItems) UnmarshalJSON(data []byte) error + func (i MultiSelectItems) MarshalJSON() ([]byte, error) + type MultiSelectItemsType string + const MultiSelectItemsTypeString + type MultiSelectPropertySchema struct + Default *[]string + Description *string + Items MultiSelectItems + MaxItems *uint64 + Meta Meta + MinItems *uint64 + Title *string + func (s *MultiSelectPropertySchema) UnmarshalJSON(data []byte) error + type NewSessionRequest struct + AdditionalDirectories []string + Cwd string + MCPServers []MCPServer + Meta Meta + func (r *NewSessionRequest) UnmarshalJSON(data []byte) error + func (r NewSessionRequest) MarshalJSON() ([]byte, error) + type NewSessionResponse struct + ConfigOptions *[]SessionConfigOption + Meta Meta + Modes *SessionModeState + SessionID SessionID + func (r *NewSessionResponse) UnmarshalJSON(data []byte) error + type NumberPropertySchema struct + Default *float64 + Description *string + Maximum *float64 + Meta Meta + Minimum *float64 + Title *string + func (s *NumberPropertySchema) UnmarshalJSON(data []byte) error + type Option func(*connConfig) error + func WithLogger(logger *slog.Logger) Option + func WithMaxBufferedBytes(n int) Option + func WithMaxConcurrentRequests(n int) Option + func WithMaxFrameBytes(n int) Option + func WithNotificationBacklog(n int) Option + type PermissionOption struct + Kind PermissionOptionKind + Meta Meta + Name string + OptionID PermissionOptionID + func (o *PermissionOption) UnmarshalJSON(data []byte) error + type PermissionOptionID string + type PermissionOptionKind string + const PermissionOptionKindAllowAlways + const PermissionOptionKindAllowOnce + const PermissionOptionKindRejectAlways + const PermissionOptionKindRejectOnce + func (k *PermissionOptionKind) UnmarshalJSON(data []byte) error + type Plan struct + Entries []PlanEntry + Meta Meta + func (p *Plan) UnmarshalJSON(data []byte) error + func (p Plan) MarshalJSON() ([]byte, error) + type PlanEntry struct + Content string + Meta Meta + Priority PlanEntryPriority + Status PlanEntryStatus + func (e *PlanEntry) UnmarshalJSON(data []byte) error + type PlanEntryPriority string + const PlanEntryPriorityHigh + const PlanEntryPriorityLow + const PlanEntryPriorityMedium + func (p *PlanEntryPriority) UnmarshalJSON(data []byte) error + type PlanEntryStatus string + const PlanEntryStatusCompleted + const PlanEntryStatusInProgress + const PlanEntryStatusPending + func (s *PlanEntryStatus) UnmarshalJSON(data []byte) error + type PromptCapabilities struct + Audio bool + EmbeddedContext bool + Image bool + Meta Meta + func (c *PromptCapabilities) UnmarshalJSON(data []byte) error + type PromptRequest struct + Meta Meta + Prompt []ContentBlock + SessionID SessionID + func (r PromptRequest) MarshalJSON() ([]byte, error) + type PromptResponse struct + Meta Meta + StopReason StopReason + type ProtocolVersion uint16 + const ProtocolVersionV1 + type ReadTextFileHandler interface + ReadTextFile func(context.Context, *ReadTextFileRequest) (*ReadTextFileResponse, error) + type ReadTextFileRequest struct + Limit *uint32 + Line *uint32 + Meta Meta + Path string + SessionID SessionID + func (r *ReadTextFileRequest) UnmarshalJSON(data []byte) error + type ReadTextFileResponse struct + Content string + Meta Meta + type ReleaseTerminalRequest struct + Meta Meta + SessionID SessionID + TerminalID TerminalID + type ReleaseTerminalResponse struct + Meta Meta + type RequestID = json.RawMessage + type RequestPermissionOutcome struct + Meta Meta + OptionID PermissionOptionID + Outcome RequestPermissionOutcomeType + func CanceledRequestPermissionOutcome() RequestPermissionOutcome + func SelectedRequestPermissionOutcome(optionID PermissionOptionID) RequestPermissionOutcome + func (o *RequestPermissionOutcome) UnmarshalJSON(data []byte) error + func (o RequestPermissionOutcome) MarshalJSON() ([]byte, error) + type RequestPermissionOutcomeType string + const RequestPermissionOutcomeTypeCanceled + const RequestPermissionOutcomeTypeSelected + func (t *RequestPermissionOutcomeType) UnmarshalJSON(data []byte) error + type RequestPermissionRequest struct + Meta Meta + Options []PermissionOption + SessionID SessionID + ToolCall ToolCallUpdate + func (r RequestPermissionRequest) MarshalJSON() ([]byte, error) + type RequestPermissionResponse struct + Meta Meta + Outcome RequestPermissionOutcome + type ResourceLink struct + Annotations *Annotations + Description *string + MIMEType *string + Meta Meta + Name string + Size *int64 + Title *string + URI string + func (l *ResourceLink) UnmarshalJSON(data []byte) error + type ResumeSessionHandler interface + ResumeSession func(context.Context, *ResumeSessionRequest) (*ResumeSessionResponse, error) + type ResumeSessionRequest struct + AdditionalDirectories []string + Cwd string + MCPServers []MCPServer + Meta Meta + SessionID SessionID + func (r *ResumeSessionRequest) UnmarshalJSON(data []byte) error + type ResumeSessionResponse struct + ConfigOptions *[]SessionConfigOption + Meta Meta + Modes *SessionModeState + func (r *ResumeSessionResponse) UnmarshalJSON(data []byte) error + type Role string + const RoleAssistant + const RoleUser + func (r *Role) UnmarshalJSON(data []byte) error + type SelectedPermissionOutcome struct + Meta Meta + OptionID PermissionOptionID + type SessionAdditionalDirectoriesCapabilities struct + Meta Meta + type SessionCapabilities struct + AdditionalDirectories *SessionAdditionalDirectoriesCapabilities + Close *SessionCloseCapabilities + Delete *SessionDeleteCapabilities + List *SessionListCapabilities + Meta Meta + Resume *SessionResumeCapabilities + func (c *SessionCapabilities) UnmarshalJSON(data []byte) error + type SessionCloseCapabilities struct + Meta Meta + type SessionConfigBoolean struct + CurrentValue bool + type SessionConfigGroupID string + type SessionConfigID string + type SessionConfigOption struct + Category *SessionConfigOptionCategory + CurrentValue any + Description *string + ID SessionConfigID + Meta Meta + Name string + Options SessionConfigSelectOptions + Type SessionConfigOptionType + func BooleanSessionConfigOption(id SessionConfigID, name string, currentValue bool) SessionConfigOption + func SelectSessionConfigOption(id SessionConfigID, name string, currentValue SessionConfigValueID, ...) SessionConfigOption + func (o *SessionConfigOption) UnmarshalJSON(data []byte) error + func (o SessionConfigOption) MarshalJSON() ([]byte, error) + type SessionConfigOptionCategory string + const SessionConfigOptionCategoryMode + const SessionConfigOptionCategoryModel + const SessionConfigOptionCategoryModelConfig + const SessionConfigOptionCategoryThoughtLevel + type SessionConfigOptionType string + const SessionConfigOptionTypeBoolean + const SessionConfigOptionTypeSelect + func (t *SessionConfigOptionType) UnmarshalJSON(data []byte) error + type SessionConfigOptionsCapabilities struct + Boolean *BooleanConfigOptionCapabilities + Meta Meta + func (c *SessionConfigOptionsCapabilities) UnmarshalJSON(data []byte) error + type SessionConfigSelect struct + CurrentValue SessionConfigValueID + Options SessionConfigSelectOptions + func (s SessionConfigSelect) MarshalJSON() ([]byte, error) + type SessionConfigSelectGroup struct + Group SessionConfigGroupID + Meta Meta + Name string + Options []SessionConfigSelectOption + func (g *SessionConfigSelectGroup) UnmarshalJSON(data []byte) error + func (g SessionConfigSelectGroup) MarshalJSON() ([]byte, error) + type SessionConfigSelectOption struct + Description *string + Meta Meta + Name string + Value SessionConfigValueID + func (o *SessionConfigSelectOption) UnmarshalJSON(data []byte) error + type SessionConfigSelectOptions struct + Groups *GroupedSessionConfigSelectOptions + Ungrouped *UngroupedSessionConfigSelectOptions + func (o *SessionConfigSelectOptions) UnmarshalJSON(data []byte) error + func (o SessionConfigSelectOptions) MarshalJSON() ([]byte, error) + type SessionConfigValueID string + type SessionDeleteCapabilities struct + Meta Meta + type SessionID string + type SessionInfo struct + AdditionalDirectories []string + Cwd string + Meta Meta + SessionID SessionID + Title *string + UpdatedAt *string + func (i *SessionInfo) UnmarshalJSON(data []byte) error + type SessionInfoUpdate struct + Meta Meta + Title *string + UpdatedAt *string + func (u *SessionInfoUpdate) UnmarshalJSON(data []byte) error + type SessionListCapabilities struct + Meta Meta + type SessionMode struct + Description *string + ID SessionModeID + Meta Meta + Name string + func (m *SessionMode) UnmarshalJSON(data []byte) error + type SessionModeID string + type SessionModeState struct + AvailableModes []SessionMode + CurrentModeID SessionModeID + Meta Meta + func (s *SessionModeState) UnmarshalJSON(data []byte) error + func (s SessionModeState) MarshalJSON() ([]byte, error) + type SessionNotification struct + Meta Meta + SessionID SessionID + Update SessionUpdate + type SessionResumeCapabilities struct + Meta Meta + type SessionUpdate struct + AvailableCommands []AvailableCommand + ConfigOptions []SessionConfigOption + Content any + Cost *Cost + CurrentModeID SessionModeID + Entries []PlanEntry + Kind *ToolKind + Locations *[]ToolCallLocation + MessageID *MessageID + Meta Meta + RawInput any + RawOutput any + SessionUpdate SessionUpdateType + Size uint64 + Status *ToolCallStatus + Title *string + ToolCallID ToolCallID + UpdatedAt *string + Used uint64 + func AgentMessageChunkSessionUpdate(content ContentBlock) SessionUpdate + func AgentThoughtChunkSessionUpdate(content ContentBlock) SessionUpdate + func AvailableCommandsUpdateSessionUpdate(availableCommands []AvailableCommand) SessionUpdate + func ConfigOptionUpdateSessionUpdate(configOptions []SessionConfigOption) SessionUpdate + func CurrentModeUpdateSessionUpdate(currentModeID SessionModeID) SessionUpdate + func PlanSessionUpdate(entries []PlanEntry) SessionUpdate + func SessionInfoSessionUpdate() SessionUpdate + func ToolCallSessionUpdate(toolCallID ToolCallID, title string) SessionUpdate + func ToolCallUpdateSessionUpdate(toolCallID ToolCallID) SessionUpdate + func UsageUpdateSessionUpdate(used uint64, size uint64) SessionUpdate + func UserMessageChunkSessionUpdate(content ContentBlock) SessionUpdate + func (u *SessionUpdate) UnmarshalJSON(data []byte) error + func (u SessionUpdate) MarshalJSON() ([]byte, error) + type SessionUpdateType string + const SessionUpdateTypeAgentMessageChunk + const SessionUpdateTypeAgentThoughtChunk + const SessionUpdateTypeAvailableCommandsUpdate + const SessionUpdateTypeConfigOptionUpdate + const SessionUpdateTypeCurrentModeUpdate + const SessionUpdateTypePlan + const SessionUpdateTypeSessionInfoUpdate + const SessionUpdateTypeToolCall + const SessionUpdateTypeToolCallUpdate + const SessionUpdateTypeUsageUpdate + const SessionUpdateTypeUserMessageChunk + func (t *SessionUpdateType) UnmarshalJSON(data []byte) error + type SetSessionConfigOptionHandler interface + SetSessionConfigOption func(context.Context, *SetSessionConfigOptionRequest) (*SetSessionConfigOptionResponse, error) + type SetSessionConfigOptionRequest struct + ConfigID SessionConfigID + Meta Meta + SessionID SessionID + Type SetSessionConfigOptionRequestType + Value any + func BooleanSetSessionConfigOptionRequest(sessionID SessionID, configID SessionConfigID, value bool) SetSessionConfigOptionRequest + func ValueIDSetSessionConfigOptionRequest(sessionID SessionID, configID SessionConfigID, value SessionConfigValueID) SetSessionConfigOptionRequest + func (r *SetSessionConfigOptionRequest) UnmarshalJSON(data []byte) error + type SetSessionConfigOptionRequestType string + const SetSessionConfigOptionRequestTypeBoolean + type SetSessionConfigOptionResponse struct + ConfigOptions []SessionConfigOption + Meta Meta + func (r *SetSessionConfigOptionResponse) UnmarshalJSON(data []byte) error + func (r SetSessionConfigOptionResponse) MarshalJSON() ([]byte, error) + type SetSessionModeHandler interface + SetSessionMode func(context.Context, *SetSessionModeRequest) (*SetSessionModeResponse, error) + type SetSessionModeRequest struct + Meta Meta + ModeID SessionModeID + SessionID SessionID + type SetSessionModeResponse struct + Meta Meta + type StopReason string + const StopReasonCanceled + const StopReasonEndTurn + const StopReasonMaxTokens + const StopReasonMaxTurnRequests + const StopReasonRefusal + func (r *StopReason) UnmarshalJSON(data []byte) error + type StringFormat string + const StringFormatDate + const StringFormatDateTime + const StringFormatEmail + const StringFormatURI + func (f *StringFormat) UnmarshalJSON(data []byte) error + type StringMultiSelectItems struct + Enum []string + Meta Meta + func (i *StringMultiSelectItems) UnmarshalJSON(data []byte) error + func (i StringMultiSelectItems) MarshalJSON() ([]byte, error) + type StringPropertySchema struct + Default *string + Description *string + Enum *[]string + Format *StringFormat + MaxLength *uint32 + Meta Meta + MinLength *uint32 + OneOf *[]EnumOption + Pattern *string + Title *string + func (s *StringPropertySchema) UnmarshalJSON(data []byte) error + type Terminal struct + Meta Meta + TerminalID TerminalID + type TerminalExitStatus struct + ExitCode *uint32 + Meta Meta + Signal *string + func (s *TerminalExitStatus) UnmarshalJSON(data []byte) error + type TerminalHandler interface + CreateTerminal func(context.Context, *CreateTerminalRequest) (*CreateTerminalResponse, error) + KillTerminal func(context.Context, *KillTerminalRequest) (*KillTerminalResponse, error) + ReleaseTerminal func(context.Context, *ReleaseTerminalRequest) (*ReleaseTerminalResponse, error) + TerminalOutput func(context.Context, *TerminalOutputRequest) (*TerminalOutputResponse, error) + WaitForTerminalExit func(context.Context, *WaitForTerminalExitRequest) (*WaitForTerminalExitResponse, error) + type TerminalID string + type TerminalOutputRequest struct + Meta Meta + SessionID SessionID + TerminalID TerminalID + type TerminalOutputResponse struct + ExitStatus *TerminalExitStatus + Meta Meta + Output string + Truncated bool + func (r *TerminalOutputResponse) UnmarshalJSON(data []byte) error + type TextContent struct + Annotations *Annotations + Meta Meta + Text string + func (c *TextContent) UnmarshalJSON(data []byte) error + type TextResourceContents struct + MIMEType *string + Meta Meta + Text string + URI string + func (c *TextResourceContents) UnmarshalJSON(data []byte) error + type TitledMultiSelectItems struct + AnyOf []EnumOption + Meta Meta + func (i *TitledMultiSelectItems) UnmarshalJSON(data []byte) error + func (i TitledMultiSelectItems) MarshalJSON() ([]byte, error) + type ToolCall struct + Content []ToolCallContent + Kind ToolKind + Locations []ToolCallLocation + Meta Meta + RawInput any + RawOutput any + Status ToolCallStatus + Title string + ToolCallID ToolCallID + func (c *ToolCall) UnmarshalJSON(data []byte) error + type ToolCallContent struct + Content ContentBlock + Meta Meta + NewText string + OldText *string + Path string + TerminalID TerminalID + Type ToolCallContentType + func ContentToolCallContent(content ContentBlock) ToolCallContent + func DiffToolCallContent(path string, newText string) ToolCallContent + func TerminalToolCallContent(terminalID TerminalID) ToolCallContent + func (c *ToolCallContent) UnmarshalJSON(data []byte) error + func (c ToolCallContent) MarshalJSON() ([]byte, error) + type ToolCallContentType string + const ToolCallContentTypeContent + const ToolCallContentTypeDiff + const ToolCallContentTypeTerminal + func (t *ToolCallContentType) UnmarshalJSON(data []byte) error + type ToolCallID string + type ToolCallLocation struct + Line *uint32 + Meta Meta + Path string + func (l *ToolCallLocation) UnmarshalJSON(data []byte) error + type ToolCallStatus string + const ToolCallStatusCompleted + const ToolCallStatusFailed + const ToolCallStatusInProgress + const ToolCallStatusPending + func (s *ToolCallStatus) UnmarshalJSON(data []byte) error + type ToolCallUpdate struct + Content *[]ToolCallContent + Kind *ToolKind + Locations *[]ToolCallLocation + Meta Meta + RawInput any + RawOutput any + Status *ToolCallStatus + Title *string + ToolCallID ToolCallID + func (u *ToolCallUpdate) UnmarshalJSON(data []byte) error + type ToolKind string + const ToolKindDelete + const ToolKindEdit + const ToolKindExecute + const ToolKindFetch + const ToolKindMove + const ToolKindOther + const ToolKindRead + const ToolKindSearch + const ToolKindSwitchMode + const ToolKindThink + func (k *ToolKind) UnmarshalJSON(data []byte) error + type UngroupedSessionConfigSelectOptions []SessionConfigSelectOption + type UnstructuredCommandInput struct + Hint string + Meta Meta + type UsageUpdate struct + Cost *Cost + Meta Meta + Size uint64 + Used uint64 + func (u *UsageUpdate) UnmarshalJSON(data []byte) error + type WaitForTerminalExitRequest struct + Meta Meta + SessionID SessionID + TerminalID TerminalID + type WaitForTerminalExitResponse struct + ExitCode *uint32 + Meta Meta + Signal *string + func (r *WaitForTerminalExitResponse) UnmarshalJSON(data []byte) error + type WriteTextFileHandler interface + WriteTextFile func(context.Context, *WriteTextFileRequest) (*WriteTextFileResponse, error) + type WriteTextFileRequest struct + Content string + Meta Meta + Path string + SessionID SessionID + type WriteTextFileResponse struct + Meta Meta