personas

package
v0.17.21 Latest Latest
Warning

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

Go to latest
Published: Aug 29, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	IDOrchestrator = "orchestrator"
	IDGeneral      = "general"
	IDCoder        = "coder"
	IDRefactor     = "refactor"
	IDDebugger     = "debugger"
	IDTester       = "tester"
	IDReviewer     = "reviewer"
	IDResearcher   = "researcher"
	IDWebScraper   = "web_scraper"
	IDCoordinator  = "coordinator"
	IDComputerUser = "computer_user"
)

Canonical persona IDs. Use these constants instead of string literals so that renames stay coupled to a single point of change.

IDs here must match the `id` fields in pkg/personas/configs/*.json after normalization (lowercase, dashes → underscores). Aliases live in each persona's JSON `aliases` array and are resolved at lookup time, not here.

View Source
const (
	// CapabilityGitWrite — persona may perform git write operations (commit,
	// stage, push) via the dedicated commit tool and shell_command. Any persona
	// declaring this capability is allowed git-write operations.
	CapabilityGitWrite = "git_write"

	// CapabilityComputerUse — persona may drive the desktop (mouse, keyboard,
	// screenshots) via the computer_use tools. Held only by the computer_user
	// persona and gated further by the ComputerUse.Enabled config flag.
	CapabilityComputerUse = "computer_use"
)

Canonical persona capability names. A capability is an explicit grant of agency that some personas have and others don't — e.g. the right to perform git writes, or (after SP-NNN spawn_policy) the right to spawn subagents. Use these constants rather than string literals so renames stay typesafe.

Variables

This section is empty.

Functions

func DefaultDefinitions

func DefaultDefinitions() (map[string]Definition, error)

DefaultDefinitions returns the merged built-in persona definitions from embedded JSON files.

Types

type AutoApproveRules

type AutoApproveRules struct {
	LowRiskOps    []string `json:"low_risk,omitempty"`
	MediumRiskOps []string `json:"medium_risk,omitempty"`
	HighRiskNever []string `json:"high_risk_never,omitempty"`
}

AutoApproveRules mirrors the configuration package's AutoApproveRules for JSON deserialization from persona catalog files.

type Catalog

type Catalog struct {
	Personas []Definition `json:"personas"`
}

type Definition

type Definition struct {
	ID                 string            `json:"id"`
	Name               string            `json:"name"`
	Description        string            `json:"description"`
	Provider           string            `json:"provider,omitempty"`
	Model              string            `json:"model,omitempty"`
	SystemPrompt       string            `json:"system_prompt,omitempty"`
	SystemPromptText   string            `json:"system_prompt_text,omitempty"`
	SystemPromptAppend string            `json:"system_prompt_append,omitempty"`
	AllowedTools       []string          `json:"allowed_tools,omitempty"`
	Enabled            bool              `json:"enabled"`
	Aliases            []string          `json:"aliases,omitempty"`
	LocalOnly          bool              `json:"local_only,omitempty"`
	Delegatable        bool              `json:"delegatable,omitempty"`
	AutoApproveRules   *AutoApproveRules `json:"auto_approve_rules,omitempty"`
	// Capabilities is an explicit list of agency grants this persona holds —
	// e.g. CapabilityGitWrite. Replaces the previous practice of inferring
	// capabilities by sniffing AutoApproveRules. AutoApproveRules now means
	// purely "what auto-approves at runtime"; capabilities mean "what this
	// persona is fundamentally allowed to do".
	Capabilities []string `json:"capabilities,omitempty"`
	// CanSpawnNonDelegatable lists otherwise-undelegatable persona IDs that
	// this persona is explicitly permitted to spawn as a subagent. Replaces
	// the implicit "hasEASpawnAuthority" carve-out: instead of detecting
	// EA-class personas by sniffing AutoApproveRules for "subagent_spawn",
	// the catalog now declares the chain directly. The coordinator carries
	// ["orchestrator"] so the canonical coordinator→orchestrator→specialist
	// chain works without special-case code.
	CanSpawnNonDelegatable []string `json:"can_spawn_non_delegatable,omitempty"`
}

Jump to

Keyboard shortcuts

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