persona

package
v0.411.0 Latest Latest
Warning

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

Go to latest
Published: Jun 1, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package persona handles loading and managing persona definitions.

Index

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

func NewManager(personaPath string) (*Manager, error)

NewManager creates a new persona manager. If personaPath is empty, creates an empty manager.

func NewManagerWithBuiltins added in v0.200.0

func NewManagerWithBuiltins(builtinFS fs.ReadDirFS, personaPath string) (*Manager, error)

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

func (m *Manager) ApplyPersona(personaName, prompt string) string

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

func (m *Manager) GetActivePersona() string

GetActivePersona returns the currently active persona name. Empty string means no persona is manually set (auto-select or none).

func (*Manager) GetPersona

func (m *Manager) GetPersona(name string) string

GetPersona returns the content of a persona by name. Returns empty string if persona not found.

func (*Manager) GetPersonaMCPConfig

func (m *Manager) GetPersonaMCPConfig(name string) string

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

func (m *Manager) HasPersona(name string) bool

HasPersona checks if a persona exists.

func (*Manager) ListPersonas

func (m *Manager) ListPersonas() []string

ListPersonas returns a sorted list of available persona names.

func (*Manager) SetActivePersona added in v0.200.0

func (m *Manager) SetActivePersona(name string)

SetActivePersona sets the manually selected persona. Pass empty string to clear the active persona (revert to auto-select or none).

Directories

Path Synopsis
Package builtin provides embedded built-in persona definitions.
Package builtin provides embedded built-in persona definitions.

Jump to

Keyboard shortcuts

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