parser

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Aug 24, 2025 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AgentMetadata

type AgentMetadata struct {
	Name        string            `yaml:"name"`
	Version     string            `yaml:"version,omitempty"`
	Description string            `yaml:"description,omitempty"`
	Author      string            `yaml:"author,omitempty"`
	Tags        []string          `yaml:"tags,omitempty"`
	Labels      map[string]string `yaml:"labels,omitempty"`
}

AgentMetadata contains agent metadata

type AgentSpec

type AgentSpec struct {
	APIVersion string           `yaml:"apiVersion"`
	Kind       string           `yaml:"kind"`
	Metadata   AgentMetadata    `yaml:"metadata"`
	Spec       AgentSpecDetails `yaml:"spec"`
}

AgentSpec represents the agent.yaml specification

type AgentSpecDetails

type AgentSpecDetails struct {
	Runtime      string                 `yaml:"runtime"`
	Model        ModelConfig            `yaml:"model"`
	Capabilities []string               `yaml:"capabilities,omitempty"`
	Dependencies []string               `yaml:"dependencies,omitempty"`
	Environment  []EnvironmentVar       `yaml:"environment,omitempty"`
	Ports        []PortConfig           `yaml:"ports,omitempty"`
	Volumes      []VolumeConfig         `yaml:"volumes,omitempty"`
	HealthCheck  *HealthCheckConfig     `yaml:"healthCheck,omitempty"`
	Resources    *ResourceConfig        `yaml:"resources,omitempty"`
	Config       map[string]interface{} `yaml:"config,omitempty"`
}

AgentSpecDetails contains the agent specification

type EnvironmentVar

type EnvironmentVar struct {
	Name  string `yaml:"name"`
	Value string `yaml:"value,omitempty"`
	From  string `yaml:"from,omitempty"` // For secrets/configmaps
}

EnvironmentVar represents an environment variable

type HealthCheckConfig

type HealthCheckConfig struct {
	Command     []string `yaml:"command"`
	Interval    string   `yaml:"interval,omitempty"`
	Timeout     string   `yaml:"timeout,omitempty"`
	Retries     int      `yaml:"retries,omitempty"`
	StartPeriod string   `yaml:"startPeriod,omitempty"`
}

HealthCheckConfig represents health check configuration

type ModelConfig

type ModelConfig struct {
	Provider string                 `yaml:"provider"`
	Name     string                 `yaml:"name"`
	Config   map[string]interface{} `yaml:"config,omitempty"`
}

ModelConfig represents model configuration

type Parser

type Parser struct{}

Parser handles agent.yaml parsing

func New

func New() *Parser

New creates a new parser instance

func (*Parser) FindAgentFile

func (p *Parser) FindAgentFile(dir string) (string, error)

FindAgentFile finds agent.yaml in the given directory

func (*Parser) Parse

func (p *Parser) Parse(data []byte) (*AgentSpec, error)

Parse parses agent.yaml content

func (*Parser) ParseFile

func (p *Parser) ParseFile(path string) (*AgentSpec, error)

ParseFile parses an agent.yaml file

func (*Parser) Validate

func (p *Parser) Validate(spec *AgentSpec) error

Validate validates the agent specification

type PortConfig

type PortConfig struct {
	Container int    `yaml:"container"`
	Host      int    `yaml:"host,omitempty"`
	Protocol  string `yaml:"protocol,omitempty"`
}

PortConfig represents port configuration

type ResourceConfig

type ResourceConfig struct {
	Limits   ResourceLimits `yaml:"limits,omitempty"`
	Requests ResourceLimits `yaml:"requests,omitempty"`
}

ResourceConfig represents resource constraints

type ResourceLimits

type ResourceLimits struct {
	CPU    string `yaml:"cpu,omitempty"`
	Memory string `yaml:"memory,omitempty"`
}

ResourceLimits represents resource limits

type VolumeConfig

type VolumeConfig struct {
	Source string `yaml:"source"`
	Target string `yaml:"target"`
	Type   string `yaml:"type,omitempty"`
}

VolumeConfig represents volume configuration

Jump to

Keyboard shortcuts

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