Documentation
¶
Overview ¶
Package agents loads the agents a workspace offers: the built-in ones and Markdown files with YAML frontmatter from ~/.blitz/agents (and the project's, when it's trusted), each a name, a description, a system prompt, the tools it may use and optionally its own model (spec_agents_014).
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AgentMetadata ¶
type AgentMetadata struct {
Name string `yaml:"name"`
DisplayName string `yaml:"display_name"`
Description string `yaml:"description"`
Tools []string `yaml:"tools"`
DefaultModel string `yaml:"default_model,omitempty"`
AgencyLevel string `yaml:"agency_level,omitempty"`
}
AgentMetadata holds frontmatter metadata defined in the markdown header.
type AgentSpec ¶
type AgentSpec struct {
AgentMetadata
SystemPrompt string
}
AgentSpec represents a parsed agent specification with frontmatter and markdown body.
func ParseMarkdownSpec ¶
ParseMarkdownSpec parses a markdown file containing YAML frontmatter.
func (*AgentSpec) InterpolatePrompt ¶
InterpolatePrompt fills in the agency rules for agencyLevel ("" is high).
type Registry ¶
type Registry struct {
// contains filtered or unexported fields
}
Registry manages discovered and built-in agents.
func NewRegistry ¶
NewRegistry creates a new Registry and loads built-in embedded agent specs.
func (*Registry) LoadExternalAgents ¶
LoadExternalAgents scans directories for user-defined .md agent specifications. A leading "~" is expanded. External specs may add new agents but may not replace built-in ones, since that would let a directory silently swap the system prompt and tool list of a trusted persona. Rejected or unparsable specs are reported in the returned (joined) error; valid ones are still loaded.