libacp

package
v1.0.0-rc.12 Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2026 License: Apache-2.0, Apache-2.0 Imports: 15 Imported by: 0 modules, 0 packages

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

README

libacp

libacp is a Go implementation of the Agent Client Protocol (ACP) — the JSON-RPC-over-NDJSON protocol editors and coding agents use to talk to each other. It implements ACP v1 (ProtocolVersion = 1).

It is maintained as a reusable package inside the Contenox runtime source. The module path is retained as a stable Go import namespace; it does not identify a public development repository.

What it provides

libacp implements both roles of the protocol:

  • Agent side — implement the Agent interface (or embed UnimplementedAgent and override only what you need) and serve it over a transport with NewAgentSideConnection.
  • Client side — implement the Client interface (or embed UnimplementedClient) and drive an agent over a transport with NewClientSideConnection.

Both roles share the same wire machinery:

  • NDJSON framing over any io.ReadWriteCloser
  • Request-id correlation
  • Per-request cancelable contexts honoring $/cancel_request
  • Panic-safe handler dispatch
  • Extension-method passthrough

The acpexec subpackage (git.contenox.com/libacp/acpexec) spawns an agent (or client) subprocess over stdio and wires its stdin/stdout together into the io.ReadWriteCloser a connection expects, plus a Supervisor for restart/backoff around a long-lived subprocess.

It ships in each Contenox source archive rather than as a separate module. Build and test it from that archive with go test ./libacp/....

Usage

Client-role usage — spawn an agent subprocess, connect, initialize, open a session, and send a prompt:

proc, err := acpexec.Spawn(ctx, exec.Command("contenox", "acp"))
if err != nil {
	return err
}

conn := libacp.NewClientSideConnection(proc, func(*libacp.ClientSideConnection) libacp.Client {
	return myClient{} // embeds libacp.UnimplementedClient
})
go conn.Run(ctx)

if _, err := conn.Initialize(ctx, libacp.InitializeRequest{
	ProtocolVersion: libacp.ProtocolVersion,
	ClientInfo:      &libacp.Implementation{Name: "my-editor", Version: "1.0"},
}); err != nil {
	return err
}

sess, err := conn.NewSession(ctx, libacp.NewSessionRequest{Cwd: "/abs/path/to/project"})
if err != nil {
	return err
}

resp, err := conn.Prompt(ctx, libacp.PromptRequest{
	SessionID: sess.SessionID,
	Prompt:    []libacp.ContentBlock{libacp.NewTextContent("hello")},
})
_ = conn.CancelPrompt(sess.SessionID) // cancel the in-flight turn from another goroutine

Agent-role usage mirrors this: implement Agent (or embed UnimplementedAgent), and serve it over a transport with NewAgentSideConnection(rw, factory).

See the package doc and the *_test.go files for further detail on individual methods, session updates, permissions, terminals, and MCP wiring.

License

Apache License 2.0 — see LICENSE.

Documentation

Index

Examples

Constants

View Source
const (
	ErrParseError     = -32700
	ErrInvalidRequest = -32600
	ErrMethodNotFound = -32601
	ErrInvalidParams  = -32602
	ErrInternalError  = -32603

	ErrAuthRequired     = -32000
	ErrRequestTimeout   = -32001
	ErrResourceNotFound = -32002
)
View Source
const (
	AuthMethodTypeTerminal = "terminal"
	AuthMethodTypeEnvVar   = "env_var"
)
View Source
const (
	MethodInitialize   = "initialize"
	MethodAuthenticate = "authenticate"
	MethodLogout       = "logout"

	MethodSessionNew             = "session/new"
	MethodSessionLoad            = "session/load"
	MethodSessionResume          = "session/resume"
	MethodSessionClose           = "session/close"
	MethodSessionDelete          = "session/delete"
	MethodSessionList            = "session/list"
	MethodSessionPrompt          = "session/prompt"
	MethodSessionCancel          = "session/cancel"
	MethodSessionUpdate          = "session/update"
	MethodSessionSetMode         = "session/set_mode"
	MethodSessionSetConfigOption = "session/set_config_option"
	MethodSessionSetModel        = "session/set_model"

	MethodSessionRequestPermission = "session/request_permission"

	MethodCancelRequest = "$/cancel_request"

	MethodFSReadTextFile  = "fs/read_text_file"
	MethodFSWriteTextFile = "fs/write_text_file"

	MethodTerminalCreate      = "terminal/create"
	MethodTerminalOutput      = "terminal/output"
	MethodTerminalWaitForExit = "terminal/wait_for_exit"
	MethodTerminalKill        = "terminal/kill"
	MethodTerminalRelease     = "terminal/release"

	MethodMCPMessage = "mcp/message"
)
View Source
const (
	SessionConfigOptionTypeSelect  = "select"
	SessionConfigOptionTypeBoolean = "boolean"
)
View Source
const EventSeqMetaKey = "contenox.seq"
View Source
const ExtensionMethodPrefix = "_"
View Source
const HandlerDrainTimeout = 10 * time.Second
View Source
const ProtocolVersion = 1

Variables

View Source
var (
	ErrAgentStartFailed = errors.New("libacp: agent start failed")

	ErrIdleTimeout = errors.New("libacp: agent idle timeout")

	ErrNoDisplayableOutput = errors.New("libacp: prompt turn produced no displayable output")
)
View Source
var (
	ErrConnectionClosed = errors.New("libacp: connection closed")
)
View Source
var ErrHandlerDrainTimeout = errors.New("libacp: timed out waiting for handler goroutines to return")

Functions

func AfterResponse

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

func AsNotExist

func AsNotExist(err error) error

func FlattenContent

func FlattenContent(blocks []ContentBlock) (text string, dropped []string)

func IsExtensionMethod added in v0.36.0

func IsExtensionMethod(method string) bool

func IsNotFound

func IsNotFound(err error) bool

func IsRetryableError added in v0.36.0

func IsRetryableError(err error) bool

func IsStartupError added in v0.36.0

func IsStartupError(err error) bool

func IsTimeoutError added in v0.36.0

func IsTimeoutError(err error) bool

func NegotiateProtocolVersion added in v0.36.0

func NegotiateProtocolVersion(theirs, ours int) int

Types

type AgentAuthCapabilities added in v0.36.0

type AgentAuthCapabilities struct {
	Logout *LogoutCapabilities `json:"logout,omitempty"`
	Meta   json.RawMessage     `json:"_meta,omitempty"`
}

type AgentCapabilities

type AgentCapabilities struct {
	LoadSession         bool                  `json:"loadSession,omitempty"`
	PromptCapabilities  PromptCapabilities    `json:"promptCapabilities,omitempty"`
	McpCapabilities     McpCapabilities       `json:"mcpCapabilities,omitempty"`
	SessionCapabilities SessionCapabilities   `json:"sessionCapabilities,omitempty"`
	Auth                AgentAuthCapabilities `json:"auth,omitempty"`
	Meta                json.RawMessage       `json:"_meta,omitempty"`
}

type AgentFactory

type AgentFactory func(conn *AgentSideConnection) Agent

type AgentSideConnection

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

func NewAgentSideConnection

func NewAgentSideConnection(rw io.ReadWriteCloser, factory AgentFactory) *AgentSideConnection

func (*AgentSideConnection) CallExtMethod added in v0.36.0

func (c *AgentSideConnection) CallExtMethod(ctx context.Context, method string, params json.RawMessage) (json.RawMessage, error)

func (*AgentSideConnection) CloseErr

func (c *AgentSideConnection) CloseErr() error

func (*AgentSideConnection) Closed

func (c *AgentSideConnection) Closed() <-chan struct{}

func (*AgentSideConnection) CreateTerminal

func (*AgentSideConnection) KillTerminal

func (*AgentSideConnection) MessageMCP

func (*AgentSideConnection) ReadTextFile

func (*AgentSideConnection) ReleaseTerminal

func (*AgentSideConnection) RequestPermission

func (*AgentSideConnection) Run

func (c *AgentSideConnection) Run(ctx context.Context) (err error)

func (*AgentSideConnection) SendExtNotification added in v0.36.0

func (c *AgentSideConnection) SendExtNotification(method string, params json.RawMessage) error

func (*AgentSideConnection) SessionUpdate

func (c *AgentSideConnection) SessionUpdate(n SessionNotification) error

func (*AgentSideConnection) SetExtNotificationHandler added in v0.36.0

func (c *AgentSideConnection) SetExtNotificationHandler(h ExtNotificationHandler)

func (*AgentSideConnection) SetExtRequestHandler added in v0.36.0

func (c *AgentSideConnection) SetExtRequestHandler(h ExtRequestHandler)

func (*AgentSideConnection) TerminalOutput

func (*AgentSideConnection) WaitForTerminalExit

func (*AgentSideConnection) WriteTextFile

type Annotations

type Annotations struct {
	Audience     []string        `json:"audience,omitempty"`
	LastModified string          `json:"lastModified,omitempty"`
	Priority     *float64        `json:"priority,omitempty"`
	Meta         json.RawMessage `json:"_meta,omitempty"`
}

type AuthCapabilities

type AuthCapabilities struct {
	Terminal bool `json:"terminal,omitempty"`
}

type AuthEnvVar added in v0.36.0

type AuthEnvVar struct {
	Name     string          `json:"name"`
	Label    string          `json:"label,omitempty"`
	Secret   *bool           `json:"secret,omitempty"`
	Optional bool            `json:"optional,omitempty"`
	Meta     json.RawMessage `json:"_meta,omitempty"`
}

type AuthMethod

type AuthMethod struct {
	ID          string            `json:"id"`
	Name        string            `json:"name"`
	Description string            `json:"description,omitempty"`
	Type        string            `json:"type,omitempty"`
	Args        []string          `json:"args,omitempty"`
	Env         map[string]string `json:"env,omitempty"`
	Vars        []AuthEnvVar      `json:"vars,omitempty"`
	Link        string            `json:"link,omitempty"`
	Meta        json.RawMessage   `json:"_meta,omitempty"`
}

type AuthenticateRequest

type AuthenticateRequest struct {
	MethodID string          `json:"methodId"`
	Meta     json.RawMessage `json:"_meta,omitempty"`
}

type AuthenticateResponse

type AuthenticateResponse struct {
	Meta json.RawMessage `json:"_meta,omitempty"`
}

type AvailableCommand

type AvailableCommand struct {
	Name        string                 `json:"name"`
	Description string                 `json:"description"`
	Input       *AvailableCommandInput `json:"input,omitempty"`
	Meta        json.RawMessage        `json:"_meta,omitempty"`
}

type AvailableCommandInput

type AvailableCommandInput struct {
	Hint string `json:"hint,omitempty"`
}

type CancelNotification

type CancelNotification struct {
	SessionID SessionID       `json:"sessionId"`
	Meta      json.RawMessage `json:"_meta,omitempty"`
}

type CancelRequestNotification added in v0.36.0

type CancelRequestNotification struct {
	RequestID RequestID       `json:"requestId"`
	Meta      json.RawMessage `json:"_meta,omitempty"`
}

type Client added in v0.36.0

func FilterSessionUpdates added in v0.36.0

func FilterSessionUpdates(live SessionID, inner Client) Client

type ClientCapabilities

type ClientCapabilities struct {
	FS       FileSystemCapabilities     `json:"fs,omitempty"`
	Terminal bool                       `json:"terminal,omitempty"`
	Session  *ClientSessionCapabilities `json:"session,omitempty"`
	Auth     AuthCapabilities           `json:"auth,omitempty"`
	Meta     json.RawMessage            `json:"_meta,omitempty"`
}

func (ClientCapabilities) SupportsBooleanConfigOptions added in v0.36.0

func (c ClientCapabilities) SupportsBooleanConfigOptions() bool

type ClientFactory added in v0.36.0

type ClientFactory func(conn *ClientSideConnection) Client

type ClientSessionCapabilities added in v0.36.0

type ClientSessionCapabilities struct {
	ConfigOptions *SessionConfigOptionsCapabilities `json:"configOptions,omitempty"`
	Meta          json.RawMessage                   `json:"_meta,omitempty"`
}

type ClientSideConnection added in v0.36.0

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

func NewClientSideConnection added in v0.36.0

func NewClientSideConnection(rw io.ReadWriteCloser, factory ClientFactory) *ClientSideConnection

func (*ClientSideConnection) Authenticate added in v0.36.0

func (*ClientSideConnection) CallExtMethod added in v0.36.0

func (c *ClientSideConnection) CallExtMethod(ctx context.Context, method string, params json.RawMessage) (json.RawMessage, error)

func (*ClientSideConnection) CancelPrompt added in v0.36.0

func (c *ClientSideConnection) CancelPrompt(sessionID SessionID) error

func (*ClientSideConnection) CancelSession added in v0.36.0

func (c *ClientSideConnection) CancelSession(req CancelNotification) error

func (*ClientSideConnection) CloseErr added in v0.36.0

func (c *ClientSideConnection) CloseErr() error

func (*ClientSideConnection) CloseSession added in v0.36.0

func (*ClientSideConnection) Closed added in v0.36.0

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

func (*ClientSideConnection) DeleteSession added in v0.36.0

func (*ClientSideConnection) Initialize added in v0.36.0

func (*ClientSideConnection) ListSessions added in v0.36.0

func (*ClientSideConnection) LoadSession added in v0.36.0

func (*ClientSideConnection) Logout added in v0.36.0

func (*ClientSideConnection) NewSession added in v0.36.0

func (*ClientSideConnection) Prompt added in v0.36.0

func (*ClientSideConnection) ResumeSession added in v0.36.0

func (*ClientSideConnection) Run added in v0.36.0

func (c *ClientSideConnection) Run(ctx context.Context) (err error)

func (*ClientSideConnection) SendExtNotification added in v0.36.0

func (c *ClientSideConnection) SendExtNotification(method string, params json.RawMessage) error

func (*ClientSideConnection) SetExtNotificationHandler added in v0.36.0

func (c *ClientSideConnection) SetExtNotificationHandler(h ExtNotificationHandler)

func (*ClientSideConnection) SetExtRequestHandler added in v0.36.0

func (c *ClientSideConnection) SetExtRequestHandler(h ExtRequestHandler)

func (*ClientSideConnection) SetSessionConfigOption added in v0.36.0

func (*ClientSideConnection) SetSessionMode added in v0.36.0

func (*ClientSideConnection) SetSessionModel added in v0.36.0

type CloseSessionRequest added in v0.36.0

type CloseSessionRequest struct {
	SessionID SessionID       `json:"sessionId"`
	Meta      json.RawMessage `json:"_meta,omitempty"`
}

type CloseSessionResponse added in v0.36.0

type CloseSessionResponse struct {
	Meta json.RawMessage `json:"_meta,omitempty"`
}

type CommandCompletion

type CommandCompletion struct {
	Values []string `json:"values,omitempty"`
	Hint   string   `json:"hint,omitempty"`
}

type CommandCompletionMeta

type CommandCompletionMeta struct {
	Completions map[string]CommandCompletion `json:"contenox.argumentCompletions,omitempty"`
}

type ContentBlock

type ContentBlock struct {
	Type        string            `json:"type"`
	Text        string            `json:"text,omitempty"`
	Data        string            `json:"data,omitempty"`
	MimeType    string            `json:"mimeType,omitempty"`
	URI         string            `json:"uri,omitempty"`
	Name        string            `json:"name,omitempty"`
	Title       string            `json:"title,omitempty"`
	Description string            `json:"description,omitempty"`
	Size        *int64            `json:"size,omitempty"`
	Resource    *EmbeddedResource `json:"resource,omitempty"`
	Annotations *Annotations      `json:"annotations,omitempty"`
	Meta        json.RawMessage   `json:"_meta,omitempty"`
}

func NewAudioContent

func NewAudioContent(data, mimeType string) ContentBlock

func NewImageContent

func NewImageContent(data, mimeType string) ContentBlock

func NewResourceContent

func NewResourceContent(resource EmbeddedResource) ContentBlock
func NewResourceLink(uri, name string) ContentBlock

func NewTextContent

func NewTextContent(text string) ContentBlock

type ContentKind

type ContentKind string
const (
	ContentKindText         ContentKind = "text"
	ContentKindImage        ContentKind = "image"
	ContentKindAudio        ContentKind = "audio"
	ContentKindResource     ContentKind = "resource"
	ContentKindResourceLink ContentKind = "resource_link"
)

type CreateTerminalRequest

type CreateTerminalRequest struct {
	SessionID       SessionID       `json:"sessionId"`
	Command         string          `json:"command"`
	Args            []string        `json:"args,omitempty"`
	Env             []EnvVariable   `json:"env,omitempty"`
	Cwd             string          `json:"cwd,omitempty"`
	OutputByteLimit *int64          `json:"outputByteLimit,omitempty"`
	Meta            json.RawMessage `json:"_meta,omitempty"`
}

type CreateTerminalResponse

type CreateTerminalResponse struct {
	TerminalID string          `json:"terminalId"`
	Meta       json.RawMessage `json:"_meta,omitempty"`
}

type DeleteSessionRequest added in v0.36.0

type DeleteSessionRequest struct {
	SessionID SessionID       `json:"sessionId"`
	Meta      json.RawMessage `json:"_meta,omitempty"`
}

type DeleteSessionResponse added in v0.36.0

type DeleteSessionResponse struct {
	Meta json.RawMessage `json:"_meta,omitempty"`
}

type EmbeddedResource

type EmbeddedResource struct {
	URI      string          `json:"uri"`
	MimeType string          `json:"mimeType,omitempty"`
	Text     string          `json:"text,omitempty"`
	Blob     string          `json:"blob,omitempty"`
	Meta     json.RawMessage `json:"_meta,omitempty"`
}

type EnvVariable

type EnvVariable struct {
	Name  string `json:"name"`
	Value string `json:"value"`
}

type Error

type Error struct {
	Code    int             `json:"code"`
	Message string          `json:"message"`
	Data    json.RawMessage `json:"data,omitempty"`
	// contains filtered or unexported fields
}

func AsError

func AsError(err error) *Error

func InternalError

func InternalError(msg string) *Error

func InvalidParams

func InvalidParams(msg string) *Error

func InvalidRequest

func InvalidRequest(msg string) *Error

func MethodNotFound

func MethodNotFound(method string) *Error

func NewError

func NewError(code int, message string) *Error

func NewErrorf

func NewErrorf(code int, format string, args ...any) *Error

func ParseError

func ParseError(msg string) *Error

func (*Error) Error

func (e *Error) Error() string

func (*Error) Unwrap

func (e *Error) Unwrap() error

type ExtNotificationHandler added in v0.36.0

type ExtNotificationHandler func(ctx context.Context, method string, params json.RawMessage)

type ExtRequestHandler added in v0.36.0

type ExtRequestHandler func(ctx context.Context, method string, params json.RawMessage) (json.RawMessage, *Error)

type FileSystemCapabilities

type FileSystemCapabilities struct {
	ReadTextFile  bool            `json:"readTextFile,omitempty"`
	WriteTextFile bool            `json:"writeTextFile,omitempty"`
	Meta          json.RawMessage `json:"_meta,omitempty"`
}

type HttpHeader

type HttpHeader struct {
	Name  string `json:"name"`
	Value string `json:"value"`
}

type Implementation

type Implementation struct {
	Name    string `json:"name"`
	Title   string `json:"title,omitempty"`
	Version string `json:"version,omitempty"`
}

type Incoming

type Incoming struct {
	Kind         IncomingKind
	Request      Request
	Notification Notification
	Response     Response
}

func ParseIncoming

func ParseIncoming(data []byte) (Incoming, error)

type IncomingKind

type IncomingKind uint8
const (
	IncomingKindUnknown IncomingKind = iota
	IncomingKindRequest
	IncomingKindNotification
	IncomingKindResponse
)

type InitializeRequest

type InitializeRequest struct {
	ProtocolVersion    int                `json:"protocolVersion"`
	ClientCapabilities ClientCapabilities `json:"clientCapabilities,omitempty"`
	ClientInfo         *Implementation    `json:"clientInfo,omitempty"`
	Meta               json.RawMessage    `json:"_meta,omitempty"`
}

type InitializeResponse

type InitializeResponse struct {
	ProtocolVersion   int               `json:"protocolVersion"`
	AgentCapabilities AgentCapabilities `json:"agentCapabilities,omitempty"`
	AgentInfo         *Implementation   `json:"agentInfo,omitempty"`
	AuthMethods       []AuthMethod      `json:"authMethods,omitempty"`
	Meta              json.RawMessage   `json:"_meta,omitempty"`
}

type KillTerminalRequest

type KillTerminalRequest struct {
	SessionID  SessionID       `json:"sessionId"`
	TerminalID string          `json:"terminalId"`
	Meta       json.RawMessage `json:"_meta,omitempty"`
}

type KillTerminalResponse

type KillTerminalResponse struct {
	Meta json.RawMessage `json:"_meta,omitempty"`
}

type ListSessionsRequest

type ListSessionsRequest struct {
	Cwd    string          `json:"cwd,omitempty"`
	Cursor string          `json:"cursor,omitempty"`
	Meta   json.RawMessage `json:"_meta,omitempty"`
}

type ListSessionsResponse

type ListSessionsResponse struct {
	Sessions   []SessionInfo   `json:"sessions"`
	NextCursor string          `json:"nextCursor,omitempty"`
	Meta       json.RawMessage `json:"_meta,omitempty"`
}

type LoadSessionRequest

type LoadSessionRequest struct {
	SessionID             SessionID       `json:"sessionId"`
	Cwd                   string          `json:"cwd"`
	SinceSeq              uint64          `json:"sinceSeq,omitempty"`
	AdditionalDirectories []string        `json:"additionalDirectories,omitempty"`
	McpServers            []McpServer     `json:"mcpServers"`
	Meta                  json.RawMessage `json:"_meta,omitempty"`
}

type LoadSessionResponse

type LoadSessionResponse struct {
	Modes         *SessionModeState     `json:"modes,omitempty"`
	Models        *SessionModelState    `json:"models,omitempty"`
	ConfigOptions []SessionConfigOption `json:"configOptions,omitempty"`
	Meta          json.RawMessage       `json:"_meta,omitempty"`
}

type LogoutCapabilities added in v0.36.0

type LogoutCapabilities struct {
	Meta json.RawMessage `json:"_meta,omitempty"`
}

type LogoutRequest added in v0.36.0

type LogoutRequest struct {
	Meta json.RawMessage `json:"_meta,omitempty"`
}

type LogoutResponse added in v0.36.0

type LogoutResponse struct {
	Meta json.RawMessage `json:"_meta,omitempty"`
}

type MCPError

type MCPError struct {
	Code    int64           `json:"code"`
	Message string          `json:"message"`
	Data    json.RawMessage `json:"data,omitempty"`
}

type McpCapabilities

type McpCapabilities struct {
	HTTP bool            `json:"http,omitempty"`
	SSE  bool            `json:"sse,omitempty"`
	ACP  bool            `json:"acp,omitempty"`
	Meta json.RawMessage `json:"_meta,omitempty"`
}

type McpServer

type McpServer struct {
	Type     string          `json:"type,omitempty"`
	Name     string          `json:"name"`
	Command  string          `json:"command,omitempty"`
	Args     []string        `json:"args,omitempty"`
	Env      []EnvVariable   `json:"env,omitempty"`
	URL      string          `json:"url,omitempty"`
	Headers  []HttpHeader    `json:"headers,omitempty"`
	ServerID string          `json:"serverId,omitempty"`
	Meta     json.RawMessage `json:"_meta,omitempty"`
}

func (McpServer) Kind

func (m McpServer) Kind() McpServerKind

func (McpServer) MarshalJSON added in v0.36.0

func (m McpServer) MarshalJSON() ([]byte, error)

func (McpServer) Validate

func (m McpServer) Validate() error

type McpServerKind

type McpServerKind string
const (
	McpServerKindStdio McpServerKind = ""
	McpServerKindHTTP  McpServerKind = "http"
	McpServerKindSSE   McpServerKind = "sse"
	McpServerKindACP   McpServerKind = "acp"
)

type MessageMCPRequest

type MessageMCPRequest struct {
	ServerID  string          `json:"serverId"`
	RequestID string          `json:"requestId"`
	Method    string          `json:"method"`
	Params    json.RawMessage `json:"params,omitempty"`
	Meta      json.RawMessage `json:"_meta,omitempty"`
}

type MessageMCPResponse

type MessageMCPResponse struct {
	Result json.RawMessage `json:"result,omitempty"`
	Error  *MCPError       `json:"error,omitempty"`
	Meta   json.RawMessage `json:"_meta,omitempty"`
}

func (MessageMCPResponse) Validate

func (r MessageMCPResponse) Validate() error

type ModelInfo added in v0.36.0

type ModelInfo struct {
	ID          string          `json:"modelId"`
	Name        string          `json:"name"`
	Description string          `json:"description,omitempty"`
	Meta        json.RawMessage `json:"_meta,omitempty"`
}

type NewSessionRequest

type NewSessionRequest struct {
	Cwd                   string          `json:"cwd"`
	AdditionalDirectories []string        `json:"additionalDirectories,omitempty"`
	McpServers            []McpServer     `json:"mcpServers"`
	Meta                  json.RawMessage `json:"_meta,omitempty"`
}

type NewSessionResponse

type NewSessionResponse struct {
	SessionID     SessionID             `json:"sessionId"`
	Modes         *SessionModeState     `json:"modes,omitempty"`
	Models        *SessionModelState    `json:"models,omitempty"`
	ConfigOptions []SessionConfigOption `json:"configOptions,omitempty"`
	Meta          json.RawMessage       `json:"_meta,omitempty"`
}

type Notification

type Notification struct {
	JSONRPC string          `json:"jsonrpc"`
	Method  string          `json:"method"`
	Params  json.RawMessage `json:"params,omitempty"`
}

func NewNotification

func NewNotification(method string, params json.RawMessage) Notification

type PermissionOption

type PermissionOption struct {
	OptionID string               `json:"optionId"`
	Name     string               `json:"name"`
	Kind     PermissionOptionKind `json:"kind"`
	Meta     json.RawMessage      `json:"_meta,omitempty"`
}

type PermissionOptionKind

type PermissionOptionKind string
const (
	PermissionAllowOnce    PermissionOptionKind = "allow_once"
	PermissionAllowAlways  PermissionOptionKind = "allow_always"
	PermissionRejectOnce   PermissionOptionKind = "reject_once"
	PermissionRejectAlways PermissionOptionKind = "reject_always"
)

type PermissionOutcomeKind

type PermissionOutcomeKind string
const (
	PermissionOutcomeCancelled PermissionOutcomeKind = "cancelled"
	PermissionOutcomeSelected  PermissionOutcomeKind = "selected"
)

type PermissionToolCall

type PermissionToolCall struct {
	ToolCallID string             `json:"toolCallId"`
	Title      string             `json:"title,omitempty"`
	Kind       ToolKind           `json:"kind,omitempty"`
	Status     ToolCallStatus     `json:"status,omitempty"`
	Content    []ToolCallContent  `json:"content,omitempty"`
	Locations  []ToolCallLocation `json:"locations,omitempty"`
	RawInput   json.RawMessage    `json:"rawInput,omitempty"`
	RawOutput  json.RawMessage    `json:"rawOutput,omitempty"`
	Meta       json.RawMessage    `json:"_meta,omitempty"`
}

type PlanEntry

type PlanEntry struct {
	Content  string            `json:"content"`
	Priority PlanEntryPriority `json:"priority"`
	Status   PlanEntryStatus   `json:"status"`
	Meta     json.RawMessage   `json:"_meta,omitempty"`
}

type PlanEntryPriority

type PlanEntryPriority string
const (
	PlanPriorityHigh   PlanEntryPriority = "high"
	PlanPriorityMedium PlanEntryPriority = "medium"
	PlanPriorityLow    PlanEntryPriority = "low"
)

type PlanEntryStatus

type PlanEntryStatus string
const (
	PlanStatusPending    PlanEntryStatus = "pending"
	PlanStatusInProgress PlanEntryStatus = "in_progress"
	PlanStatusCompleted  PlanEntryStatus = "completed"
)

type PromptCapabilities

type PromptCapabilities struct {
	Image           bool            `json:"image,omitempty"`
	Audio           bool            `json:"audio,omitempty"`
	EmbeddedContext bool            `json:"embeddedContext,omitempty"`
	Meta            json.RawMessage `json:"_meta,omitempty"`
}

type PromptRequest

type PromptRequest struct {
	SessionID SessionID       `json:"sessionId"`
	Prompt    []ContentBlock  `json:"prompt"`
	Meta      json.RawMessage `json:"_meta,omitempty"`
}

type PromptResponse

type PromptResponse struct {
	StopReason StopReason      `json:"stopReason"`
	Meta       json.RawMessage `json:"_meta,omitempty"`
}

type ReadTextFileRequest

type ReadTextFileRequest struct {
	SessionID SessionID       `json:"sessionId"`
	Path      string          `json:"path"`
	Line      *int            `json:"line,omitempty"`
	Limit     *int            `json:"limit,omitempty"`
	Meta      json.RawMessage `json:"_meta,omitempty"`
}

type ReadTextFileResponse

type ReadTextFileResponse struct {
	Content string          `json:"content"`
	Meta    json.RawMessage `json:"_meta,omitempty"`
}

type ReleaseTerminalRequest

type ReleaseTerminalRequest struct {
	SessionID  SessionID       `json:"sessionId"`
	TerminalID string          `json:"terminalId"`
	Meta       json.RawMessage `json:"_meta,omitempty"`
}

type ReleaseTerminalResponse

type ReleaseTerminalResponse struct {
	Meta json.RawMessage `json:"_meta,omitempty"`
}

type Request

type Request struct {
	JSONRPC string          `json:"jsonrpc"`
	ID      RequestID       `json:"id"`
	Method  string          `json:"method"`
	Params  json.RawMessage `json:"params,omitempty"`
}

func NewRequest

func NewRequest(id RequestID, method string, params json.RawMessage) Request

type RequestID

type RequestID struct {
	Kind   RequestIDKind
	Number int64
	String string
}

func NewRequestIDNull

func NewRequestIDNull() RequestID

func NewRequestIDNumber

func NewRequestIDNumber(n int64) RequestID

func NewRequestIDString

func NewRequestIDString(s string) RequestID

func (RequestID) Equal

func (r RequestID) Equal(other RequestID) bool

func (RequestID) MarshalJSON

func (r RequestID) MarshalJSON() ([]byte, error)

func (RequestID) String_

func (r RequestID) String_() string

func (*RequestID) UnmarshalJSON

func (r *RequestID) UnmarshalJSON(data []byte) error

type RequestIDKind

type RequestIDKind uint8
const (
	RequestIDKindNull RequestIDKind = iota
	RequestIDKindNumber
	RequestIDKindString
)

type RequestPermissionOutcome

type RequestPermissionOutcome struct {
	Outcome  PermissionOutcomeKind `json:"outcome"`
	OptionID string                `json:"optionId,omitempty"`
}

func (*RequestPermissionOutcome) UnmarshalJSON

func (o *RequestPermissionOutcome) UnmarshalJSON(data []byte) error

type RequestPermissionRequest

type RequestPermissionRequest struct {
	SessionID SessionID          `json:"sessionId"`
	ToolCall  PermissionToolCall `json:"toolCall"`
	Options   []PermissionOption `json:"options"`
	Meta      json.RawMessage    `json:"_meta,omitempty"`
}

type RequestPermissionResponse

type RequestPermissionResponse struct {
	Outcome RequestPermissionOutcome `json:"outcome"`
	Meta    json.RawMessage          `json:"_meta,omitempty"`
}

type Response

type Response struct {
	JSONRPC string          `json:"jsonrpc"`
	ID      RequestID       `json:"id"`
	Result  json.RawMessage `json:"result,omitempty"`
	Error   *Error          `json:"error,omitempty"`
}

func NewErrorResponse

func NewErrorResponse(id RequestID, err *Error) Response

func NewResultResponse

func NewResultResponse(id RequestID, result json.RawMessage) Response

type ResumeSessionRequest added in v0.36.0

type ResumeSessionRequest struct {
	SessionID             SessionID       `json:"sessionId"`
	Cwd                   string          `json:"cwd"`
	SinceSeq              uint64          `json:"sinceSeq,omitempty"`
	AdditionalDirectories []string        `json:"additionalDirectories,omitempty"`
	McpServers            []McpServer     `json:"mcpServers,omitempty"`
	Meta                  json.RawMessage `json:"_meta,omitempty"`
}

type ResumeSessionResponse added in v0.36.0

type ResumeSessionResponse struct {
	Modes         *SessionModeState     `json:"modes,omitempty"`
	Models        *SessionModelState    `json:"models,omitempty"`
	ConfigOptions []SessionConfigOption `json:"configOptions,omitempty"`
	Meta          json.RawMessage       `json:"_meta,omitempty"`
}

type SessionCapabilities

type SessionCapabilities struct {
	List                  *struct{}       `json:"list,omitempty"`
	Resume                *struct{}       `json:"resume,omitempty"`
	Close                 *struct{}       `json:"close,omitempty"`
	Delete                *struct{}       `json:"delete,omitempty"`
	AdditionalDirectories *struct{}       `json:"additionalDirectories,omitempty"`
	Meta                  json.RawMessage `json:"_meta,omitempty"`
}

type SessionConfigGroup added in v0.29.0

type SessionConfigGroup struct {
	Group   string               `json:"group"`
	Name    string               `json:"name"`
	Options []SessionConfigValue `json:"options"`
	Meta    json.RawMessage      `json:"_meta,omitempty"`
}

type SessionConfigOption added in v0.29.0

type SessionConfigOption struct {
	ID           string              `json:"id"`
	Name         string              `json:"name"`
	Description  string              `json:"description,omitempty"`
	Category     string              `json:"category,omitempty"`
	Type         string              `json:"type"`
	CurrentValue string              `json:"currentValue"`
	Options      SessionConfigValues `json:"options"`
	Meta         json.RawMessage     `json:"_meta,omitempty"`
}

func (SessionConfigOption) MarshalJSON added in v0.36.0

func (o SessionConfigOption) MarshalJSON() ([]byte, error)

func (*SessionConfigOption) UnmarshalJSON added in v0.36.0

func (o *SessionConfigOption) UnmarshalJSON(data []byte) error

type SessionConfigOptionValue added in v0.36.0

type SessionConfigOptionValue struct {
	IsBool bool
	Str    string
	Bool   bool
}
Example
package main

import (
	"encoding/json"
	"fmt"

	"github.com/contenox/runtime/libacp"
)

func main() {
	var req libacp.SetSessionConfigOptionRequest
	_ = json.Unmarshal([]byte(`{"sessionId":"s","configId":"c","value":"model-x"}`), &req)
	fmt.Println(req.Value.AsString(), req.Value.IsBool)

	_ = json.Unmarshal([]byte(`{"sessionId":"s","configId":"c","type":"boolean","value":true}`), &req)
	fmt.Println(req.Value.AsString(), req.Value.IsBool)
}
Output:
model-x false
true true

func BoolConfigValue added in v0.36.0

func BoolConfigValue(b bool) SessionConfigOptionValue

func StringConfigValue added in v0.36.0

func StringConfigValue(s string) SessionConfigOptionValue

func (SessionConfigOptionValue) AsString added in v0.36.0

func (v SessionConfigOptionValue) AsString() string

func (SessionConfigOptionValue) MarshalJSON added in v0.36.0

func (v SessionConfigOptionValue) MarshalJSON() ([]byte, error)

func (*SessionConfigOptionValue) UnmarshalJSON added in v0.36.0

func (v *SessionConfigOptionValue) UnmarshalJSON(data []byte) error

type SessionConfigOptionsCapabilities added in v0.36.0

type SessionConfigOptionsCapabilities struct {
	Boolean *struct{}       `json:"boolean,omitempty"`
	Meta    json.RawMessage `json:"_meta,omitempty"`
}

type SessionConfigValue added in v0.29.0

type SessionConfigValue struct {
	Value       string          `json:"value"`
	Name        string          `json:"name"`
	Description string          `json:"description,omitempty"`
	Meta        json.RawMessage `json:"_meta,omitempty"`
}

type SessionConfigValues added in v0.29.0

type SessionConfigValues struct {
	Values []SessionConfigValue
	Groups []SessionConfigGroup
}

func NewGroupedSessionConfigValues added in v0.29.0

func NewGroupedSessionConfigValues(groups []SessionConfigGroup) SessionConfigValues

func NewSessionConfigValues added in v0.29.0

func NewSessionConfigValues(values []SessionConfigValue) SessionConfigValues

func (SessionConfigValues) AllValues added in v0.29.0

func (v SessionConfigValues) AllValues() []SessionConfigValue

func (SessionConfigValues) MarshalJSON added in v0.29.0

func (v SessionConfigValues) MarshalJSON() ([]byte, error)

func (*SessionConfigValues) UnmarshalJSON added in v0.29.0

func (v *SessionConfigValues) UnmarshalJSON(data []byte) error

type SessionID

type SessionID string

type SessionInfo

type SessionInfo struct {
	SessionID             SessionID       `json:"sessionId"`
	Cwd                   string          `json:"cwd,omitempty"`
	AdditionalDirectories []string        `json:"additionalDirectories,omitempty"`
	Title                 string          `json:"title,omitempty"`
	UpdatedAt             string          `json:"updatedAt,omitempty"`
	Meta                  json.RawMessage `json:"_meta,omitempty"`
}

type SessionMode

type SessionMode struct {
	ID          string          `json:"id"`
	Name        string          `json:"name"`
	Description string          `json:"description,omitempty"`
	Meta        json.RawMessage `json:"_meta,omitempty"`
}

type SessionModeState added in v0.36.0

type SessionModeState struct {
	CurrentModeID  string          `json:"currentModeId"`
	AvailableModes []SessionMode   `json:"availableModes"`
	Meta           json.RawMessage `json:"_meta,omitempty"`
}

type SessionModelState added in v0.36.0

type SessionModelState struct {
	CurrentModelID  string          `json:"currentModelId"`
	AvailableModels []ModelInfo     `json:"availableModels"`
	Meta            json.RawMessage `json:"_meta,omitempty"`
}

type SessionModelStats

type SessionModelStats struct {
	Model    string `json:"model"`
	Provider string `json:"provider,omitempty"`
	Calls    int64  `json:"calls"`

	InputTokens      int64 `json:"inputTokens"`
	OutputTokens     int64 `json:"outputTokens"`
	ThinkingTokens   int64 `json:"thinkingTokens"`
	CacheReadTokens  int64 `json:"cacheReadTokens"`
	CacheWriteTokens int64 `json:"cacheWriteTokens"`
}

type SessionNotification

type SessionNotification struct {
	SessionID SessionID       `json:"sessionId"`
	Update    SessionUpdate   `json:"update"`
	Meta      json.RawMessage `json:"_meta,omitempty"`
}

func (SessionNotification) WithSeq

type SessionStats

type SessionStats struct {
	SessionID string `json:"sessionId"`

	Turns      int64 `json:"turns"`
	Steps      int64 `json:"steps"`
	ModelCalls int64 `json:"modelCalls"`
	LlmMs      int64 `json:"llmMs"`
	ToolMs     int64 `json:"toolMs"`

	TtftSamples int64 `json:"ttftSamples"`
	TtftMs      int64 `json:"ttftMs"`
	StreamMs    int64 `json:"streamMs"`

	InputTokens      int64 `json:"inputTokens"`
	OutputTokens     int64 `json:"outputTokens"`
	ThinkingTokens   int64 `json:"thinkingTokens"`
	CacheReadTokens  int64 `json:"cacheReadTokens"`
	CacheWriteTokens int64 `json:"cacheWriteTokens"`

	ByModel []SessionModelStats `json:"byModel,omitempty"`
}

type SessionUpdate

type SessionUpdate struct {
	SessionUpdate SessionUpdateKind `json:"sessionUpdate"`

	Content *ContentBlock `json:"-"`

	ToolCallID  string             `json:"toolCallId,omitempty"`
	Title       string             `json:"title,omitempty"`
	Kind        ToolKind           `json:"kind,omitempty"`
	Status      ToolCallStatus     `json:"status,omitempty"`
	ToolContent []ToolCallContent  `json:"-"`
	Locations   []ToolCallLocation `json:"locations,omitempty"`
	RawInput    json.RawMessage    `json:"rawInput,omitempty"`
	RawOutput   json.RawMessage    `json:"rawOutput,omitempty"`

	Entries []PlanEntry `json:"entries,omitempty"`

	AvailableCommands []AvailableCommand `json:"availableCommands,omitempty"`

	CurrentModeID string `json:"currentModeId,omitempty"`

	ConfigOptions []SessionConfigOption `json:"configOptions,omitempty"`

	Used int        `json:"used,omitempty"`
	Size int        `json:"size,omitempty"`
	Cost *UsageCost `json:"cost,omitempty"`

	Stats *SessionStats `json:"stats,omitempty"`

	MessageID string `json:"messageId,omitempty"`

	UpdatedAt string `json:"updatedAt,omitempty"`

	Meta json.RawMessage `json:"_meta,omitempty"`
}

func NewAgentMessageChunk

func NewAgentMessageChunk(text string) SessionUpdate

func NewAgentThoughtChunk

func NewAgentThoughtChunk(text string) SessionUpdate

func NewUserMessageChunk

func NewUserMessageChunk(text string) SessionUpdate

func (SessionUpdate) MarshalJSON

func (u SessionUpdate) MarshalJSON() ([]byte, error)

func (*SessionUpdate) UnmarshalJSON

func (u *SessionUpdate) UnmarshalJSON(data []byte) error

type SessionUpdateKind

type SessionUpdateKind string
const (
	SessionUpdateUserMessageChunk  SessionUpdateKind = "user_message_chunk"
	SessionUpdateAgentMessageChunk SessionUpdateKind = "agent_message_chunk"
	SessionUpdateAgentThoughtChunk SessionUpdateKind = "agent_thought_chunk"
	SessionUpdateToolCall          SessionUpdateKind = "tool_call"
	SessionUpdateToolCallUpdate    SessionUpdateKind = "tool_call_update"
	SessionUpdatePlan              SessionUpdateKind = "plan"
	SessionUpdateAvailableCommands SessionUpdateKind = "available_commands_update"
	SessionUpdateCurrentMode       SessionUpdateKind = "current_mode_update"
	SessionUpdateConfigOption      SessionUpdateKind = "config_option_update"
	SessionUpdateUsageUpdate       SessionUpdateKind = "usage_update"
	SessionUpdateUsageStats        SessionUpdateKind = "usage_stats"
	SessionUpdateSessionInfo       SessionUpdateKind = "session_info_update"
)

func AllSessionUpdateKinds

func AllSessionUpdateKinds() []SessionUpdateKind

type SetSessionConfigOptionRequest added in v0.29.0

type SetSessionConfigOptionRequest struct {
	SessionID SessionID                `json:"sessionId"`
	ConfigID  string                   `json:"configId"`
	Type      string                   `json:"type,omitempty"`
	Value     SessionConfigOptionValue `json:"value"`
	Meta      json.RawMessage          `json:"_meta,omitempty"`
}

type SetSessionConfigOptionResponse added in v0.29.0

type SetSessionConfigOptionResponse struct {
	ConfigOptions []SessionConfigOption `json:"configOptions"`
	Meta          json.RawMessage       `json:"_meta,omitempty"`
}

type SetSessionModeRequest added in v0.36.0

type SetSessionModeRequest struct {
	SessionID SessionID       `json:"sessionId"`
	ModeID    string          `json:"modeId"`
	Meta      json.RawMessage `json:"_meta,omitempty"`
}

type SetSessionModeResponse added in v0.36.0

type SetSessionModeResponse struct {
	Meta json.RawMessage `json:"_meta,omitempty"`
}

type SetSessionModelRequest added in v0.36.0

type SetSessionModelRequest struct {
	SessionID SessionID       `json:"sessionId"`
	ModelID   string          `json:"modelId"`
	Meta      json.RawMessage `json:"_meta,omitempty"`
}

type SetSessionModelResponse added in v0.36.0

type SetSessionModelResponse struct {
	Meta json.RawMessage `json:"_meta,omitempty"`
}

type StopReason

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

type TerminalExitStatus

type TerminalExitStatus struct {
	ExitCode *int    `json:"exitCode,omitempty"`
	Signal   *string `json:"signal,omitempty"`
}

type TerminalOutputRequest

type TerminalOutputRequest struct {
	SessionID  SessionID       `json:"sessionId"`
	TerminalID string          `json:"terminalId"`
	Meta       json.RawMessage `json:"_meta,omitempty"`
}

type TerminalOutputResponse

type TerminalOutputResponse struct {
	Output     string              `json:"output"`
	Truncated  bool                `json:"truncated"`
	ExitStatus *TerminalExitStatus `json:"exitStatus,omitempty"`
	Meta       json.RawMessage     `json:"_meta,omitempty"`
}

type TerminalResult

type TerminalResult struct {
	Output    string
	Truncated bool
	ExitCode  int
	Signal    *string
	Cancelled bool
	TimedOut  bool
}

func RunTerminal

func RunTerminal(ctx context.Context, p TerminalPeer, req CreateTerminalRequest, onCreated func(terminalID string)) (TerminalResult, error)

type ToolCallContent

type ToolCallContent struct {
	Type       ToolCallContentKind `json:"type"`
	Content    *ContentBlock       `json:"content,omitempty"`
	Path       string              `json:"path,omitempty"`
	OldText    string              `json:"oldText,omitempty"`
	NewText    string              `json:"newText,omitempty"`
	TerminalID string              `json:"terminalId,omitempty"`
	Meta       json.RawMessage     `json:"_meta,omitempty"`
}

func (ToolCallContent) MarshalJSON added in v0.36.0

func (c ToolCallContent) MarshalJSON() ([]byte, error)

type ToolCallContentKind

type ToolCallContentKind string
const (
	ToolCallContentRegular  ToolCallContentKind = "content"
	ToolCallContentDiff     ToolCallContentKind = "diff"
	ToolCallContentTerminal ToolCallContentKind = "terminal"
)

type ToolCallLocation

type ToolCallLocation struct {
	Path string `json:"path"`
	Line *int   `json:"line,omitempty"`
}

type ToolCallStatus

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

type ToolKind

type ToolKind string
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 TurnTracker added in v0.36.0

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

func (*TurnTracker) Err added in v0.36.0

func (t *TurnTracker) Err(stop StopReason) error

func (*TurnTracker) Observe added in v0.36.0

func (t *TurnTracker) Observe(n SessionNotification)

func (*TurnTracker) Reset added in v0.36.0

func (t *TurnTracker) Reset()

func (*TurnTracker) SawDisplayableOutput added in v0.36.0

func (t *TurnTracker) SawDisplayableOutput() bool

func (*TurnTracker) ToolUpdateCount added in v0.36.0

func (t *TurnTracker) ToolUpdateCount() int

type UnimplementedAgent

type UnimplementedAgent struct{}

func (UnimplementedAgent) Authenticate

func (UnimplementedAgent) Cancel

func (UnimplementedAgent) CloseSession added in v0.36.0

func (UnimplementedAgent) DeleteSession added in v0.36.0

func (UnimplementedAgent) Initialize

func (UnimplementedAgent) ListSessions

func (UnimplementedAgent) LoadSession

func (UnimplementedAgent) Logout added in v0.36.0

func (UnimplementedAgent) NewSession

func (UnimplementedAgent) Prompt

func (UnimplementedAgent) ResumeSession added in v0.36.0

func (UnimplementedAgent) SetSessionConfigOption added in v0.29.0

func (UnimplementedAgent) SetSessionMode added in v0.36.0

func (UnimplementedAgent) SetSessionModel added in v0.36.0

type UnimplementedClient added in v0.36.0

type UnimplementedClient struct{}

func (UnimplementedClient) CreateTerminal added in v0.36.0

func (UnimplementedClient) KillTerminal added in v0.36.0

func (UnimplementedClient) MessageMCP

func (UnimplementedClient) ReadTextFile added in v0.36.0

func (UnimplementedClient) ReleaseTerminal added in v0.36.0

func (UnimplementedClient) RequestPermission added in v0.36.0

func (UnimplementedClient) SessionUpdate added in v0.36.0

func (UnimplementedClient) TerminalOutput added in v0.36.0

func (UnimplementedClient) WaitForTerminalExit added in v0.36.0

func (UnimplementedClient) WriteTextFile added in v0.36.0

type UsageCost added in v0.34.0

type UsageCost struct {
	Amount   float64 `json:"amount"`
	Currency string  `json:"currency"`
}

type WaitForTerminalExitRequest

type WaitForTerminalExitRequest struct {
	SessionID  SessionID       `json:"sessionId"`
	TerminalID string          `json:"terminalId"`
	Meta       json.RawMessage `json:"_meta,omitempty"`
}

type WaitForTerminalExitResponse

type WaitForTerminalExitResponse struct {
	ExitCode *int            `json:"exitCode,omitempty"`
	Signal   *string         `json:"signal,omitempty"`
	Meta     json.RawMessage `json:"_meta,omitempty"`
}

type WriteTextFileRequest

type WriteTextFileRequest struct {
	SessionID SessionID       `json:"sessionId"`
	Path      string          `json:"path"`
	Content   string          `json:"content"`
	Meta      json.RawMessage `json:"_meta,omitempty"`
}

type WriteTextFileResponse

type WriteTextFileResponse struct {
	Meta json.RawMessage `json:"_meta,omitempty"`
}

Directories

Path Synopsis
cmd
acp-stub-agent command

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL