Documentation
¶
Overview ¶
Package core provides the canonical agent definition types. Agent definitions use the multi-agent-spec types as the canonical form, which maps losslessly to Claude Code, Kiro CLI, and OpenAI Codex.
Index ¶
- Constants
- Variables
- func AdapterNames() []string
- func MarshalMarkdownAgent(agent *Agent) []byte
- func Register(adapter Adapter)
- func WriteAgentsToDir(agents []*Agent, dir string, adapterName string) error
- func WriteCanonicalFile(agent *Agent, path string) error
- func WriteCanonicalJSON(agent *Agent, path string) error
- type Adapter
- type AdapterError
- type Agent
- type MarshalError
- type Model
- type ParseError
- type ReadError
- type Registry
- type Task
- type WriteError
Constants ¶
const ( ModelHaiku = multiagentspec.ModelHaiku ModelSonnet = multiagentspec.ModelSonnet ModelOpus = multiagentspec.ModelOpus )
Model constants from multiagentspec.
const DefaultDirMode fs.FileMode = 0700
DefaultDirMode is the default permission for generated directories.
const DefaultFileMode fs.FileMode = 0600
DefaultFileMode is the default permission for generated files.
Variables ¶
var DefaultRegistry = NewRegistry()
DefaultRegistry is the global adapter registry.
Functions ¶
func AdapterNames ¶
func AdapterNames() []string
AdapterNames returns adapter names from the default registry.
func MarshalMarkdownAgent ¶
MarshalMarkdownAgent converts an Agent to Markdown + YAML frontmatter bytes.
func WriteAgentsToDir ¶
WriteAgentsToDir writes multiple agents to a directory using the specified adapter.
func WriteCanonicalFile ¶
WriteCanonicalFile writes a canonical agent file in Markdown + YAML frontmatter format.
func WriteCanonicalJSON ¶
WriteCanonicalJSON writes a canonical agent.json file (for validation/schema compatibility).
Types ¶
type Adapter ¶
type Adapter interface {
// Name returns the adapter identifier (e.g., "claude", "gemini").
Name() string
// FileExtension returns the file extension for agent files.
FileExtension() string
// DefaultDir returns the default directory name for agents.
DefaultDir() string
// Parse converts tool-specific bytes to canonical Agent.
Parse(data []byte) (*Agent, error)
// Marshal converts canonical Agent to tool-specific bytes.
Marshal(agent *Agent) ([]byte, error)
// ReadFile reads from path and returns canonical Agent.
ReadFile(path string) (*Agent, error)
// WriteFile writes canonical Agent to path.
WriteFile(agent *Agent, path string) error
}
Adapter converts between canonical Agent definitions and tool-specific formats.
func GetAdapter ¶
GetAdapter returns an adapter from the default registry.
type AdapterError ¶
type AdapterError struct {
Name string
}
AdapterError indicates an unknown adapter was requested.
func (*AdapterError) Error ¶
func (e *AdapterError) Error() string
type Agent ¶
type Agent = multiagentspec.Agent
Agent is an alias for multiagentspec.Agent. This is the canonical agent definition type used across all platforms.
func ParseMarkdownAgent ¶
ParseMarkdownAgent parses a Markdown file with YAML frontmatter into an Agent. Deprecated: Use multiagentspec.ParseAgentMarkdown directly.
func ReadCanonicalDir ¶
ReadCanonicalDir reads all agent files (.md or .json) from a directory. This delegates to multiagentspec.LoadAgentsFromDir for markdown files.
func ReadCanonicalFile ¶
ReadCanonicalFile reads a canonical agent file (Markdown + YAML frontmatter or JSON). The format is auto-detected based on file extension or content.
type MarshalError ¶
MarshalError indicates a failure to marshal agent data.
func (*MarshalError) Error ¶
func (e *MarshalError) Error() string
func (*MarshalError) Unwrap ¶
func (e *MarshalError) Unwrap() error
type Model ¶ added in v0.7.0
type Model = multiagentspec.Model
Model is an alias for multiagentspec.Model.
type ParseError ¶
ParseError indicates a failure to parse agent data.
func (*ParseError) Error ¶
func (e *ParseError) Error() string
func (*ParseError) Unwrap ¶
func (e *ParseError) Unwrap() error
type Registry ¶
type Registry struct {
// contains filtered or unexported fields
}
Registry manages adapter registration and lookup.
func (*Registry) AdapterNames ¶
AdapterNames returns all registered adapter names sorted alphabetically.
func (*Registry) GetAdapter ¶
GetAdapter returns an adapter by name.
type Task ¶ added in v0.7.0
type Task = multiagentspec.Task
Task is an alias for multiagentspec.Task.
type WriteError ¶
WriteError indicates a failure to write a file.
func (*WriteError) Error ¶
func (e *WriteError) Error() string
func (*WriteError) Unwrap ¶
func (e *WriteError) Unwrap() error