agents

package
v0.1.0-rc.1 Latest Latest
Warning

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

Go to latest
Published: Sep 28, 2026 License: Apache-2.0 Imports: 12 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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

func ParseMarkdownSpec(content []byte) (*AgentSpec, error)

ParseMarkdownSpec parses a markdown file containing YAML frontmatter.

func (*AgentSpec) InterpolatePrompt

func (spec *AgentSpec) InterpolatePrompt(agencyLevel string) string

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

func NewRegistry() (*Registry, error)

NewRegistry creates a new Registry and loads built-in embedded agent specs.

func (*Registry) Get

func (r *Registry) Get(name string) (*AgentSpec, bool)

Get retrieves an agent spec by name.

func (*Registry) List

func (r *Registry) List() []*AgentSpec

List returns all registered agents sorted by name.

func (*Registry) LoadExternalAgents

func (r *Registry) LoadExternalAgents(dirs ...string) error

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.

Directories

Path Synopsis
Package builtin holds the agents Blitz ships with, as Markdown files embedded in the binary.
Package builtin holds the agents Blitz ships with, as Markdown files embedded in the binary.

Jump to

Keyboard shortcuts

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