Documentation
¶
Index ¶
- func NewGRPCServer(svc *agent.Service, notesStore *notes.Store, notesMaxBytes, notesMaxCount int, ...) runtimev1.AgentRuntimeServer
- type GRPCServer
- func (s *GRPCServer) Chat(ctx context.Context, req *runtimev1.ChatRequest) (*runtimev1.ChatResponse, error)
- func (s *GRPCServer) ChatStream(req *runtimev1.ChatStreamRequest, ...) error
- func (s *GRPCServer) DeleteNote(ctx context.Context, req *runtimev1.DeleteNoteRequest) (*runtimev1.DeleteNoteResponse, error)
- func (s *GRPCServer) DeleteSession(ctx context.Context, req *runtimev1.DeleteSessionRequest) (*runtimev1.DeleteSessionResponse, error)
- func (s *GRPCServer) GetNote(ctx context.Context, req *runtimev1.GetNoteRequest) (*runtimev1.GetNoteResponse, error)
- func (s *GRPCServer) Health(_ context.Context, _ *runtimev1.HealthRequest) (*runtimev1.HealthResponse, error)
- func (s *GRPCServer) ListNotes(ctx context.Context, req *runtimev1.ListNotesRequest) (*runtimev1.ListNotesResponse, error)
- func (s *GRPCServer) ListSessionMessages(ctx context.Context, req *runtimev1.ListSessionMessagesRequest) (*runtimev1.ListSessionMessagesResponse, error)
- func (s *GRPCServer) ListSessions(ctx context.Context, _ *runtimev1.ListSessionsRequest) (*runtimev1.ListSessionsResponse, error)
- func (s *GRPCServer) PromptObject(ctx context.Context, req *runtimev1.PromptObjectRequest) (*runtimev1.PromptObjectResponse, error)
- func (s *GRPCServer) Ready(_ context.Context, _ *runtimev1.ReadyRequest) (*runtimev1.ReadyResponse, error)
- func (s *GRPCServer) SaveNote(ctx context.Context, req *runtimev1.SaveNoteRequest) (*runtimev1.SaveNoteResponse, error)
- func (s *GRPCServer) SetNoteInContext(ctx context.Context, req *runtimev1.SetNoteInContextRequest) (*runtimev1.SetNoteInContextResponse, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewGRPCServer ¶
func NewGRPCServer( svc *agent.Service, notesStore *notes.Store, notesMaxBytes, notesMaxCount int, agentName, model string, ) runtimev1.AgentRuntimeServer
NewGRPCServer constructs the runtime's gRPC server. notesStore / maxBytes / maxCount are optional: when nil/0 the Notes RPCs reply with codes.Unavailable so a dev invocation of the runtime binary without a notes store doesn't silently accept writes.
Types ¶
type GRPCServer ¶
type GRPCServer struct {
runtimev1.UnimplementedAgentRuntimeServer
// contains filtered or unexported fields
}
func (*GRPCServer) Chat ¶
func (s *GRPCServer) Chat(ctx context.Context, req *runtimev1.ChatRequest) (*runtimev1.ChatResponse, error)
func (*GRPCServer) ChatStream ¶
func (s *GRPCServer) ChatStream( req *runtimev1.ChatStreamRequest, stream runtimev1.AgentRuntime_ChatStreamServer, ) error
func (*GRPCServer) DeleteNote ¶
func (s *GRPCServer) DeleteNote( ctx context.Context, req *runtimev1.DeleteNoteRequest, ) (*runtimev1.DeleteNoteResponse, error)
func (*GRPCServer) DeleteSession ¶
func (s *GRPCServer) DeleteSession( ctx context.Context, req *runtimev1.DeleteSessionRequest, ) (*runtimev1.DeleteSessionResponse, error)
func (*GRPCServer) GetNote ¶
func (s *GRPCServer) GetNote( ctx context.Context, req *runtimev1.GetNoteRequest, ) (*runtimev1.GetNoteResponse, error)
func (*GRPCServer) Health ¶
func (s *GRPCServer) Health( _ context.Context, _ *runtimev1.HealthRequest, ) (*runtimev1.HealthResponse, error)
func (*GRPCServer) ListNotes ¶
func (s *GRPCServer) ListNotes( ctx context.Context, req *runtimev1.ListNotesRequest, ) (*runtimev1.ListNotesResponse, error)
func (*GRPCServer) ListSessionMessages ¶
func (s *GRPCServer) ListSessionMessages( ctx context.Context, req *runtimev1.ListSessionMessagesRequest, ) (*runtimev1.ListSessionMessagesResponse, error)
func (*GRPCServer) ListSessions ¶
func (s *GRPCServer) ListSessions( ctx context.Context, _ *runtimev1.ListSessionsRequest, ) (*runtimev1.ListSessionsResponse, error)
func (*GRPCServer) PromptObject ¶
func (s *GRPCServer) PromptObject( ctx context.Context, req *runtimev1.PromptObjectRequest, ) (*runtimev1.PromptObjectResponse, error)
func (*GRPCServer) Ready ¶
func (s *GRPCServer) Ready( _ context.Context, _ *runtimev1.ReadyRequest, ) (*runtimev1.ReadyResponse, error)
Ready is the daemon supervisor's readiness probe. The daemon hits this in a backoff loop after spawning the runtime subprocess; the first successful response flips the agent from Starting → Ready.
Two layers of "ready" stack here:
- Reachability: until the gRPC listener has bound and accepted the dial, the daemon's probe gets Unavailable / connection- refused and retries. So just answering this RPC at all already means "process up, gRPC alive, accepting traffic."
- Service: svc != nil means the agent.Service was constructed — i.e. the model client is loaded, context files are read, the session store is open. The current runtime startup (serve.go) guarantees this before NewGRPCServer is called, so in practice this is always true once the server is up.
Returning {Ready: false} is reserved for a future world where the server starts before svc finishes loading (e.g. lazy model init). We keep the field so the daemon can keep probing without a wire change when that lands.
func (*GRPCServer) SaveNote ¶
func (s *GRPCServer) SaveNote( ctx context.Context, req *runtimev1.SaveNoteRequest, ) (*runtimev1.SaveNoteResponse, error)
func (*GRPCServer) SetNoteInContext ¶
func (s *GRPCServer) SetNoteInContext( ctx context.Context, req *runtimev1.SetNoteInContextRequest, ) (*runtimev1.SetNoteInContextResponse, error)