loader

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Apr 27, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package loader provides loading of multi-agent-spec definitions.

Package loader provides loading of multi-agent-spec definitions.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AgentMap

func AgentMap(agents []*Agent) map[string]*Agent

AgentMap returns a map of agents keyed by qualified name.

Types

type Agent

type Agent struct {
	Name         string   `yaml:"name"`
	Namespace    string   `yaml:"namespace,omitempty"`
	Description  string   `yaml:"description"`
	Model        string   `yaml:"model"`
	Tools        []string `yaml:"tools"`
	Role         string   `yaml:"role,omitempty"`
	Goal         string   `yaml:"goal,omitempty"`
	Backstory    string   `yaml:"backstory,omitempty"`
	Dependencies []string `yaml:"dependencies,omitempty"`
	Instructions string   `yaml:"-"` // Parsed from markdown body
}

Agent represents a loaded agent specification.

func (*Agent) QualifiedName

func (a *Agent) QualifiedName() string

QualifiedName returns namespace/name or just name if no namespace.

type ConcurrencyConfig

type ConcurrencyConfig struct {
	Model               string `json:"model"`
	MaxConcurrentAgents int    `json:"max_concurrent_agents"`
	StepTimeoutSeconds  int    `json:"step_timeout_seconds,omitempty"`
}

ConcurrencyConfig holds concurrency configuration.

type Deployment

type Deployment struct {
	Platform string           `json:"platform"`
	Team     string           `json:"team"`
	Version  string           `json:"version"`
	Config   DeploymentConfig `json:"config"`
}

Deployment represents a deployment specification.

type DeploymentConfig

type DeploymentConfig struct {
	// Claude Code specific
	AgentDir     string            `json:"agent_dir,omitempty"`
	SpecDir      string            `json:"spec_dir,omitempty"`
	ModelMapping map[string]string `json:"model_mapping,omitempty"`
	ToolMapping  map[string]string `json:"tool_mapping,omitempty"`

	// Go Server specific
	Server      *ServerConfig      `json:"server,omitempty"`
	Concurrency *ConcurrencyConfig `json:"concurrency,omitempty"`
	LLM         *LLMConfig         `json:"llm,omitempty"`
	Retrieval   *RetrievalConfig   `json:"retrieval,omitempty"`
	Polymarket  *PolymarketConfig  `json:"polymarket,omitempty"`
	Risk        *RiskConfig        `json:"risk,omitempty"`
}

DeploymentConfig holds platform-specific configuration.

type LLMConfig

type LLMConfig struct {
	Provider     string            `json:"provider"`
	Config       json.RawMessage   `json:"config,omitempty"`
	ModelMapping map[string]string `json:"model_mapping,omitempty"`
}

LLMConfig holds LLM provider configuration.

type Loader

type Loader struct{}

Loader loads multi-agent-spec definitions.

func NewLoader

func NewLoader() *Loader

NewLoader creates a new Loader.

func (*Loader) LoadAgent

func (l *Loader) LoadAgent(path string) (*Agent, error)

LoadAgent loads an agent from a markdown file.

func (*Loader) LoadAgentsFromDir

func (l *Loader) LoadAgentsFromDir(dir string) ([]*Agent, error)

LoadAgentsFromDir loads all agents from a directory.

func (*Loader) LoadDeployment

func (l *Loader) LoadDeployment(path string) (*Deployment, error)

LoadDeployment loads a deployment specification from a JSON file.

func (*Loader) LoadTeam

func (l *Loader) LoadTeam(path string) (*Team, error)

LoadTeam loads a team specification from a JSON file.

func (*Loader) ParseAgentMarkdown

func (l *Loader) ParseAgentMarkdown(data []byte, path string) (*Agent, error)

ParseAgentMarkdown parses agent definition from markdown with YAML frontmatter.

type PolymarketConfig

type PolymarketConfig struct {
	CLOBURL       string `json:"clob_url"`
	GammaURL      string `json:"gamma_url"`
	ChainID       int    `json:"chain_id"`
	PrivateKeyEnv string `json:"private_key_env"`
}

PolymarketConfig holds Polymarket API configuration.

type Port

type Port struct {
	Name        string `json:"name"`
	Type        string `json:"type"`
	Description string `json:"description,omitempty"`
	From        string `json:"from,omitempty"`
	Default     any    `json:"default,omitempty"`
}

Port represents an input or output port.

type RetrievalConfig

type RetrievalConfig struct {
	Provider string          `json:"provider"`
	Config   json.RawMessage `json:"config,omitempty"`
}

RetrievalConfig holds RAG retrieval configuration.

type RiskConfig

type RiskConfig struct {
	MaxPositionPercent float64 `json:"max_position_percent"`
	MaxExposurePercent float64 `json:"max_exposure_percent"`
	MinEdgePercent     float64 `json:"min_edge_percent"`
	KellyMultiplier    float64 `json:"kelly_multiplier"`
}

RiskConfig holds risk management configuration.

type ServerConfig

type ServerConfig struct {
	Port           int    `json:"port"`
	MetricsPort    int    `json:"metrics_port,omitempty"`
	HealthEndpoint string `json:"health_endpoint,omitempty"`
}

ServerConfig holds server configuration.

type Step

type Step struct {
	Name      string   `json:"name"`
	Agent     string   `json:"agent"`
	DependsOn []string `json:"depends_on,omitempty"`
	Inputs    []Port   `json:"inputs,omitempty"`
	Outputs   []Port   `json:"outputs,omitempty"`
}

Step represents a workflow step.

type Team

type Team struct {
	Name        string   `json:"name"`
	Version     string   `json:"version"`
	Description string   `json:"description,omitempty"`
	Agents      []string `json:"agents"`
	Workflow    Workflow `json:"workflow"`
	Context     string   `json:"context,omitempty"`
}

Team represents a loaded team specification.

type Workflow

type Workflow struct {
	Type  string `json:"type"`
	Steps []Step `json:"steps"`
}

Workflow represents the team workflow configuration.

Jump to

Keyboard shortcuts

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