(plugin_dir: Path, name: str, frontmatter: str, body: str)
| 38 | |
| 39 | |
| 40 | def _make_agent(plugin_dir: Path, name: str, frontmatter: str, body: str) -> AgentSource: |
| 41 | agents_dir = plugin_dir / "agents" |
| 42 | agents_dir.mkdir(parents=True, exist_ok=True) |
| 43 | content = f"---\n{frontmatter}\n---\n\n{body}\n" |
| 44 | path = agents_dir / f"{name}.md" |
| 45 | path.write_text(content, encoding="utf-8") |
| 46 | fm, parsed_body = parse_frontmatter(content) |
| 47 | return AgentSource( |
| 48 | plugin=plugin_dir.name, |
| 49 | name=name, |
| 50 | path=path, |
| 51 | frontmatter=fm, |
| 52 | body=parsed_body, |
| 53 | ) |
| 54 | |
| 55 | |
| 56 | def _make_command(plugin_dir: Path, name: str, frontmatter: str, body: str) -> CommandSource: |
no test coverage detected