MCPcopy Create free account
hub / github.com/Microck/opencode-studio / parseAgentMarkdown

Function parseAgentMarkdown

server/index.js:898–908  ·  view source on GitHub ↗
(content)

Source from the content-addressed store, hash-verified

896};
897
898const parseAgentMarkdown = (content) => {
899 const match = content.match(/^---\s*\r?\n([\s\S]*?)\r?\n---\s*\r?\n?([\s\S]*)$/);
900 if (!match) return { data: {}, body: content };
901 let data = {};
902 try {
903 data = yaml.load(match[1]) || {};
904 } catch {
905 data = {};
906 }
907 return { data, body: match[2] || '' };
908};
909
910const buildAgentMarkdown = (frontmatter, body) => {
911 const yamlText = yaml.dump(frontmatter, { lineWidth: 120, noRefs: true, quotingType: '"' });

Callers 2

loadSkillsFromDirFunction · 0.85
aggregateAgentsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected