acpserver

package
v0.12.2 Latest Latest
Warning

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

Go to latest
Published: Mar 16, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Overview

Package acpserver implements a Kit-backed ACP (Agent Client Protocol) agent.

It bridges Kit's LLM execution, tool system, and session management to the ACP protocol over stdio, allowing ACP clients (such as OpenCode) to drive Kit as a remote coding agent.

Index

Constants

This section is empty.

Variables

View Source
var Version = "dev"

Version is injected at build time; fallback to "dev".

Functions

This section is empty.

Types

type Agent

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

Agent implements the acp.Agent interface, delegating to Kit for LLM execution, tool calls, and session management.

func NewAgent

func NewAgent() *Agent

NewAgent creates a new ACP agent backed by Kit.

func (*Agent) Authenticate

Authenticate handles authentication requests. Kit doesn't require auth for local stdio usage, so this is a no-op.

func (*Agent) Cancel

func (a *Agent) Cancel(_ context.Context, params acp.CancelNotification) error

Cancel cancels the ongoing prompt for a session.

func (*Agent) Close

func (a *Agent) Close()

Close shuts down all active sessions.

func (*Agent) Initialize

func (a *Agent) Initialize(_ context.Context, params acp.InitializeRequest) (acp.InitializeResponse, error)

Initialize negotiates capabilities with the ACP client.

func (*Agent) NewSession

func (a *Agent) NewSession(ctx context.Context, params acp.NewSessionRequest) (acp.NewSessionResponse, error)

NewSession creates a new Kit session for the given working directory.

func (*Agent) Prompt

func (a *Agent) Prompt(ctx context.Context, params acp.PromptRequest) (acp.PromptResponse, error)

Prompt handles the main agent execution. It subscribes to Kit's event bus, converts events to ACP session updates, and runs the prompt through Kit's full turn lifecycle (hooks, LLM, tool calls, persistence).

func (*Agent) SetAgentConnection

func (a *Agent) SetAgentConnection(conn *acp.AgentSideConnection)

SetAgentConnection stores the connection so the agent can send session updates (streaming, tool calls, etc.) back to the ACP client. This follows the AgentConnAware duck-typing pattern from the SDK.

func (*Agent) SetSessionMode

SetSessionMode is a no-op for now — Kit doesn't have built-in session modes.

Jump to

Keyboard shortcuts

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