Documentation
¶
Overview ¶
Package persona handles loading and managing persona definitions.
Index ¶
- type Manager
- func (m *Manager) ApplyPersona(personaName, prompt string) string
- func (m *Manager) GetActivePersona() string
- func (m *Manager) GetPersona(name string) string
- func (m *Manager) GetPersonaMCPConfig(name string) string
- func (m *Manager) HasPersona(name string) bool
- func (m *Manager) ListPersonas() []string
- func (m *Manager) SetActivePersona(name string)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
Manager handles persona loading and retrieval.
func NewManager ¶
NewManager creates a new persona manager. If personaPath is empty, creates an empty manager.
func NewManagerWithBuiltins ¶ added in v0.200.0
NewManagerWithBuiltins creates a persona manager that first loads built-in personas from the provided embed.FS, then overlays any user-defined personas from personaPath. personaPath may be empty (only built-ins will be loaded).
func (*Manager) ApplyPersona ¶
ApplyPersona prepends persona content to the given prompt. If persona is empty or not found, returns the original prompt.
func (*Manager) GetActivePersona ¶ added in v0.200.0
GetActivePersona returns the currently active persona name. Empty string means no persona is manually set (auto-select or none).
func (*Manager) GetPersona ¶
GetPersona returns the content of a persona by name. Returns empty string if persona not found.
func (*Manager) GetPersonaMCPConfig ¶
GetPersonaMCPConfig returns the path to the persona's associated MCP config file. Returns empty string if the persona has no associated MCP config.
func (*Manager) HasPersona ¶
HasPersona checks if a persona exists.
func (*Manager) ListPersonas ¶
ListPersonas returns a sorted list of available persona names.
func (*Manager) SetActivePersona ¶ added in v0.200.0
SetActivePersona sets the manually selected persona. Pass empty string to clear the active persona (revert to auto-select or none).