acp

package
v0.11.1 Latest Latest
Warning

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

Go to latest
Published: Jul 26, 2026 License: MIT Imports: 11 Imported by: 0

Documentation

Overview

Package acp provides an ACP (Agent Client Protocol) handler that serves bond agents over JSON-RPC 2.0 via stdio or other transports. ACP enables code editors (Zed, JetBrains, VS Code) to connect to bond agents as coding assistants.

This package uses shared protocol types from agent/acpproxy (Message, ErrorObject, error codes, method constants) and transport implementations from agent/acpproxy/acpio (Transport, StdioProcess).

Index

Constants

This section is empty.

Variables

View Source
var DefaultTransport = acpio.DefaultTransport

DefaultTransport returns a Transport using os.Stdin and os.Stdout.

View Source
var NewTransport = acpio.NewTransport

NewTransport creates a ndjson Transport from an io.Reader and io.Writer.

Functions

This section is empty.

Types

type Command

type Command = acpproxy.Command

Protocol types used throughout this package.

type ErrorObject

type ErrorObject = acpproxy.ErrorObject

Protocol types used throughout this package.

type Handler

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

Handler is the ACP protocol handler. It bridges a bond.Agent to the ACP JSON-RPC protocol.

func NewHandler

func NewHandler(agent bond.Agent, opts Options) *Handler

NewHandler creates an ACP handler for the given agent. Follows the same pattern as NewHTTPHandler, NewA2AHandler, NewMCPHandler.

func (*Handler) Serve

func (h *Handler) Serve(ctx context.Context) error

Serve blocks and processes JSON-RPC messages until the transport reader closes or a fatal error occurs. Returns nil on clean EOF shutdown.

type Message

type Message = acpproxy.Message

Protocol types used throughout this package.

type Options

type Options struct {
	// AgentName is the name reported during initialization.
	AgentName string
	// AgentVersion is the version reported during initialization.
	AgentVersion string
	// AgentOptions configures the bond agent loop (tools, plugins, max turns).
	AgentOptions bond.AgentOptions
	// Transport is the reader/writer pair. Defaults to stdin/stdout.
	Transport ReadWriter
	// Commands is the list of slash commands to advertise to the client.
	Commands []Command
}

Options configures the ACP handler.

type ReadWriter added in v0.6.0

type ReadWriter = acpproxy.ReadWriter

Protocol types used throughout this package.

type Session

type Session struct {
	ID      string
	CWD     string
	History []bond.Message
	// contains filtered or unexported fields
}

Session holds the conversation state for a single ACP session.

Jump to

Keyboard shortcuts

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