MCPcopy Create free account
hub / github.com/SethGammon/Citadel / validateParsedAgent

Function validateParsedAgent

core/agents/parse-agent.js:73–87  ·  view source on GitHub ↗
(parsedAgent)

Source from the content-addressed store, hash-verified

71 return fm;
72}
73
74function extractAgentBody(content) {
75 const normalized = content.replace(/\r\n/g, '\n');
76 const bodyMatch = normalized.match(/^---\n[\s\S]*?\n---\n([\s\S]*)/);
77 return bodyMatch ? bodyMatch[1].trim() : normalized.trim();
78}
79
80function validateParsedAgent(parsedAgent) {
81 const errors = [];
82
83 for (const field of AGENT_REQUIRED_FRONTMATTER) {
84 if (!parsedAgent.frontmatter[field]) {
85 errors.push(`missing frontmatter field: ${field}`);
86 }
87 }
88
89 if (!parsedAgent.body) {
90 errors.push('missing agent instructions body');

Callers 1

parseAgentContentFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected