Documentation
¶
Index ¶
- func RenderAgentMD(def *AgentDefinition) ([]byte, error)
- type AgentDefinition
- type AgentSource
- type AgentStatus
- type EmbeddedStore
- type FileStore
- type Registry
- func (r *Registry) Active() []*AgentDefinition
- func (r *Registry) All() []*AgentDefinition
- func (r *Registry) Get(name string) (*AgentDefinition, bool)
- func (r *Registry) LoadFromStore(store Store) error
- func (r *Registry) Register(def *AgentDefinition)
- func (r *Registry) RegisterAll(defs []*AgentDefinition)
- func (r *Registry) Specs() []orchestration.AgentSpec
- type Store
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RenderAgentMD ¶
func RenderAgentMD(def *AgentDefinition) ([]byte, error)
RenderAgentMD renders an AgentDefinition to AGENT.md format.
Types ¶
type AgentDefinition ¶
type AgentDefinition struct {
Name string `yaml:"name"`
Description string `yaml:"description"`
Instruction string `yaml:"-"` // markdown body
Status AgentStatus `yaml:"status"`
Prefixes []string `yaml:"prefixes,omitempty"`
Keywords []string `yaml:"keywords,omitempty"`
Capabilities []string `yaml:"capabilities,omitempty"`
Accepts string `yaml:"accepts,omitempty"`
Returns string `yaml:"returns,omitempty"`
CannotDo []string `yaml:"cannot_do,omitempty"`
AlwaysInclude bool `yaml:"always_include,omitempty"`
SessionIsolation bool `yaml:"session_isolation,omitempty"`
Source AgentSource `yaml:"-"`
}
AgentDefinition is the parsed representation of an AGENT.md file.
func ParseAgentMD ¶
func ParseAgentMD(content []byte) (*AgentDefinition, error)
ParseAgentMD parses an AGENT.md file (YAML frontmatter + markdown body).
type AgentSource ¶
type AgentSource int
AgentSource indicates where an agent definition originated.
const ( SourceBuiltin AgentSource = iota // Hardcoded in Go SourceEmbedded // From embed.FS (defaults/) SourceUser // From ~/.lango/agents/ SourceRemote // From P2P network )
type AgentStatus ¶
type AgentStatus string
AgentStatus controls whether an agent is active.
const ( StatusActive AgentStatus = "active" StatusDisabled AgentStatus = "disabled" StatusDraft AgentStatus = "draft" )
type EmbeddedStore ¶
type EmbeddedStore struct{}
EmbeddedStore loads agent definitions from the embedded defaults/ directory.
func NewEmbeddedStore ¶
func NewEmbeddedStore() *EmbeddedStore
NewEmbeddedStore creates an EmbeddedStore.
func (*EmbeddedStore) Load ¶
func (s *EmbeddedStore) Load() ([]*AgentDefinition, error)
Load reads all embedded AGENT.md files and returns parsed definitions.
type FileStore ¶
type FileStore struct {
// contains filtered or unexported fields
}
FileStore loads agent definitions from a directory of AGENT.md files. Expected structure: <dir>/<name>/AGENT.md
func NewFileStore ¶
NewFileStore creates a FileStore that reads from the given directory.
func (*FileStore) Load ¶
func (s *FileStore) Load() ([]*AgentDefinition, error)
Load reads all AGENT.md files from subdirectories and returns parsed definitions.
type Registry ¶
type Registry struct {
// contains filtered or unexported fields
}
Registry manages agent definitions from multiple sources.
func (*Registry) Active ¶
func (r *Registry) Active() []*AgentDefinition
Active returns all agent definitions with status "active", sorted by name.
func (*Registry) All ¶
func (r *Registry) All() []*AgentDefinition
All returns all agent definitions in insertion order.
func (*Registry) Get ¶
func (r *Registry) Get(name string) (*AgentDefinition, bool)
Get returns the agent definition with the given name.
func (*Registry) LoadFromStore ¶
LoadFromStore loads agent definitions from a Store and registers them all.
func (*Registry) Register ¶
func (r *Registry) Register(def *AgentDefinition)
Register adds or overwrites an agent definition by name.
func (*Registry) RegisterAll ¶
func (r *Registry) RegisterAll(defs []*AgentDefinition)
RegisterAll registers multiple agent definitions.
func (*Registry) Specs ¶
func (r *Registry) Specs() []orchestration.AgentSpec
Specs converts all active agent definitions to orchestration.AgentSpec format.
type Store ¶
type Store interface {
// Load returns all agent definitions from this store.
Load() ([]*AgentDefinition, error)
}
Store is the interface for loading agent definitions from a source.