Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrCharacterNameRequired = &ValidationError{ Field: "name", Message: "character name is required and cannot be empty", } ErrCharacterNameInvalid = &ValidationError{ Field: "name", Message: "character name must be a valid Go identifier (letters, numbers, underscore only, no hyphens or special characters)", } ErrInvalidDimensions = &ValidationError{ Field: "dimensions", Message: "character dimensions must be positive integers (width > 0, height > 0)", } ErrEmptyPattern = &ValidationError{ Field: "pattern", Message: "pattern cannot be empty", } ErrInvalidFrameCount = &ValidationError{ Field: "frames", Message: "frame count does not match character height", } ErrInvalidFrameName = &ValidationError{ Field: "frame_name", Message: "frame name cannot be empty", } ErrCharacterNotFound = &CharacterNotFoundError{} ErrPatternTooLong = &ValidationError{ Field: "pattern", Message: "pattern exceeds maximum length", } ErrInvalidPatternCharacter = &ValidationError{ Field: "pattern", Message: "pattern contains invalid characters", } )
Domain-specific errors with helpful context
Functions ¶
Types ¶
type AnimationError ¶
func NewAnimationError ¶
func NewAnimationError(characterName, operation, message string, cause error) *AnimationError
func (*AnimationError) Error ¶
func (e *AnimationError) Error() string
func (*AnimationError) Unwrap ¶
func (e *AnimationError) Unwrap() error
type Character ¶
type Character struct {
Name string
Personality string // Optional: "efficient", "friendly", "analytical", "creative"
Color string // Hex color for the character (e.g., "#FF4500")
Width int
Height int
BaseFrame Frame // Idle/immutable base character
States map[string]State // Agent states (plan, think, execute, etc.)
Frames []Frame // Keep for backward compatibility
}
Character represents a terminal character with frames and agent states
type CharacterNotFoundError ¶
type CharacterNotFoundError struct {
Name string
}
func NewCharacterNotFoundError ¶
func NewCharacterNotFoundError(name string) *CharacterNotFoundError
func (*CharacterNotFoundError) Error ¶
func (e *CharacterNotFoundError) Error() string
type CharacterSpec ¶
CharacterSpec represents the specification for creating a character
func NewCharacterSpec ¶
func NewCharacterSpec(name string, width, height int) *CharacterSpec
NewCharacterSpec creates a new character specification
func (*CharacterSpec) AddFrame ¶
func (cs *CharacterSpec) AddFrame(name string, patterns []string) *CharacterSpec
AddFrame adds a frame to a character specification
func (*CharacterSpec) AddFrameFromString ¶
func (cs *CharacterSpec) AddFrameFromString(name, pattern string) *CharacterSpec
AddFrameFromString adds a frame from a single string pattern
type PatternCompilationError ¶
func NewPatternCompilationError ¶
func NewPatternCompilationError(pattern string, position int, message string, cause error) *PatternCompilationError
func (*PatternCompilationError) Error ¶
func (e *PatternCompilationError) Error() string
func (*PatternCompilationError) Unwrap ¶
func (e *PatternCompilationError) Unwrap() error
type PatternCompiler ¶
PatternCompiler defines the interface for pattern compilation
type State ¶
type State struct {
Name string
Description string
Frames []Frame // Multiple frames for animation
StateType string // "standard" or "custom"
AnimationFPS int // FPS for this state (default: 5)
AnimationLoops int // Loop count for this state (default: 1)
}
State represents an agent behavioral state
type ValidationError ¶
Error types for better error handling
func NewValidationError ¶
func NewValidationError(field string, value interface{}, message string) *ValidationError
Helper functions to create contextual errors
func NewValidationErrorWithCause ¶
func NewValidationErrorWithCause(field string, value interface{}, message string, cause error) *ValidationError
func (*ValidationError) Error ¶
func (e *ValidationError) Error() string
func (*ValidationError) Unwrap ¶
func (e *ValidationError) Unwrap() error
Click to show internal directories.
Click to hide internal directories.