Documentation
¶
Index ¶
- type Agent
- type AgentIdentity
- type AgentSpec
- type ValidationError
- type YAMLProcessor
- func (p *YAMLProcessor) ParseAgentFile(filePath string) (*Agent, error)
- func (p *YAMLProcessor) ParseAgentFileRaw(filePath string) (map[string]interface{}, error)
- func (p *YAMLProcessor) ProcessAndValidateAgent(filePath string) (*Agent, []ValidationError, error)
- func (p *YAMLProcessor) ValidateAgent(agent *Agent, filePath string) []ValidationError
- func (p *YAMLProcessor) ValidateAgentRaw(rawData map[string]interface{}, filePath string) []ValidationError
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 ¶
GetCustomization returns the customization value or empty string if nil
func (*AgentSpec) HasCustomization ¶
HasCustomization returns true if customization field is present and non-empty
type ValidationError ¶
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