Class: SolidAgent::AgentManifest::Parsers::AgentMdParser
- Inherits:
-
BaseParser
- Object
- BaseParser
- SolidAgent::AgentManifest::Parsers::AgentMdParser
- Defined in:
- lib/solid_agent/agent_manifest/parsers/agent_md_parser.rb
Overview
AgentMdParser handles the native .agent.md format.
This is the primary format for ActiveAgent manifests, featuring YAML frontmatter with comprehensive metadata and a Markdown body containing instructions and Liquid templates.
Constant Summary
Constants inherited from BaseParser
Class Method Summary collapse
Methods inherited from BaseParser
Class Method Details
.format_name ⇒ Object
24 25 26 |
# File 'lib/solid_agent/agent_manifest/parsers/agent_md_parser.rb', line 24 def format_name :agent_md end |
.parse_string(content) ⇒ Object
28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 |
# File 'lib/solid_agent/agent_manifest/parsers/agent_md_parser.rb', line 28 def parse_string(content) frontmatter, body = extract_frontmatter(content) Manifest.new( # Meta name: frontmatter["name"], version: frontmatter["version"], description: frontmatter["description"], author: frontmatter["author"], license: frontmatter["license"], repository: frontmatter["repository"], tags: (frontmatter["tags"]), extends: frontmatter["extends"], # Model model: normalize_model(frontmatter["model"]), config: parse_config(frontmatter), # Schemas input_schema: parse_input_schema(frontmatter["input"]), output_schema: frontmatter["output"], # Tools & Resources tools: parse_tools(frontmatter["tools"]), resources: parse_resources(frontmatter["resources"]), # Instructions instructions: extract_instructions(body), template: body.presence, # Extensions extensions: extract_extensions(frontmatter), # Examples & Tests examples: frontmatter["examples"] || [], tests: frontmatter["tests"] || [] ) end |