Documentation
¶
Overview ¶
Package acp is the Agent Client Protocol frontend: an editor runs codebot as a child process and drives it over JSON-RPC on stdio. Stdout is the protocol channel, so nothing else may write to it.
Index ¶
- type EditorFS
- func (w *EditorFS) Open(ctx context.Context, path string) (io.ReadCloser, error)
- func (w *EditorFS) ReadFile(ctx context.Context, path string) ([]byte, error)
- func (w *EditorFS) Stat(ctx context.Context, path string) (agentcoretools.FileInfo, error)
- func (w *EditorFS) WriteFile(ctx context.Context, path string, data []byte, perm fs.FileMode) error
- type Server
- func (s *Server) Approve(ctx context.Context, p interact.Approval) (interact.Verdict, error)
- func (s *Server) Ask(context.Context, []interact.Question) (interact.Answers, error)
- func (s *Server) Authenticate(context.Context, acp.AuthenticateRequest) (acp.AuthenticateResponse, error)
- func (s *Server) Cancel(context.Context, acp.CancelNotification) error
- func (s *Server) CloseSession(context.Context, acp.CloseSessionRequest) (acp.CloseSessionResponse, error)
- func (s *Server) FS() agentcoretools.FS
- func (s *Server) Initialize(_ context.Context, req acp.InitializeRequest) (acp.InitializeResponse, error)
- func (s *Server) ListSessions(context.Context, acp.ListSessionsRequest) (acp.ListSessionsResponse, error)
- func (s *Server) Logout(context.Context, acp.LogoutRequest) (acp.LogoutResponse, error)
- func (s *Server) NewSession(_ context.Context, req acp.NewSessionRequest) (acp.NewSessionResponse, error)
- func (s *Server) Prompt(ctx context.Context, req acp.PromptRequest) (acp.PromptResponse, error)
- func (s *Server) ResumeSession(context.Context, acp.ResumeSessionRequest) (acp.ResumeSessionResponse, error)
- func (s *Server) Serve(a *app.App) error
- func (s *Server) SetSessionConfigOption(context.Context, acp.SetSessionConfigOptionRequest) (acp.SetSessionConfigOptionResponse, error)
- func (s *Server) SetSessionMode(_ context.Context, req acp.SetSessionModeRequest) (acp.SetSessionModeResponse, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type EditorFS ¶
type EditorFS struct {
agentcoretools.OSFS
// contains filtered or unexported fields
}
EditorFS routes text file reads and writes to the editor, so the agent sees unsaved buffers and its writes land in them. Everything else, including files the editor can't serve as text, uses the local filesystem.
It is built before Boot, while the connection only exists once Serve starts; until bound it behaves like the local filesystem.
func NewEditorFS ¶
func NewEditorFS() *EditorFS
NewEditorFS logs to stderr because stdout is the protocol channel.
func (*EditorFS) Open ¶
Open falls back to disk on purpose: images and binaries are read that way, since the editor's text endpoint rejects them. A read is harmless; a write is not (see WriteFile).
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server serves only the conversation opened at boot; session/load and multiple sessions are not supported.
func (*Server) Authenticate ¶
func (s *Server) Authenticate(context.Context, acp.AuthenticateRequest) (acp.AuthenticateResponse, error)
func (*Server) CloseSession ¶
func (s *Server) CloseSession(context.Context, acp.CloseSessionRequest) (acp.CloseSessionResponse, error)
func (*Server) FS ¶
func (s *Server) FS() agentcoretools.FS
func (*Server) Initialize ¶
func (s *Server) Initialize(_ context.Context, req acp.InitializeRequest) (acp.InitializeResponse, error)
func (*Server) ListSessions ¶
func (s *Server) ListSessions(context.Context, acp.ListSessionsRequest) (acp.ListSessionsResponse, error)
func (*Server) Logout ¶
func (s *Server) Logout(context.Context, acp.LogoutRequest) (acp.LogoutResponse, error)
func (*Server) NewSession ¶
func (s *Server) NewSession(_ context.Context, req acp.NewSessionRequest) (acp.NewSessionResponse, error)
func (*Server) Prompt ¶
func (s *Server) Prompt(ctx context.Context, req acp.PromptRequest) (acp.PromptResponse, error)
Prompt answers only after every update of the turn has been sent.
func (*Server) ResumeSession ¶
func (s *Server) ResumeSession(context.Context, acp.ResumeSessionRequest) (acp.ResumeSessionResponse, error)
func (*Server) SetSessionConfigOption ¶
func (s *Server) SetSessionConfigOption(context.Context, acp.SetSessionConfigOptionRequest) (acp.SetSessionConfigOptionResponse, error)
func (*Server) SetSessionMode ¶
func (s *Server) SetSessionMode(_ context.Context, req acp.SetSessionModeRequest) (acp.SetSessionModeResponse, error)