MCPcopy
hub / github.com/wshobson/agents / _make_agent

Function _make_agent

tools/tests/conftest.py:40–53  ·  view source on GitHub ↗
(plugin_dir: Path, name: str, frontmatter: str, body: str)

Source from the content-addressed store, hash-verified

38
39
40def _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
56def _make_command(plugin_dir: Path, name: str, frontmatter: str, body: str) -> CommandSource:

Calls 2

parse_frontmatterFunction · 0.90
AgentSourceClass · 0.90

Tested by

no test coverage detected