agent

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: May 28, 2026 License: AGPL-3.0 Imports: 14 Imported by: 0

Documentation

Overview

Package agent loads agent definitions, catalogs, and built-in agent behavior.

Index

Constants

View Source
const DefaultID = "builder"

Variables

View Source
var (
	ErrAgentIDRequired                = errors.New("agent id is required")
	ErrAgentModeInvalid               = errors.New("agent mode is invalid")
	ErrAgentFallbackModelsUnsupported = errors.New("agent fallback models are not supported")
)
View Source
var ErrAgentNotFound = errors.New("agent not found")

Functions

func BuiltinAgentFS

func BuiltinAgentFS() embed.FS

Types

type Catalog

type Catalog struct {
	// contains filtered or unexported fields
}

func NewBuiltinsCatalog

func NewBuiltinsCatalog() (*Catalog, error)

func (*Catalog) Get

func (c *Catalog) Get(id string) (Definition, error)

func (*Catalog) List

func (c *Catalog) List() []Definition

type Definition

type Definition struct {
	ID              string
	Description     string
	Prompt          string
	ModelRoute      provider.ModelRoute
	Mode            Mode
	Hidden          bool
	AllowedTools    []string
	DisallowedTools []string
	Handoff         HandoffContract
}

func (Definition) AllowsTool

func (d Definition) AllowsTool(name string) bool

func (Definition) Delegatable

func (d Definition) Delegatable() bool

func (Definition) EffectiveMode

func (d Definition) EffectiveMode() Mode

func (Definition) HasPrompt

func (d Definition) HasPrompt() bool

func (Definition) PromptFragment

func (d Definition) PromptFragment() prompt.Fragment

func (Definition) Selectable

func (d Definition) Selectable() bool

func (Definition) Validate

func (d Definition) Validate() error

type HandoffConsume

type HandoffConsume struct {
	Kind       string
	Required   bool
	From       string
	MaxSources int
	Missing    string
}

type HandoffContract

type HandoffContract struct {
	Provides []HandoffProvide
	Consumes []HandoffConsume
}

type HandoffProvide

type HandoffProvide struct {
	Kind        string
	Description string
}

type Mode

type Mode string
const (
	ModePrimary  Mode = "primary"
	ModeSubagent Mode = "subagent"
	ModeAll      Mode = "all"
)

type Registry

type Registry struct {
	// contains filtered or unexported fields
}

func NewRegistry

func NewRegistry(config RegistryConfig) (*Registry, error)

func (*Registry) Catalog

func (r *Registry) Catalog(workspaceRoot string) (*Catalog, error)

func (*Registry) Get

func (r *Registry) Get(workspaceRoot, id string) (Definition, error)

type RegistryConfig

type RegistryConfig struct {
	GlobalDir string
}

Jump to

Keyboard shortcuts

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