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 ¶
- type Option
- type RemoteChatClient
- type RemoteChatProvider
- type RemoteCommandSource
- type RemoteSessionConfig
- type Server
- func (s *Server) CallClient(ctx context.Context, method string, params any) (json.RawMessage, error)
- func (s *Server) GetClientCapabilities() *acptypes.ClientCapabilities
- func (s *Server) Run() error
- func (s *Server) SendTransientUpdate(sessionID acptypes.SessionID, update any) error
- func (s *Server) SendUpdate(sessionID acptypes.SessionID, update any) error
- func (s *Server) Shutdown()
- type ServerConfig
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 WithRemoteSessions ¶
func WithRemoteSessions(config RemoteSessionConfig) Option
WithRemoteSessions configures ACP to use a control-plane-owned agentic loop backed by an embedded local workspace runner.
type RemoteChatClient ¶
type RemoteChatClient interface {
chat.ChatRunner
chat.ConversationSource
StopConversation(ctx context.Context, conversationID string) error
StopConversationTurn(ctx context.Context, conversationID, turnID string) error
}
RemoteChatClient is the control-plane API required by server-backed ACP sessions.
type RemoteChatProvider ¶
type RemoteChatProvider interface {
WaitForRemoteChat(ctx context.Context) (RemoteChatClient, string, error)
}
RemoteChatProvider waits until the selected workspace runner has a ready control-plane client.
type RemoteCommandSource ¶
type RemoteCommandSource interface {
Commands(ctx context.Context, environmentProfile string) ([]slashcommands.Command, error)
}
RemoteCommandSource discovers slash commands owned by the selected workspace runner.
type RemoteSessionConfig ¶
type RemoteSessionConfig struct {
Provider RemoteChatProvider
Workspace string
Profile string
ReasoningEffort string
EnvironmentProfile string
EnvironmentProfileExplicit bool
CommandSource RemoteCommandSource
ReadinessTimeout time.Duration
}
RemoteSessionConfig configures ACP sessions whose agentic loop runs on a control plane.
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 (*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 ¶
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) SendTransientUpdate ¶
SendTransientUpdate sends a session/update notification without persisting it for replay. Streaming tool snapshots are superseded by the final result.
func (*Server) SendUpdate ¶
SendUpdate sends a session/update notification to the client and persists it for replay
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. |