processor

package
v0.25.0 Latest Latest
Warning

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

Go to latest
Published: Jul 31, 2025 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Agent

type Agent struct {
	Agent AgentSpec `yaml:"agent" json:"agent"`
}

Agent represents the top-level agent structure

type AgentIdentity

type AgentIdentity struct {
	Name        string `yaml:"name" json:"name"`
	ID          string `yaml:"id" json:"id"`
	Version     string `yaml:"version" json:"version"`
	Description string `yaml:"description" json:"description"`
	Role        string `yaml:"role" json:"role"`
	Goal        string `yaml:"goal" json:"goal"`
	Icon        string `yaml:"icon,omitempty" json:"icon,omitempty"`
}

AgentIdentity represents the identity section of an agent

type AgentSpec

type AgentSpec struct {
	Identity         AgentIdentity     `yaml:"identity" json:"identity"`
	ActivationPrompt []string          `yaml:"activation_prompt" json:"activation_prompt"`
	Principles       []string          `yaml:"principles" json:"principles"`
	Customization    *string           `yaml:"customization" json:"customization"`
	Commands         map[string]string `yaml:"commands" json:"commands"`
	Tasks            []string          `yaml:"tasks,omitempty" json:"tasks,omitempty"`
}

AgentSpec represents the complete agent specification

func (*AgentSpec) GetCustomization

func (a *AgentSpec) GetCustomization() string

GetCustomization returns the customization value or empty string if nil

func (*AgentSpec) HasCustomization

func (a *AgentSpec) HasCustomization() bool

HasCustomization returns true if customization field is present and non-empty

type ValidationError

type ValidationError struct {
	Field   string
	Value   any
	Message string
	File    string
}

ValidationError represents a validation error with details

func (ValidationError) Error

func (e ValidationError) Error() string

type YAMLProcessor

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

YAMLProcessor handles YAML parsing and validation for agents

func NewYAMLProcessor

func NewYAMLProcessor(embeddedAssets embed.FS) (*YAMLProcessor, error)

NewYAMLProcessor creates a new YAML processor with embedded schema

func NewYAMLProcessorFromFile

func NewYAMLProcessorFromFile(schemaPath string) (*YAMLProcessor, error)

NewYAMLProcessorFromFile creates a new YAML processor with schema from file (for testing)

func (*YAMLProcessor) ParseAgentFile

func (p *YAMLProcessor) ParseAgentFile(filePath string) (*Agent, error)

ParseAgentFile parses a YAML agent file and returns the agent structure

func (*YAMLProcessor) ParseAgentFileRaw

func (p *YAMLProcessor) ParseAgentFileRaw(filePath string) (map[string]interface{}, error)

ParseAgentFileRaw parses a YAML agent file into a raw map to capture all fields

func (*YAMLProcessor) ProcessAndValidateAgent

func (p *YAMLProcessor) ProcessAndValidateAgent(filePath string) (*Agent, []ValidationError, error)

ProcessAndValidateAgent processes and validates an agent file

func (*YAMLProcessor) ValidateAgent

func (p *YAMLProcessor) ValidateAgent(agent *Agent, filePath string) []ValidationError

ValidateAgent validates an agent against the JSON schema

func (*YAMLProcessor) ValidateAgentRaw

func (p *YAMLProcessor) ValidateAgentRaw(rawData map[string]interface{}, filePath string) []ValidationError

ValidateAgentRaw validates raw agent data against the JSON schema

Jump to

Keyboard shortcuts

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