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 ¶
- Variables
- type Agent
- func (a *Agent) Authenticate(_ context.Context, _ acp.AuthenticateRequest) (acp.AuthenticateResponse, error)
- func (a *Agent) Cancel(_ context.Context, params acp.CancelNotification) error
- func (a *Agent) Close()
- func (a *Agent) Initialize(_ context.Context, params acp.InitializeRequest) (acp.InitializeResponse, error)
- func (a *Agent) ListSessions(_ context.Context, _ acp.ListSessionsRequest) (acp.ListSessionsResponse, error)
- func (a *Agent) NewSession(ctx context.Context, params acp.NewSessionRequest) (acp.NewSessionResponse, error)
- func (a *Agent) Prompt(ctx context.Context, params acp.PromptRequest) (acp.PromptResponse, error)
- func (a *Agent) SetAgentConnection(conn *acp.AgentSideConnection)
- func (a *Agent) SetSessionConfigOption(ctx context.Context, params acp.SetSessionConfigOptionRequest) (acp.SetSessionConfigOptionResponse, error)
- func (a *Agent) SetSessionMode(_ context.Context, _ acp.SetSessionModeRequest) (acp.SetSessionModeResponse, error)
Constants ¶
This section is empty.
Variables ¶
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
}
execution, tool calls, and session management.
func (*Agent) Authenticate ¶
func (a *Agent) Authenticate(_ context.Context, _ acp.AuthenticateRequest) (acp.AuthenticateResponse, error)
Authenticate handles authentication requests. Kit doesn't require auth for local stdio usage, so this is a no-op.
func (*Agent) Initialize ¶
func (a *Agent) Initialize(_ context.Context, params acp.InitializeRequest) (acp.InitializeResponse, error)
Initialize negotiates capabilities with the ACP client.
func (*Agent) ListSessions ¶ added in v0.58.2
func (a *Agent) ListSessions(_ context.Context, _ acp.ListSessionsRequest) (acp.ListSessionsResponse, error)
ListSessions returns an empty session list. Kit doesn't persist sessions across restarts in ACP mode, so this is effectively a no-op.
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) SetSessionConfigOption ¶ added in v0.58.2
func (a *Agent) SetSessionConfigOption(ctx context.Context, params acp.SetSessionConfigOptionRequest) (acp.SetSessionConfigOptionResponse, error)
SetSessionConfigOption handles session configuration changes. Currently supports the "model" config option to change the active model for a session.
func (*Agent) SetSessionMode ¶
func (a *Agent) SetSessionMode(_ context.Context, _ acp.SetSessionModeRequest) (acp.SetSessionModeResponse, error)
SetSessionMode is a no-op for now — Kit doesn't have built-in session modes.