Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrMissingFrontmatter = errors.New("missing YAML frontmatter")
ErrMissingFrontmatter is returned when a file has no YAML frontmatter block.
var ErrUnknownType = errors.New("unknown document type")
ErrUnknownType is returned when frontmatter declares an unknown type.
Functions ¶
This section is empty.
Types ¶
type AgentSpec ¶
type AgentSpec struct {
Meta `yaml:",inline"`
Model string `yaml:"model"`
FallbackModels []string `yaml:"fallback,omitempty"`
Tools []string `yaml:"tools,omitempty"`
MCP []string `yaml:"mcp,omitempty"`
Skills []string `yaml:"skills,omitempty"`
Subagents []string `yaml:"subagents,omitempty"`
Powers []string `yaml:"powers,omitempty"`
Temperature *float64 `yaml:"temperature,omitempty"`
MaxTokens *int `yaml:"max_tokens,omitempty"`
ThinkingPhrases []string `yaml:"thinking_phrases,omitempty"`
PIIGuard string `yaml:"pii_guard,omitempty"`
ResponseSchema any `yaml:"response_schema,omitempty"`
Routing *RoutingConfig `yaml:"routing,omitempty"`
}
AgentSpec describes a runnable agent.
func (*AgentSpec) ResponseSchemaJSON ¶
func (a *AgentSpec) ResponseSchemaJSON() json.RawMessage
ResponseSchemaJSON returns the response_schema as JSON bytes suitable for passing to providers. Returns nil if no schema is set.
type Document ¶
Document is the parsed result of a single MD file. Spec holds a pointer to the typed spec matching Meta.Type.
func LoadDir ¶
LoadDir walks dir recursively and parses every .md file. Parse errors are returned as a joined error so callers see all problems at once.
type ExpertRoute ¶ added in v0.2.0
type ExpertRoute struct {
Category string `yaml:"category"` // e.g. "reasoning", "speed", "longctx"
Model string `yaml:"model"` // provider/model
Fallback []string `yaml:"fallback,omitempty"`
System string `yaml:"system,omitempty"` // override system prompt for this category
MaxTokens *int `yaml:"max_tokens,omitempty"`
// Classification signals (any match → this expert)
Keywords []string `yaml:"keywords,omitempty"` // substring match in input
MinLength int `yaml:"min_length,omitempty"` // input char count threshold
MaxLength int `yaml:"max_length,omitempty"` // upper bound for this expert
}
ExpertRoute maps a category to a model and optional system prompt override.
type Issue ¶
Issue is a single validation problem found in a Document.
func ValidateDocs ¶
ValidateDocs validates a collection of documents and additionally checks cross-references: agent.tools / agent.mcp / agent.skills / agent.subagents must resolve to known documents in the same set, with the right type.
type MCPInstall ¶ added in v0.0.35
type MCPInstall struct {
Pip string `yaml:"pip,omitempty"`
Npm string `yaml:"npm,omitempty"`
Brew string `yaml:"brew,omitempty"`
}
MCPInstall describes how to install the MCP server binary.
type MCPServerSpec ¶
type MCPServerSpec struct {
Meta `yaml:",inline"`
Transport MCPTransport `yaml:"transport"`
Command []string `yaml:"command,omitempty"`
URL string `yaml:"url,omitempty"`
Env map[string]string `yaml:"env,omitempty"`
ToolPrefix string `yaml:"tool_prefix,omitempty"`
AllowedAgents []string `yaml:"allowed_agents,omitempty"`
Install *MCPInstall `yaml:"install,omitempty"`
}
MCPServerSpec describes an MCP server the agent can connect to.
type MCPTransport ¶
type MCPTransport string
MCPTransport identifies how the MCP client connects to the server.
const ( TransportStdio MCPTransport = "stdio" TransportSSE MCPTransport = "sse" TransportHTTP MCPTransport = "http" )
type Meta ¶
type Meta struct {
Name string `yaml:"name"`
Type DocType `yaml:"type"`
Description string `yaml:"description,omitempty"`
Version int `yaml:"version,omitempty"`
}
Meta is the common frontmatter present on every document.
type PackageSpec ¶ added in v0.2.0
type PackageSpec struct {
Meta `yaml:",inline"`
Agents []string `yaml:"agents,omitempty"`
Skills []string `yaml:"skills,omitempty"`
Tools []string `yaml:"tools,omitempty"`
MCP []string `yaml:"mcp,omitempty"`
Entitlements []string `yaml:"entitlements,omitempty"`
}
PackageSpec describes a curated bundle of agents, skills, MCP servers, and other product entitlements.
type RoutingConfig ¶ added in v0.2.0
type RoutingConfig struct {
Experts []ExpertRoute `yaml:"experts"`
}
RoutingConfig defines MoE (Mixture of Experts) routing at the engine level. The engine classifies each user turn and overrides the model before calling the LLM — zero extra LLM calls for routing.
type ToolRuntime ¶
type ToolRuntime string
ToolRuntime identifies how a tool is executed.
const ( RuntimeBuiltin ToolRuntime = "builtin" RuntimeMCP ToolRuntime = "mcp" RuntimeShell ToolRuntime = "shell" )
type ToolSpec ¶
type ToolSpec struct {
Meta `yaml:",inline"`
Runtime ToolRuntime `yaml:"runtime"`
Command []string `yaml:"command,omitempty"`
Env map[string]string `yaml:"env,omitempty"`
// Parameters is a JSON-Schema "object" describing the tool's inputs,
// advertised to the model. The model-provided JSON is delivered to a
// shell tool on stdin. Optional; omit for tools that take no input.
Parameters any `yaml:"parameters,omitempty"`
// TimeoutSec bounds a shell tool's execution. Zero uses a default.
TimeoutSec int `yaml:"timeout_sec,omitempty"`
}
ToolSpec describes a tool definition (builtin pointer, MCP reference, or external shell command).
func (*ToolSpec) ParametersJSON ¶ added in v0.2.0
func (t *ToolSpec) ParametersJSON() json.RawMessage
ParametersJSON returns the parameters as a JSON-Schema object suitable for advertising to the model. Falls back to an empty object schema when unset.