Documentation
¶
Overview ¶
Package server exposes Peen's client-facing Serbewr HTTP API.
Index ¶
- Constants
- Variables
- type Dependencies
- type Server
- func (s *Server) CancelSession(ctx context.Context, request api.CancelSessionRequestObject) (api.CancelSessionResponseObject, error)
- func (s *Server) CancelSessionAgentRun(ctx context.Context, request api.CancelSessionAgentRunRequestObject) (api.CancelSessionAgentRunResponseObject, error)
- func (s *Server) GetSession(ctx context.Context, request api.GetSessionRequestObject) (api.GetSessionResponseObject, error)
- func (s *Server) GetSessionAgentRun(ctx context.Context, request api.GetSessionAgentRunRequestObject) (api.GetSessionAgentRunResponseObject, error)
- func (s *Server) GetSessionCompaction(ctx context.Context, request api.GetSessionCompactionRequestObject) (api.GetSessionCompactionResponseObject, error)
- func (s *Server) GetSessionContextSnapshot(ctx context.Context, request api.GetSessionContextSnapshotRequestObject) (api.GetSessionContextSnapshotResponseObject, error)
- func (s *Server) GetSessionPromptSnapshot(ctx context.Context, request api.GetSessionPromptSnapshotRequestObject) (api.GetSessionPromptSnapshotResponseObject, error)
- func (s *Server) ListMessages(ctx context.Context, request api.ListMessagesRequestObject) (api.ListMessagesResponseObject, error)
- func (s *Server) ListSessionAgentRunEvents(ctx context.Context, request api.ListSessionAgentRunEventsRequestObject) (api.ListSessionAgentRunEventsResponseObject, error)
- func (s *Server) ListSessionAgentRuns(ctx context.Context, request api.ListSessionAgentRunsRequestObject) (api.ListSessionAgentRunsResponseObject, error)
- func (s *Server) ListSessionCompactions(ctx context.Context, request api.ListSessionCompactionsRequestObject) (api.ListSessionCompactionsResponseObject, error)
- func (s *Server) ListSessionEvents(ctx context.Context, request api.ListSessionEventsRequestObject) (api.ListSessionEventsResponseObject, error)
- func (s *Server) ListSessionJobSignalRequests(ctx context.Context, request api.ListSessionJobSignalRequestsRequestObject) (api.ListSessionJobSignalRequestsResponseObject, error)
- func (s *Server) ListSessionJobs(ctx context.Context, request api.ListSessionJobsRequestObject) (api.ListSessionJobsResponseObject, error)
- func (s *Server) ListSessionModelRunCalls(ctx context.Context, request api.ListSessionModelRunCallsRequestObject) (api.ListSessionModelRunCallsResponseObject, error)
- func (s *Server) ListSessionModelRuns(ctx context.Context, request api.ListSessionModelRunsRequestObject) (api.ListSessionModelRunsResponseObject, error)
- func (s *Server) ListSessionNotices(ctx context.Context, request api.ListSessionNoticesRequestObject) (api.ListSessionNoticesResponseObject, error)
- func (s *Server) ListSessionTurns(ctx context.Context, request api.ListSessionTurnsRequestObject) (api.ListSessionTurnsResponseObject, error)
- func (s *Server) PublishSessionNotice(ctx context.Context, request api.PublishSessionNoticeRequestObject) (api.PublishSessionNoticeResponseObject, error)
- func (s *Server) ReadSessionJobOutput(ctx context.Context, request api.ReadSessionJobOutputRequestObject) (api.ReadSessionJobOutputResponseObject, error)
- func (s *Server) Serve(ctx context.Context) error
- func (s *Server) SignalSessionJob(ctx context.Context, request api.SignalSessionJobRequestObject) (api.SignalSessionJobResponseObject, error)
- func (s *Server) Stop(ctx context.Context) error
Constants ¶
const ( // ErrorCodeInvalidSessionID reports a malformed X-Session-ID header. ErrorCodeInvalidSessionID aichteeteapee.ErrorCode = "INVALID_SESSION_ID" // ErrorCodeSessionNotFound reports a well-formed but unknown session ID. ErrorCodeSessionNotFound aichteeteapee.ErrorCode = "SESSION_NOT_FOUND" // ErrorCodeSessionBusy reports a session with an already active turn. ErrorCodeSessionBusy aichteeteapee.ErrorCode = "SESSION_BUSY" // ErrorCodeTurnCancelled reports a turn that ended because its session // was explicitly cancelled. ErrorCodeTurnCancelled aichteeteapee.ErrorCode = "TURN_CANCELLED" // ErrorCodeUserMessageQueueFull reports an active turn that cannot accept // another queued user message. ErrorCodeUserMessageQueueFull = aichteeteapee.ErrorCode( "USER_MESSAGE_QUEUE_FULL", ) )
Peen's documented contract distinguishes four session-scoped failures that aichteeteapee's generic codes would otherwise collapse into NOT_FOUND, CONFLICT, and BAD_REQUEST. aichteeteapee.ErrorCode is a plain string alias, so Peen defines its own values on it rather than rolling a separate error envelope.
Variables ¶
var ErrMissingDependency = errors.New("HTTP server dependency is required")
ErrMissingDependency reports an incomplete HTTP server constructor input.
Functions ¶
This section is empty.
Types ¶
type Dependencies ¶
type Dependencies struct {
Runtime agent.API
APIToken string
ListenAddress string
Metrics *metrics.Metrics
ServiceContext func() context.Context
}
Dependencies are the transport-neutral operations required by the API.
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server owns Peen's Serbewr listener and its generated OpenAPI handler.
func New ¶
func New(deps Dependencies) (*Server, error)
New constructs a fully-wired HTTP server without opening a listener.
func (*Server) CancelSession ¶
func (s *Server) CancelSession( ctx context.Context, request api.CancelSessionRequestObject, ) (api.CancelSessionResponseObject, error)
CancelSession asks an active agent turn to stop without deleting its session.
func (*Server) CancelSessionAgentRun ¶
func (s *Server) CancelSessionAgentRun( ctx context.Context, request api.CancelSessionAgentRunRequestObject, ) (api.CancelSessionAgentRunResponseObject, error)
CancelSessionAgentRun stops one child agent without ending its parent turn.
func (*Server) GetSession ¶
func (s *Server) GetSession( ctx context.Context, request api.GetSessionRequestObject, ) (api.GetSessionResponseObject, error)
GetSession returns durable metadata and active-turn state for one session.
func (*Server) GetSessionAgentRun ¶ added in v0.4.0
func (s *Server) GetSessionAgentRun( ctx context.Context, request api.GetSessionAgentRunRequestObject, ) (api.GetSessionAgentRunResponseObject, error)
GetSessionAgentRun returns all persisted data for one child-agent run.
func (*Server) GetSessionCompaction ¶ added in v0.4.0
func (s *Server) GetSessionCompaction( ctx context.Context, request api.GetSessionCompactionRequestObject, ) (api.GetSessionCompactionResponseObject, error)
GetSessionCompaction returns one immutable compaction record for one session.
func (*Server) GetSessionContextSnapshot ¶ added in v0.4.0
func (s *Server) GetSessionContextSnapshot( ctx context.Context, request api.GetSessionContextSnapshotRequestObject, ) (api.GetSessionContextSnapshotResponseObject, error)
GetSessionContextSnapshot returns one session-referenced context snapshot.
func (*Server) GetSessionPromptSnapshot ¶ added in v0.4.0
func (s *Server) GetSessionPromptSnapshot( ctx context.Context, request api.GetSessionPromptSnapshotRequestObject, ) (api.GetSessionPromptSnapshotResponseObject, error)
GetSessionPromptSnapshot returns one session-referenced prompt snapshot.
func (*Server) ListMessages ¶
func (s *Server) ListMessages( ctx context.Context, request api.ListMessagesRequestObject, ) (api.ListMessagesResponseObject, error)
ListMessages returns one stable bounded durable transcript page.
func (*Server) ListSessionAgentRunEvents ¶
func (s *Server) ListSessionAgentRunEvents( ctx context.Context, request api.ListSessionAgentRunEventsRequestObject, ) (api.ListSessionAgentRunEventsResponseObject, error)
ListSessionAgentRunEvents follows what one child agent is doing.
func (*Server) ListSessionAgentRuns ¶
func (s *Server) ListSessionAgentRuns( ctx context.Context, request api.ListSessionAgentRunsRequestObject, ) (api.ListSessionAgentRunsResponseObject, error)
ListSessionAgentRuns reports the child agents this session has launched.
func (*Server) ListSessionCompactions ¶ added in v0.4.0
func (s *Server) ListSessionCompactions( ctx context.Context, request api.ListSessionCompactionsRequestObject, ) (api.ListSessionCompactionsResponseObject, error)
ListSessionCompactions returns every durable summary record for one session.
func (*Server) ListSessionEvents ¶
func (s *Server) ListSessionEvents( ctx context.Context, request api.ListSessionEventsRequestObject, ) (api.ListSessionEventsResponseObject, error)
ListSessionEvents returns durable protocol history without consuming it.
func (*Server) ListSessionJobSignalRequests ¶ added in v0.4.0
func (s *Server) ListSessionJobSignalRequests( ctx context.Context, request api.ListSessionJobSignalRequestsRequestObject, ) (api.ListSessionJobSignalRequestsResponseObject, error)
ListSessionJobSignalRequests returns the durable signal-request history for one process job.
func (*Server) ListSessionJobs ¶
func (s *Server) ListSessionJobs( ctx context.Context, request api.ListSessionJobsRequestObject, ) (api.ListSessionJobsResponseObject, error)
ListSessionJobs reports the commands this session has started.
func (*Server) ListSessionModelRunCalls ¶ added in v0.4.0
func (s *Server) ListSessionModelRunCalls( ctx context.Context, request api.ListSessionModelRunCallsRequestObject, ) (api.ListSessionModelRunCallsResponseObject, error)
ListSessionModelRunCalls returns every provider round for one model run.
func (*Server) ListSessionModelRuns ¶ added in v0.4.0
func (s *Server) ListSessionModelRuns( ctx context.Context, request api.ListSessionModelRunsRequestObject, ) (api.ListSessionModelRunsResponseObject, error)
ListSessionModelRuns returns durable logical model invocations.
func (*Server) ListSessionNotices ¶ added in v0.4.0
func (s *Server) ListSessionNotices( ctx context.Context, request api.ListSessionNoticesRequestObject, ) (api.ListSessionNoticesResponseObject, error)
ListSessionNotices returns durable notice history without consuming it.
func (*Server) ListSessionTurns ¶ added in v0.4.0
func (s *Server) ListSessionTurns( ctx context.Context, request api.ListSessionTurnsRequestObject, ) (api.ListSessionTurnsResponseObject, error)
ListSessionTurns returns the durable turn lifecycle for one session.
func (*Server) PublishSessionNotice ¶ added in v0.4.0
func (s *Server) PublishSessionNotice( ctx context.Context, request api.PublishSessionNoticeRequestObject, ) (api.PublishSessionNoticeResponseObject, error)
PublishSessionNotice records an outside report against a session.
func (*Server) ReadSessionJobOutput ¶
func (s *Server) ReadSessionJobOutput( ctx context.Context, request api.ReadSessionJobOutputRequestObject, ) (api.ReadSessionJobOutputResponseObject, error)
ReadSessionJobOutput returns a bounded window of one job's output.
func (*Server) SignalSessionJob ¶
func (s *Server) SignalSessionJob( ctx context.Context, request api.SignalSessionJobRequestObject, ) (api.SignalSessionJobResponseObject, error)
SignalSessionJob stops one running job.