server

package
v0.0.0-...-fcd67d8 Latest Latest
Warning

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

Go to latest
Published: Sep 3, 2026 License: MIT Imports: 11 Imported by: 0

Documentation

Overview

Package server implements the agentruntime service HTTP API.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	ServiceName string `env:"SERVICE_NAME" env-default:"agentruntime"`
	Port        string `env:"PORT" env-default:"8096"`
	LogLevel    string `env:"LOG_LEVEL" env-default:"info"`
}

Config is the agentruntime service environment configuration.

type Run

type Run struct {
	ID        string    `json:"id"`
	Status    RunStatus `json:"status"`
	Goal      string    `json:"goal"`
	Output    string    `json:"output,omitempty"`
	Error     string    `json:"error,omitempty"`
	CreatedAt time.Time `json:"created_at"`
}

Run is a persisted agent execution record.

type RunStatus

type RunStatus string

RunStatus is the lifecycle status of an agent run.

const (
	RunStatusCompleted RunStatus = "completed"
	RunStatusFailed    RunStatus = "failed"
)

type Server

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

Server wraps the agentruntime HTTP API.

func New

func New(cfg Config) *Server

New constructs the agentruntime HTTP server with an in-memory LLM client.

func NewWithClient

func NewWithClient(cfg Config, client llm.Client) *Server

NewWithClient constructs the server with a custom llm.Client (tests).

func (*Server) Echo

func (s *Server) Echo() *echo.Echo

Echo exposes the underlying Echo instance (tests / custom mounts).

func (*Server) Shutdown

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

Shutdown stops the HTTP server.

func (*Server) Start

func (s *Server) Start() error

Start begins serving HTTP.

Jump to

Keyboard shortcuts

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