api

package
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: Jun 2, 2026 License: MIT Imports: 44 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 BuildFactoryWorldWorkMoveOperationProjectionSlice added in v0.0.5

func BuildFactoryWorldWorkMoveOperationProjectionSlice(
	state interfaces.FactoryWorldState,
) factoryapi.FactoryWorldWorkMoveOperationProjectionSlice

BuildFactoryWorldWorkMoveOperationProjectionSlice delegates to the moveprojection subpackage while preserving the historical pkg/api entrypoint.

func BuildFactoryWorldWorkstationRequestProjectionSlice

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

BuildFactoryWorldWorkstationRequestProjectionSlice delegates to the workstationprojection subpackage while preserving the historical pkg/api entrypoint.

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 NewServerWithOptions added in v0.0.5

func NewServerWithOptions(runtime apisurface.APISurface, port int, logger *zap.Logger, opts ServerOptions) *Server

NewServerWithOptions creates a new API server with explicit runtime boundaries for tests and embedding processes.

func (*Server) CloseFactorySession added in v0.0.5

func (s *Server) CloseFactorySession(w http.ResponseWriter, r *http.Request, sessionID string)

func (*Server) GetCurrentFactory

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

func (*Server) GetCurrentFactoryBySessionId added in v0.0.5

func (s *Server) GetCurrentFactoryBySessionId(w http.ResponseWriter, r *http.Request, sessionID factoryapi.SessionID)

func (*Server) GetCurrentFactoryWorkstationPromptTemplateContractBySessionId added in v0.0.5

func (s *Server) GetCurrentFactoryWorkstationPromptTemplateContractBySessionId(w http.ResponseWriter, r *http.Request, sessionID factoryapi.SessionID, workstationName string)

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) GetEventsBySessionId added in v0.0.5

func (s *Server) GetEventsBySessionId(w http.ResponseWriter, r *http.Request, sessionID factoryapi.SessionID)

func (*Server) GetModel added in v0.0.5

func (s *Server) GetModel(w http.ResponseWriter, r *http.Request, modelName string)

func (*Server) GetProviderSessionDetails added in v0.0.5

func (s *Server) GetProviderSessionDetails(
	w http.ResponseWriter,
	r *http.Request,
	params factoryapi.GetProviderSessionDetailsParams,
)

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) GetStatusBySessionId added in v0.0.5

func (s *Server) GetStatusBySessionId(w http.ResponseWriter, r *http.Request, sessionID factoryapi.SessionID)

func (*Server) GetWork

func (*Server) GetWorkBySessionId added in v0.0.5

func (s *Server) GetWorkBySessionId(w http.ResponseWriter, r *http.Request, sessionID factoryapi.SessionID, id factoryapi.WorkOrTokenID)

func (*Server) Handler

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

Handler returns the http.Handler for testing and composition.

func (*Server) InvokeModel added in v0.0.5

func (s *Server) InvokeModel(w http.ResponseWriter, r *http.Request, modelName string)

func (*Server) ListFactorySessions added in v0.0.5

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

func (*Server) ListModels added in v0.0.5

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

func (*Server) ListWork

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

func (*Server) ListWorkBySessionId added in v0.0.5

func (s *Server) ListWorkBySessionId(w http.ResponseWriter, r *http.Request, sessionID factoryapi.SessionID, params factoryapi.ListWorkBySessionIdParams)

func (*Server) ListenAndServe

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

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

func (*Server) MoveWork added in v0.0.5

func (*Server) MoveWorkBySessionId added in v0.0.5

func (s *Server) MoveWorkBySessionId(w http.ResponseWriter, r *http.Request, sessionID factoryapi.SessionID, id factoryapi.WorkOrTokenID)

func (*Server) OpenFactorySession added in v0.0.5

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

func (*Server) PullModel added in v0.0.5

func (s *Server) PullModel(w http.ResponseWriter, r *http.Request, modelName string)

func (*Server) SaveCurrentFactoryBySessionId added in v0.0.5

func (s *Server) SaveCurrentFactoryBySessionId(
	w http.ResponseWriter,
	r *http.Request,
	sessionID factoryapi.SessionID,
)

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) StageSubmitWorkFile added in v0.0.5

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

func (*Server) StageSubmitWorkFileBySessionId added in v0.0.5

func (s *Server) StageSubmitWorkFileBySessionId(
	w http.ResponseWriter,
	r *http.Request,
	sessionID factoryapi.SessionID,
)

func (*Server) SubmitWork

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

func (*Server) SubmitWorkBySessionId added in v0.0.5

func (s *Server) SubmitWorkBySessionId(w http.ResponseWriter, r *http.Request, sessionID factoryapi.SessionID)

func (*Server) UpsertWorkRequest

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

func (*Server) UpsertWorkRequestBySessionId added in v0.0.5

func (s *Server) UpsertWorkRequestBySessionId(w http.ResponseWriter, r *http.Request, sessionID factoryapi.SessionID, requestID string)

func (*Server) ValidateCurrentFactoryWorkstationPromptTemplateBySessionId added in v0.0.5

func (s *Server) ValidateCurrentFactoryWorkstationPromptTemplateBySessionId(w http.ResponseWriter, r *http.Request, sessionID factoryapi.SessionID, workstationName string)

func (*Server) ValidateFactory added in v0.0.5

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

ValidateFactory handles POST /factory-validations using validationentry.ValidateFactoryAPI with ProfileTopology (structural checks only; no canonical JSON load).

type ServerOptions added in v0.0.5

type ServerOptions struct {
	CodexSessionsRoot string
}

ServerOptions configures optional API server boundaries.

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