api

package
v0.0.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 4, 2026 License: MIT Imports: 24 Imported by: 0

Documentation

Overview

Package api provides the REST API server for the agent-factory. It exposes endpoints for submitting work, querying token state, and listing workflow records.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildFactoryWorldWorkstationRequestProjectionSlice

func BuildFactoryWorldWorkstationRequestProjectionSlice(
	state interfaces.FactoryWorldState,
) factoryapi.FactoryWorldWorkstationRequestProjectionSlice

BuildFactoryWorldWorkstationRequestProjectionSlice keeps the additive workstation-request contract at the API boundary while deriving it from the canonical selected-tick FactoryWorldState model.

Types

type Server

type Server struct {
	// contains filtered or unexported fields
}

Server is the REST API server for the agent-factory.

func NewServer

func NewServer(runtime apisurface.APISurface, port int, logger *zap.Logger) *Server

NewServer creates a new API server.

func (*Server) CreateFactory

func (s *Server) CreateFactory(w http.ResponseWriter, r *http.Request)

func (*Server) GetCurrentFactory

func (s *Server) GetCurrentFactory(w http.ResponseWriter, r *http.Request)

func (*Server) GetEvents

func (s *Server) GetEvents(w http.ResponseWriter, r *http.Request)

GetEvents handles GET /events as a canonical factory event SSE stream.

func (*Server) GetStatus

func (s *Server) GetStatus(w http.ResponseWriter, r *http.Request)

GetStatus handles GET /status as the supported runtime status read model.

func (*Server) GetWork

func (*Server) Handler

func (s *Server) Handler() http.Handler

Handler returns the http.Handler for testing and composition.

func (*Server) ListWork

func (s *Server) ListWork(w http.ResponseWriter, r *http.Request, params factoryapi.ListWorkParams)

func (*Server) ListenAndServe

func (s *Server) ListenAndServe(ctx context.Context) error

ListenAndServe starts the HTTP server. Blocks until ctx is cancelled.

func (*Server) Serve

func (s *Server) Serve(ctx context.Context, listener net.Listener) error

Serve starts the HTTP server on an already-bound listener. Blocks until ctx is cancelled or the server fails.

func (*Server) SubmitWork

func (s *Server) SubmitWork(w http.ResponseWriter, r *http.Request)

func (*Server) UpsertWorkRequest

func (s *Server) UpsertWorkRequest(w http.ResponseWriter, r *http.Request, requestID string)

Directories

Path Synopsis
Package generated provides primitives to interact with the openapi HTTP API.
Package generated provides primitives to interact with the openapi HTTP API.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL