Something went wrong. Try again.
fork of prime agent with changes i want but are not upstreamable probqbly (and some fixes)
Something went wrong. Try again.
618 B · 22 lines
TypeScript
at main
1234567891011121314151617181920212223/** Parsed skill block from a user message. */export interface ParsedSkillBlock { name: string; location: string; content: string; userMessage: string | undefined;}
/** * Parse a skill block from message text. * Returns null if the text doesn't contain a skill block. */export function parseSkillBlock(text: string): ParsedSkillBlock | null { const match = text.match(/^<skill name="([^"]+)" location="([^"]+)">\n([\s\S]*?)\n<\/skill>(?:\n\n([\s\S]+))?$/); if (!match) return null; return { name: match[1], location: match[2], content: match[3], userMessage: match[4]?.trim() || undefined, };}