Documentation
¶
Overview ¶
Package acp implements the Agent Client Protocol (ACP) for Oni3 using the official Go SDK (github.com/coder/acp-go-sdk).
ACP is an open standard (https://agentclientprotocol.com) that standardizes communication between code editors/IDEs (clients) and coding agents. Messages are JSON-RPC 2.0 objects, one per line, exchanged over stdio.
Index ¶
- type Service
- func (s *Service) Authenticate(ctx context.Context, params acp.AuthenticateRequest) (acp.AuthenticateResponse, error)
- func (s *Service) Cancel(ctx context.Context, params acp.CancelNotification) error
- func (s *Service) CloseSession(ctx context.Context, params acp.CloseSessionRequest) (acp.CloseSessionResponse, error)
- func (s *Service) Initialize(ctx context.Context, params acp.InitializeRequest) (acp.InitializeResponse, error)
- func (s *Service) ListSessions(ctx context.Context, params acp.ListSessionsRequest) (acp.ListSessionsResponse, error)
- func (s *Service) LoadSession(ctx context.Context, params acp.LoadSessionRequest) (acp.LoadSessionResponse, error)
- func (s *Service) Logout(ctx context.Context, params acp.LogoutRequest) (acp.LogoutResponse, error)
- func (s *Service) NewSession(ctx context.Context, params acp.NewSessionRequest) (acp.NewSessionResponse, error)
- func (s *Service) Prompt(ctx context.Context, params acp.PromptRequest) (acp.PromptResponse, error)
- func (s *Service) ResumeSession(ctx context.Context, params acp.ResumeSessionRequest) (acp.ResumeSessionResponse, error)
- func (s *Service) SetAgentConnection(conn *acp.AgentSideConnection)
- func (s *Service) SetSessionConfigOption(ctx context.Context, params acp.SetSessionConfigOptionRequest) (acp.SetSessionConfigOptionResponse, error)
- func (s *Service) SetSessionMode(ctx context.Context, params acp.SetSessionModeRequest) (acp.SetSessionModeResponse, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service is the Oni3 ACP agent. It bridges ACP sessions to the configured Eino ReAct agent and streams turns to the client.
func NewService ¶
NewService creates an ACP agent bound to the given configured agent name.
func (*Service) Authenticate ¶
func (s *Service) Authenticate(ctx context.Context, params acp.AuthenticateRequest) (acp.AuthenticateResponse, error)
Authenticate is unused: the agent advertises no auth methods.
func (*Service) Cancel ¶
Cancel aborts the running prompt turn. The SDK has already cancelled the prompt context before calling this method.
func (*Service) CloseSession ¶
func (s *Service) CloseSession(ctx context.Context, params acp.CloseSessionRequest) (acp.CloseSessionResponse, error)
CloseSession releases the in-memory state; the persisted conversation stays on disk for later resume.
func (*Service) Initialize ¶
func (s *Service) Initialize(ctx context.Context, params acp.InitializeRequest) (acp.InitializeResponse, error)
Initialize negotiates the protocol version and capabilities.
func (*Service) ListSessions ¶
func (s *Service) ListSessions(ctx context.Context, params acp.ListSessionsRequest) (acp.ListSessionsResponse, error)
ListSessions reports the persisted agent conversations so clients can offer "resume with oni3" across runs.
func (*Service) LoadSession ¶ added in v0.4.0
func (s *Service) LoadSession(ctx context.Context, params acp.LoadSessionRequest) (acp.LoadSessionResponse, error)
LoadSession replays a persisted conversation into a live ACP session. The client keeps using the id it passed; the on-disk conversation continues.
func (*Service) Logout ¶
func (s *Service) Logout(ctx context.Context, params acp.LogoutRequest) (acp.LogoutResponse, error)
func (*Service) NewSession ¶
func (s *Service) NewSession(ctx context.Context, params acp.NewSessionRequest) (acp.NewSessionResponse, error)
NewSession creates a session backed by the configured agent.
func (*Service) Prompt ¶
func (s *Service) Prompt(ctx context.Context, params acp.PromptRequest) (acp.PromptResponse, error)
Prompt runs one prompt turn, streaming updates back to the client. The SDK cancels the returned context when it receives session/cancel.
func (*Service) ResumeSession ¶
func (s *Service) ResumeSession(ctx context.Context, params acp.ResumeSessionRequest) (acp.ResumeSessionResponse, error)
ResumeSession continues a stored conversation under a fresh ACP session id. Unlike session/load it does not replay the previous messages to the client; the history is present as model context and new turns append to the same on-disk conversation.
func (*Service) SetAgentConnection ¶
func (s *Service) SetAgentConnection(conn *acp.AgentSideConnection)
SetAgentConnection implements acp.AgentConnAware; the SDK calls it right after constructing the connection.
func (*Service) SetSessionConfigOption ¶
func (s *Service) SetSessionConfigOption(ctx context.Context, params acp.SetSessionConfigOptionRequest) (acp.SetSessionConfigOptionResponse, error)
SetSessionConfigOption applies a model or skill switch and rebuilds the agent of that session, mirroring the TUI /model and /skill commands.
func (*Service) SetSessionMode ¶
func (s *Service) SetSessionMode(ctx context.Context, params acp.SetSessionModeRequest) (acp.SetSessionModeResponse, error)