1091
}
1092
1093
>
export async function parseAgentFile(uri: URI, fileService: IFileService): Promise<{ name: string; description?: string; userInvocable?: boolean }> {
pluginParsers.ts
1094
>
// Use regex to strip the trailing `.agent.md` or .md before parsing, so we can fall back to a cleaner name if frontmatter is missing or broken.
1095
>
const nameFromFile = basename(uri).replace(/(\.agent)?\.md$/i, '');
1096
>
try {
1097
>
const content = await fileService.readFile(uri);
1098
const frontmatter = parseFrontMatter(content.value.toString());
1099
>
const name = frontmatter?.getStringValue('name')?.trim() || nameFromFile;
pluginParsers.ts
1100
>
const description = frontmatter?.getStringValue('description')?.trim();
1101
>
const userInvocable = frontmatter?.getBooleanValue('user-invocable');
1102
>
return { name, description, userInvocable };
1103
>
} catch {
1104
return { name: nameFromFile };
1105
}
1107
1108
export async function parseSkillFile(uri: URI, fileService: IFileService): Promise<{ name: string; description?: string; userInvokable?: boolean }> {