Documentation
¶
Index ¶
- Constants
- func NewAgentServiceHandler(svc AgentServiceHandler, opts ...connect.HandlerOption) (string, http.Handler)
- type AgentServiceClient
- type AgentServiceHandler
- type UnimplementedAgentServiceHandler
- func (UnimplementedAgentServiceHandler) CreateSession(context.Context, *connect.Request[v1.CreateSessionRequest]) (*connect.Response[v1.CreateSessionResponse], error)
- func (UnimplementedAgentServiceHandler) DeleteSession(context.Context, *connect.Request[v1.DeleteSessionRequest]) (*connect.Response[v1.DeleteSessionResponse], error)
- func (UnimplementedAgentServiceHandler) GetAgent(context.Context, *connect.Request[v1.GetAgentRequest]) (*connect.Response[v1.GetAgentResponse], error)
- func (UnimplementedAgentServiceHandler) GetSession(context.Context, *connect.Request[v1.GetSessionRequest]) (*connect.Response[v1.GetSessionResponse], error)
- func (UnimplementedAgentServiceHandler) ListAgents(context.Context, *connect.Request[v1.ListAgentsRequest]) (*connect.Response[v1.ListAgentsResponse], error)
- func (UnimplementedAgentServiceHandler) ListSessions(context.Context, *connect.Request[v1.ListSessionsRequest]) (*connect.Response[v1.ListSessionsResponse], error)
- func (UnimplementedAgentServiceHandler) Ping(context.Context, *connect.Request[v1.PingRequest]) (*connect.Response[v1.PingResponse], error)
- func (UnimplementedAgentServiceHandler) ResumeElicitation(context.Context, *connect.Request[v1.ResumeElicitationRequest]) (*connect.Response[v1.ResumeElicitationResponse], error)
- func (UnimplementedAgentServiceHandler) ResumeSession(context.Context, *connect.Request[v1.ResumeSessionRequest]) (*connect.Response[v1.ResumeSessionResponse], error)
- func (UnimplementedAgentServiceHandler) RunAgent(context.Context, *connect.Request[v1.RunAgentRequest], ...) error
- func (UnimplementedAgentServiceHandler) ToggleToolApproval(context.Context, *connect.Request[v1.ToggleToolApprovalRequest]) (*connect.Response[v1.ToggleToolApprovalResponse], error)
Constants ¶
const ( // AgentServiceListAgentsProcedure is the fully-qualified name of the AgentService's ListAgents RPC. AgentServiceListAgentsProcedure = "/cagent.v1.AgentService/ListAgents" // AgentServiceGetAgentProcedure is the fully-qualified name of the AgentService's GetAgent RPC. AgentServiceGetAgentProcedure = "/cagent.v1.AgentService/GetAgent" // AgentServiceListSessionsProcedure is the fully-qualified name of the AgentService's ListSessions // RPC. AgentServiceListSessionsProcedure = "/cagent.v1.AgentService/ListSessions" // AgentServiceGetSessionProcedure is the fully-qualified name of the AgentService's GetSession RPC. AgentServiceGetSessionProcedure = "/cagent.v1.AgentService/GetSession" // AgentServiceCreateSessionProcedure is the fully-qualified name of the AgentService's // CreateSession RPC. AgentServiceCreateSessionProcedure = "/cagent.v1.AgentService/CreateSession" // AgentServiceDeleteSessionProcedure is the fully-qualified name of the AgentService's // DeleteSession RPC. AgentServiceDeleteSessionProcedure = "/cagent.v1.AgentService/DeleteSession" // AgentServiceResumeSessionProcedure is the fully-qualified name of the AgentService's // ResumeSession RPC. AgentServiceResumeSessionProcedure = "/cagent.v1.AgentService/ResumeSession" // AgentServiceToggleToolApprovalProcedure is the fully-qualified name of the AgentService's // ToggleToolApproval RPC. AgentServiceToggleToolApprovalProcedure = "/cagent.v1.AgentService/ToggleToolApproval" // AgentServiceResumeElicitationProcedure is the fully-qualified name of the AgentService's // ResumeElicitation RPC. AgentServiceResumeElicitationProcedure = "/cagent.v1.AgentService/ResumeElicitation" // AgentServiceRunAgentProcedure is the fully-qualified name of the AgentService's RunAgent RPC. AgentServiceRunAgentProcedure = "/cagent.v1.AgentService/RunAgent" // AgentServicePingProcedure is the fully-qualified name of the AgentService's Ping RPC. AgentServicePingProcedure = "/cagent.v1.AgentService/Ping" )
These constants are the fully-qualified names of the RPCs defined in this package. They're exposed at runtime as Spec.Procedure and as the final two segments of the HTTP route.
Note that these are different from the fully-qualified method names used by google.golang.org/protobuf/reflect/protoreflect. To convert from these constants to reflection-formatted method names, remove the leading slash and convert the remaining slash to a period.
const (
// AgentServiceName is the fully-qualified name of the AgentService service.
AgentServiceName = "cagent.v1.AgentService"
)
Variables ¶
This section is empty.
Functions ¶
func NewAgentServiceHandler ¶
func NewAgentServiceHandler(svc AgentServiceHandler, opts ...connect.HandlerOption) (string, http.Handler)
NewAgentServiceHandler builds an HTTP handler from the service implementation. It returns the path on which to mount the handler and the handler itself.
By default, handlers support the Connect, gRPC, and gRPC-Web protocols with the binary Protobuf and JSON codecs. They also support gzip compression.
Types ¶
type AgentServiceClient ¶
type AgentServiceClient interface {
// ListAgents returns all available agents.
ListAgents(context.Context, *connect.Request[v1.ListAgentsRequest]) (*connect.Response[v1.ListAgentsResponse], error)
// GetAgent returns the configuration for a specific agent.
GetAgent(context.Context, *connect.Request[v1.GetAgentRequest]) (*connect.Response[v1.GetAgentResponse], error)
// ListSessions returns all sessions.
ListSessions(context.Context, *connect.Request[v1.ListSessionsRequest]) (*connect.Response[v1.ListSessionsResponse], error)
// GetSession returns a specific session by ID.
GetSession(context.Context, *connect.Request[v1.GetSessionRequest]) (*connect.Response[v1.GetSessionResponse], error)
// CreateSession creates a new session.
CreateSession(context.Context, *connect.Request[v1.CreateSessionRequest]) (*connect.Response[v1.CreateSessionResponse], error)
// DeleteSession deletes a session by ID.
DeleteSession(context.Context, *connect.Request[v1.DeleteSessionRequest]) (*connect.Response[v1.DeleteSessionResponse], error)
// ResumeSession resumes a paused session (e.g., after tool confirmation).
ResumeSession(context.Context, *connect.Request[v1.ResumeSessionRequest]) (*connect.Response[v1.ResumeSessionResponse], error)
// ToggleToolApproval toggles the YOLO mode for a session.
ToggleToolApproval(context.Context, *connect.Request[v1.ToggleToolApprovalRequest]) (*connect.Response[v1.ToggleToolApprovalResponse], error)
// ResumeElicitation resumes an elicitation request.
ResumeElicitation(context.Context, *connect.Request[v1.ResumeElicitationRequest]) (*connect.Response[v1.ResumeElicitationResponse], error)
// RunAgent runs an agent loop and streams events.
RunAgent(context.Context, *connect.Request[v1.RunAgentRequest]) (*connect.ServerStreamForClient[v1.Event], error)
// Ping is a health check endpoint.
Ping(context.Context, *connect.Request[v1.PingRequest]) (*connect.Response[v1.PingResponse], error)
}
AgentServiceClient is a client for the cagent.v1.AgentService service.
func NewAgentServiceClient ¶
func NewAgentServiceClient(httpClient connect.HTTPClient, baseURL string, opts ...connect.ClientOption) AgentServiceClient
NewAgentServiceClient constructs a client for the cagent.v1.AgentService service. By default, it uses the Connect protocol with the binary Protobuf Codec, asks for gzipped responses, and sends uncompressed requests. To use the gRPC or gRPC-Web protocols, supply the connect.WithGRPC() or connect.WithGRPCWeb() options.
The URL supplied here should be the base URL for the Connect or gRPC server (for example, http://api.acme.com or https://acme.com/grpc).
type AgentServiceHandler ¶
type AgentServiceHandler interface {
// ListAgents returns all available agents.
ListAgents(context.Context, *connect.Request[v1.ListAgentsRequest]) (*connect.Response[v1.ListAgentsResponse], error)
// GetAgent returns the configuration for a specific agent.
GetAgent(context.Context, *connect.Request[v1.GetAgentRequest]) (*connect.Response[v1.GetAgentResponse], error)
// ListSessions returns all sessions.
ListSessions(context.Context, *connect.Request[v1.ListSessionsRequest]) (*connect.Response[v1.ListSessionsResponse], error)
// GetSession returns a specific session by ID.
GetSession(context.Context, *connect.Request[v1.GetSessionRequest]) (*connect.Response[v1.GetSessionResponse], error)
// CreateSession creates a new session.
CreateSession(context.Context, *connect.Request[v1.CreateSessionRequest]) (*connect.Response[v1.CreateSessionResponse], error)
// DeleteSession deletes a session by ID.
DeleteSession(context.Context, *connect.Request[v1.DeleteSessionRequest]) (*connect.Response[v1.DeleteSessionResponse], error)
// ResumeSession resumes a paused session (e.g., after tool confirmation).
ResumeSession(context.Context, *connect.Request[v1.ResumeSessionRequest]) (*connect.Response[v1.ResumeSessionResponse], error)
// ToggleToolApproval toggles the YOLO mode for a session.
ToggleToolApproval(context.Context, *connect.Request[v1.ToggleToolApprovalRequest]) (*connect.Response[v1.ToggleToolApprovalResponse], error)
// ResumeElicitation resumes an elicitation request.
ResumeElicitation(context.Context, *connect.Request[v1.ResumeElicitationRequest]) (*connect.Response[v1.ResumeElicitationResponse], error)
// RunAgent runs an agent loop and streams events.
RunAgent(context.Context, *connect.Request[v1.RunAgentRequest], *connect.ServerStream[v1.Event]) error
// Ping is a health check endpoint.
Ping(context.Context, *connect.Request[v1.PingRequest]) (*connect.Response[v1.PingResponse], error)
}
AgentServiceHandler is an implementation of the cagent.v1.AgentService service.
type UnimplementedAgentServiceHandler ¶
type UnimplementedAgentServiceHandler struct{}
UnimplementedAgentServiceHandler returns CodeUnimplemented from all methods.
func (UnimplementedAgentServiceHandler) CreateSession ¶
func (UnimplementedAgentServiceHandler) CreateSession(context.Context, *connect.Request[v1.CreateSessionRequest]) (*connect.Response[v1.CreateSessionResponse], error)
func (UnimplementedAgentServiceHandler) DeleteSession ¶
func (UnimplementedAgentServiceHandler) DeleteSession(context.Context, *connect.Request[v1.DeleteSessionRequest]) (*connect.Response[v1.DeleteSessionResponse], error)
func (UnimplementedAgentServiceHandler) GetAgent ¶
func (UnimplementedAgentServiceHandler) GetAgent(context.Context, *connect.Request[v1.GetAgentRequest]) (*connect.Response[v1.GetAgentResponse], error)
func (UnimplementedAgentServiceHandler) GetSession ¶
func (UnimplementedAgentServiceHandler) GetSession(context.Context, *connect.Request[v1.GetSessionRequest]) (*connect.Response[v1.GetSessionResponse], error)
func (UnimplementedAgentServiceHandler) ListAgents ¶
func (UnimplementedAgentServiceHandler) ListAgents(context.Context, *connect.Request[v1.ListAgentsRequest]) (*connect.Response[v1.ListAgentsResponse], error)
func (UnimplementedAgentServiceHandler) ListSessions ¶
func (UnimplementedAgentServiceHandler) ListSessions(context.Context, *connect.Request[v1.ListSessionsRequest]) (*connect.Response[v1.ListSessionsResponse], error)
func (UnimplementedAgentServiceHandler) Ping ¶
func (UnimplementedAgentServiceHandler) Ping(context.Context, *connect.Request[v1.PingRequest]) (*connect.Response[v1.PingResponse], error)
func (UnimplementedAgentServiceHandler) ResumeElicitation ¶
func (UnimplementedAgentServiceHandler) ResumeElicitation(context.Context, *connect.Request[v1.ResumeElicitationRequest]) (*connect.Response[v1.ResumeElicitationResponse], error)
func (UnimplementedAgentServiceHandler) ResumeSession ¶
func (UnimplementedAgentServiceHandler) ResumeSession(context.Context, *connect.Request[v1.ResumeSessionRequest]) (*connect.Response[v1.ResumeSessionResponse], error)
func (UnimplementedAgentServiceHandler) RunAgent ¶
func (UnimplementedAgentServiceHandler) RunAgent(context.Context, *connect.Request[v1.RunAgentRequest], *connect.ServerStream[v1.Event]) error
func (UnimplementedAgentServiceHandler) ToggleToolApproval ¶
func (UnimplementedAgentServiceHandler) ToggleToolApproval(context.Context, *connect.Request[v1.ToggleToolApprovalRequest]) (*connect.Response[v1.ToggleToolApprovalResponse], error)