Documentation
¶
Overview ¶
Package connectrpc provides a Connect-RPC server implementation for the cagent API.
Index ¶
- type Server
- func (s *Server) CreateSession(ctx context.Context, req *connect.Request[cagentv1.CreateSessionRequest]) (*connect.Response[cagentv1.CreateSessionResponse], error)
- func (s *Server) DeleteSession(ctx context.Context, req *connect.Request[cagentv1.DeleteSessionRequest]) (*connect.Response[cagentv1.DeleteSessionResponse], error)
- func (s *Server) GetAgent(ctx context.Context, req *connect.Request[cagentv1.GetAgentRequest]) (*connect.Response[cagentv1.GetAgentResponse], error)
- func (s *Server) GetSession(ctx context.Context, req *connect.Request[cagentv1.GetSessionRequest]) (*connect.Response[cagentv1.GetSessionResponse], error)
- func (s *Server) Handler() http.Handler
- func (s *Server) ListAgents(ctx context.Context, _ *connect.Request[cagentv1.ListAgentsRequest]) (*connect.Response[cagentv1.ListAgentsResponse], error)
- func (s *Server) ListSessions(ctx context.Context, _ *connect.Request[cagentv1.ListSessionsRequest]) (*connect.Response[cagentv1.ListSessionsResponse], error)
- func (s *Server) Ping(_ context.Context, _ *connect.Request[cagentv1.PingRequest]) (*connect.Response[cagentv1.PingResponse], error)
- func (s *Server) ResumeElicitation(ctx context.Context, req *connect.Request[cagentv1.ResumeElicitationRequest]) (*connect.Response[cagentv1.ResumeElicitationResponse], error)
- func (s *Server) ResumeSession(ctx context.Context, req *connect.Request[cagentv1.ResumeSessionRequest]) (*connect.Response[cagentv1.ResumeSessionResponse], error)
- func (s *Server) RunAgent(ctx context.Context, req *connect.Request[cagentv1.RunAgentRequest], ...) error
- func (s *Server) Serve(ctx context.Context, ln net.Listener) error
- func (s *Server) ToggleToolApproval(ctx context.Context, req *connect.Request[cagentv1.ToggleToolApprovalRequest]) (*connect.Response[cagentv1.ToggleToolApprovalResponse], error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server implements the Connect-RPC AgentService.
func New ¶
func New(ctx context.Context, sessionStore session.Store, runConfig *config.RuntimeConfig, refreshInterval time.Duration, agentSources config.Sources) (*Server, error)
New creates a new Connect-RPC server.
func (*Server) CreateSession ¶
func (s *Server) CreateSession(ctx context.Context, req *connect.Request[cagentv1.CreateSessionRequest]) (*connect.Response[cagentv1.CreateSessionResponse], error)
CreateSession creates a new session.
func (*Server) DeleteSession ¶
func (s *Server) DeleteSession(ctx context.Context, req *connect.Request[cagentv1.DeleteSessionRequest]) (*connect.Response[cagentv1.DeleteSessionResponse], error)
DeleteSession deletes a session by ID.
func (*Server) GetAgent ¶
func (s *Server) GetAgent(ctx context.Context, req *connect.Request[cagentv1.GetAgentRequest]) (*connect.Response[cagentv1.GetAgentResponse], error)
GetAgent returns the configuration for a specific agent.
func (*Server) GetSession ¶
func (s *Server) GetSession(ctx context.Context, req *connect.Request[cagentv1.GetSessionRequest]) (*connect.Response[cagentv1.GetSessionResponse], error)
GetSession returns a specific session by ID.
func (*Server) ListAgents ¶
func (s *Server) ListAgents(ctx context.Context, _ *connect.Request[cagentv1.ListAgentsRequest]) (*connect.Response[cagentv1.ListAgentsResponse], error)
ListAgents returns all available agents.
func (*Server) ListSessions ¶
func (s *Server) ListSessions(ctx context.Context, _ *connect.Request[cagentv1.ListSessionsRequest]) (*connect.Response[cagentv1.ListSessionsResponse], error)
ListSessions returns all sessions.
func (*Server) Ping ¶
func (s *Server) Ping(_ context.Context, _ *connect.Request[cagentv1.PingRequest]) (*connect.Response[cagentv1.PingResponse], error)
Ping is a health check endpoint.
func (*Server) ResumeElicitation ¶
func (s *Server) ResumeElicitation(ctx context.Context, req *connect.Request[cagentv1.ResumeElicitationRequest]) (*connect.Response[cagentv1.ResumeElicitationResponse], error)
ResumeElicitation resumes an elicitation request.
func (*Server) ResumeSession ¶
func (s *Server) ResumeSession(ctx context.Context, req *connect.Request[cagentv1.ResumeSessionRequest]) (*connect.Response[cagentv1.ResumeSessionResponse], error)
ResumeSession resumes a paused session.
func (*Server) RunAgent ¶
func (s *Server) RunAgent(ctx context.Context, req *connect.Request[cagentv1.RunAgentRequest], stream *connect.ServerStream[cagentv1.Event]) error
RunAgent runs an agent loop and streams events.
func (*Server) ToggleToolApproval ¶
func (s *Server) ToggleToolApproval(ctx context.Context, req *connect.Request[cagentv1.ToggleToolApprovalRequest]) (*connect.Response[cagentv1.ToggleToolApprovalResponse], error)
ToggleToolApproval toggles the YOLO mode for a session.