agent

package
v1.12.0 Latest Latest
Warning

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

Go to latest
Published: Mar 8, 2026 License: MIT Imports: 11 Imported by: 0

Documentation

Overview

Package agent provides the agent registry and configuration management. Agents are configured via markdown files with YAML frontmatter.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InvalidateRegistry

func InvalidateRegistry()

InvalidateRegistry clears the cached registry so it will be reloaded on next GetRegistry call. This is useful when agent configurations change at runtime.

Types

type AgentInfo

type AgentInfo struct {
	ID              string           `yaml:"-"`
	Name            string           `yaml:"name,omitempty"`
	Description     string           `yaml:"description,omitempty"`
	Mode            config.AgentMode `yaml:"mode,omitempty"`
	Native          bool             `yaml:"native,omitempty"`
	Hidden          bool             `yaml:"hidden,omitempty"`
	Disabled        bool             `yaml:"disabled,omitempty"`
	Color           string           `yaml:"color,omitempty"`
	Model           string           `yaml:"model,omitempty"`
	MaxTokens       int64            `yaml:"maxTokens,omitempty"`
	ReasoningEffort string           `yaml:"reasoningEffort,omitempty"`
	Prompt          string           `yaml:"-"`
	Permission      map[string]any   `yaml:"permission,omitempty"`
	Tools           map[string]bool  `yaml:"tools,omitempty"`
	Output          *Output          `yaml:"output,omitempty"`
	Location        string           `yaml:"-"`
}

AgentInfo holds the configuration for an agent. It includes metadata like name, description, mode, and tool permissions.

type Output added in v1.3.0

type Output struct {
	Schema map[string]any `json:"schema,omitempty" yaml:"schema,omitempty"`
}

Output defines the output schema for an agent.

type Registry

type Registry interface {
	Get(id string) (AgentInfo, bool)
	List() []AgentInfo
	ListByMode(mode config.AgentMode) []AgentInfo
	// Resolves agent specific permission action for a given tool
	EvaluatePermission(agentID, toolName, input string) permission.Action
	IsToolEnabled(agentID, toolName string) bool
	GlobalPermissions() map[string]any
}

Registry provides access to agent configurations. It allows querying agents by ID, listing all agents, and checking tool permissions.

func GetRegistry

func GetRegistry() Registry

GetRegistry returns the global agent registry instance. It initializes the registry on first call with built-in agents, discovered markdown agents, and configuration overrides.

Jump to

Keyboard shortcuts

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