acp

package
v0.3.29-beta Latest Latest
Warning

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

Go to latest
Published: Apr 8, 2026 License: MIT Imports: 17 Imported by: 0

Documentation

Overview

Package acp implements the Agent Client Protocol (ACP) server for kodelet. ACP enables kodelet to be embedded in ACP-compatible clients like Zed or JetBrains IDEs using JSON-RPC 2.0 over stdio.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Option

type Option func(*Server)

Option configures the server

func WithConfig

func WithConfig(config *ServerConfig) Option

WithConfig sets the server configuration

func WithContext

func WithContext(ctx context.Context) Option

WithContext sets the server context

func WithInput

func WithInput(r io.Reader) Option

WithInput sets the input reader

func WithOutput

func WithOutput(w io.Writer) Option

WithOutput sets the output writer

type Server

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

Server implements the ACP agent server. The server handles JSON-RPC 2.0 messages concurrently - responses may arrive out-of-order relative to requests (which is allowed by JSON-RPC spec).

func NewServer

func NewServer(opts ...Option) *Server

NewServer creates a new ACP server

func (*Server) CallClient

func (s *Server) CallClient(ctx context.Context, method string, params any) (json.RawMessage, error)

CallClient makes an RPC call to the client and waits for response

func (*Server) GetClientCapabilities

func (s *Server) GetClientCapabilities() *acptypes.ClientCapabilities

GetClientCapabilities returns the client capabilities

func (*Server) Run

func (s *Server) Run() error

Run starts the server event loop. Requests are processed concurrently, so responses may arrive out-of-order. The method blocks until the input stream is closed or the context is cancelled.

func (*Server) SendUpdate

func (s *Server) SendUpdate(sessionID acptypes.SessionID, update any) error

SendUpdate sends a session/update notification to the client and persists it for replay

func (*Server) Shutdown

func (s *Server) Shutdown()

Shutdown gracefully shuts down the server. It cancels the context and waits for in-flight requests to complete.

type ServerConfig

type ServerConfig struct {
	Provider             string
	Model                string
	MaxTokens            int
	NoSkills             bool
	NoWorkflows          bool
	DisableFSSearchTools bool
	DisableSubagent      bool
	NoHooks              bool
	MaxTurns             int
	CompactRatio         float64
	DisableAutoCompact   bool
}

ServerConfig holds configuration for the ACP server

Directories

Path Synopsis
Package acptypes defines types for the Agent Client Protocol (ACP).
Package acptypes defines types for the Agent Client Protocol (ACP).
Package bridge provides the bridge between kodelet's message handler system and the ACP session update protocol.
Package bridge provides the bridge between kodelet's message handler system and the ACP session update protocol.
Package session manages ACP session lifecycle, wrapping kodelet threads with ACP session semantics.
Package session manages ACP session lifecycle, wrapping kodelet threads with ACP session semantics.

Jump to

Keyboard shortcuts

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