persona

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Apr 28, 2026 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNotFound = errors.New("persona not found")

ErrNotFound is returned when a persona does not exist on disk.

Functions

func DefaultCatalogURL

func DefaultCatalogURL() string

DefaultCatalogURL returns the persona catalog URL, checking the EYRIE_CATALOG_URL environment variable first and falling back to a bundled file path relative to the user's home directory.

Types

type CatalogClient

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

CatalogClient fetches the curated persona catalog.

func NewCatalogClient

func NewCatalogClient(catalogURL string) (*CatalogClient, error)

func (*CatalogClient) Fetch

Fetch retrieves the persona catalog.

type CategoryInfo

type CategoryInfo struct {
	ID          string `json:"id"`
	Name        string `json:"name"`
	Description string `json:"description"`
}

func Categories

func Categories() []CategoryInfo

Categories returns a copy of the category definitions so callers cannot mutate package state.

type Persona

type Persona struct {
	// Identity
	ID          string `json:"id"`
	Name        string `json:"name"`
	Role        string `json:"role"`        // "life-coach", "ceo", "researcher", etc.
	Description string `json:"description"` // Short human-readable summary
	Icon        string `json:"icon"`        // Emoji or icon identifier
	Category    string `json:"category"`    // "personal", "business", "creative", "technical"

	// LLM preferences
	PreferredModel string  `json:"preferred_model"`           // e.g. "claude-opus-4-6"
	Temperature    float64 `json:"temperature,omitempty"`     // 0.0-1.0
	MaxTokens      int     `json:"max_tokens,omitempty"`      // Max response length
	ReasoningLevel string  `json:"reasoning_level,omitempty"` // "low", "medium", "high"

	// Behavior
	SystemPrompt string   `json:"system_prompt"` // The core personality definition
	Tools        []string `json:"tools"`         // Enabled tool names
	Traits       []string `json:"traits"`        // Personality traits for display

	// Framework affinity
	PreferredFramework string `json:"preferred_framework,omitempty"` // "zeroclaw", "openclaw", or "" for any

	// Identity templates: workspace files rendered when instantiating this persona.
	// Keys are filenames (IDENTITY.md, SOUL.md, etc.), values are Go text/template strings.
	IdentityTemplate map[string]string `json:"identity_template,omitempty"`

	// Seed memories written to MEMORY.md on first instantiation
	MemorySeeds []string `json:"memory_seeds,omitempty"`

	// Hierarchy role this persona is designed for ("coordinator", "orchestrator", "implementer", or "")
	HierarchyRole string `json:"hierarchy_role,omitempty"`

	// Status (set at runtime, not in registry)
	Installed  bool   `json:"installed,omitempty"`
	AgentName  string `json:"agent_name,omitempty"`  // Name of the running agent instance
	AgentAlive bool   `json:"agent_alive,omitempty"` // Whether the agent is currently running
}

Persona defines a named agent personality with a role, system prompt, preferred model, and optional framework affinity.

func (Persona) Validate

func (p Persona) Validate() error

Validate checks that the Persona's fields are valid.

type PersonaRegistry

type PersonaRegistry struct {
	Version  string    `json:"version"`
	Personas []Persona `json:"personas"`
}

PersonaRegistry holds the full catalog of available personas.

type Store

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

Store manages persona definitions on disk at ~/.eyrie/personas/.

func NewStore

func NewStore() (*Store, error)

func (*Store) Delete

func (s *Store) Delete(id string) error

Delete removes a persona from disk.

func (*Store) Get

func (s *Store) Get(id string) (*Persona, error)

Get returns a single persona by ID.

func (*Store) List

func (s *Store) List() ([]Persona, error)

List returns all installed personas from disk.

func (*Store) Save

func (s *Store) Save(p Persona) error

Save writes a persona to disk.

Jump to

Keyboard shortcuts

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