parser

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Dec 26, 2025 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AgentSpec

type AgentSpec struct {
	// YAML frontmatter fields
	Name        string        `yaml:"name" json:"name"`
	Description string        `yaml:"description" json:"description"`
	Tools       FlexibleTools `yaml:"tools,omitempty" json:"tools,omitempty"`

	// Derived fields
	ToolsInherited bool   `json:"tools_inherited"`
	Prompt         string `json:"prompt"`

	// File metadata
	FilePath string    `json:"file_path"`
	FileName string    `json:"file_name"`
	FileSize int64     `json:"file_size"`
	ModTime  time.Time `json:"mod_time"`

	// Installation metadata
	Source      string    `json:"source,omitempty"`
	InstalledAt time.Time `json:"installed_at,omitempty"`
}

AgentSpec represents a Claude Code subagent

func (*AgentSpec) GetToolsAsSlice

func (a *AgentSpec) GetToolsAsSlice() []string

GetToolsAsSlice returns tools as []string for compatibility with existing code

type FlexibleTools

type FlexibleTools []string

FlexibleTools is a custom type that can unmarshal both string and array formats

func (FlexibleTools) GetTools

func (ft FlexibleTools) GetTools() []string

GetTools returns tools as []string for compatibility

func (*FlexibleTools) UnmarshalYAML

func (ft *FlexibleTools) UnmarshalYAML(node *yaml.Node) error

UnmarshalYAML implements custom YAML unmarshaling for tools field

type Parser

type Parser struct {
	SuppressWarnings bool
}

Parser extracts agent specifications

func NewParser

func NewParser() *Parser

NewParser creates a new parser

func NewParserWithOptions

func NewParserWithOptions(suppressWarnings bool) *Parser

NewParserWithOptions creates a new parser with options

func (*Parser) ParseDirectory

func (p *Parser) ParseDirectory(dir string) ([]*AgentSpec, error)

ParseDirectory parses all agents in a directory

func (*Parser) ParseFile

func (p *Parser) ParseFile(path string) (*AgentSpec, error)

ParseFile extracts agent spec from a file

Jump to

Keyboard shortcuts

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