unified

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Jul 24, 2026 License: MIT Imports: 26 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AgentsConfig

type AgentsConfig struct {
	Dir              string        `yaml:"dir"`
	Max              int           `yaml:"max"`
	DecisionInterval time.Duration `yaml:"decision_interval"`
	Enabled          []string      `yaml:"enabled"`
}

AgentsConfig holds agent management settings.

type Config

type Config struct {
	Server      ServerConfig      `yaml:"server"`
	Game        GameConfig        `yaml:"game"`
	Agents      AgentsConfig      `yaml:"agents"`
	LLM         LLMConfig         `yaml:"llm"`
	Database    DatabaseConfig    `yaml:"database"`
	Credentials CredentialsConfig `yaml:"credentials"`
	Strategies  StrategiesConfig  `yaml:"strategies"`
	Teams       []TeamConfig      `yaml:"teams"`
}

Config is the unified server configuration.

func DefaultConfig

func DefaultConfig() Config

DefaultConfig returns a Config with sensible defaults.

func LoadConfig

func LoadConfig(path string) (Config, error)

LoadConfig reads a YAML config file and returns the parsed Config. Missing fields are filled with defaults.

type CredentialsConfig

type CredentialsConfig struct {
	Backend string `yaml:"backend"`
	Path    string `yaml:"path"`
}

CredentialsConfig holds credential storage settings.

type DatabaseConfig

type DatabaseConfig struct {
	Backend string `yaml:"backend"`
	Path    string `yaml:"path"`
	// MarketPath is the path to the separate volatile market DB
	// (pkg/market). Empty falls back to market.DefaultConfig().
	MarketPath string `yaml:"market_path"`
}

DatabaseConfig holds knowledge base settings.

type GameConfig

type GameConfig struct {
	ServerURL string `yaml:"server_url"`
	Transport string `yaml:"transport"` // "ws" (default) or "mcp"
}

GameConfig holds game server connection settings.

type LLMConfig

type LLMConfig struct {
	URL     string        `yaml:"url"`
	Model   string        `yaml:"model"`
	Timeout time.Duration `yaml:"timeout"`
}

LLMConfig holds LLM provider settings.

type Server

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

Server is the unified spacemolt server that combines agent management, the observer/frontend server, and shared resources.

func New

func New(cfg Config) (*Server, error)

New creates a new unified server from the given config.

func (*Server) KB

func (s *Server) KB() knowledge.Base

KB returns the knowledge base.

func (*Server) Manager

func (s *Server) Manager() *agent.Manager

Manager returns the agent manager.

func (*Server) Mux

func (s *Server) Mux() *http.ServeMux

Mux returns the HTTP mux for adding additional routes.

func (*Server) Observer

func (s *Server) Observer() *observe.ObserverServer

Observer returns the underlying ObserverServer.

func (*Server) Shutdown

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

Shutdown gracefully shuts down the server, agents, and resources.

func (*Server) SpawnConfiguredAgents

func (s *Server) SpawnConfiguredAgents(ctx context.Context) (int, []string)

SpawnConfiguredAgents spawns all agents listed in the config.

func (*Server) Start

func (s *Server) Start() error

Start begins serving HTTP and returns immediately. Use Shutdown for graceful stop.

type ServerConfig

type ServerConfig struct {
	HTTPPort       int    `yaml:"http_port"`
	StaticDir      string `yaml:"static_dir"`
	AdminStaticDir string `yaml:"admin_static_dir"`
	RegistryURL    string `yaml:"registry_url"`
}

ServerConfig holds HTTP server settings.

type StrategiesConfig

type StrategiesConfig struct {
	Defaults map[string]string `yaml:"defaults"`
}

StrategiesConfig holds strategy assignment defaults.

type TeamConfig

type TeamConfig struct {
	Name    string             `yaml:"name"`
	Leader  string             `yaml:"leader"`
	Members []TeamMemberConfig `yaml:"members"`
}

TeamConfig defines a team in the configuration.

type TeamMemberConfig

type TeamMemberConfig struct {
	AgentID string `yaml:"agent_id"`
	Role    string `yaml:"role"`
}

TeamMemberConfig defines a team member in the configuration.

Jump to

Keyboard shortcuts

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