{"version":3,"file":"system-prompt.d.ts","sourceRoot":"","sources":["../../src/harness/system-prompt.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AAExC,wBAAgB,2BAA2B,CAAC,MAAM,EAAE,KAAK,EAAE,GAAG,MAAM,CAsBnE","sourcesContent":["import type { Skill } from \"./types.ts\";\n\nexport function formatSkillsForSystemPrompt(skills: Skill[]): string {\n\tconst visibleSkills = skills.filter((skill) => !skill.disableModelInvocation);\n\tif (visibleSkills.length === 0) return \"\";\n\n\tconst lines = [\n\t\t\"The following skills provide specialized instructions for specific tasks.\",\n\t\t\"Read the full skill file when the task matches its description.\",\n\t\t\"When a skill file references a relative path, resolve it against the skill directory (parent of SKILL.md / dirname of the path) and use that absolute path in tool commands.\",\n\t\t\"\",\n\t\t\"<available_skills>\",\n\t];\n\n\tfor (const skill of visibleSkills) {\n\t\tlines.push(\"  <skill>\");\n\t\tlines.push(`    <name>${escapeXml(skill.name)}</name>`);\n\t\tlines.push(`    <description>${escapeXml(skill.description)}</description>`);\n\t\tlines.push(`    <location>${escapeXml(skill.filePath)}</location>`);\n\t\tlines.push(\"  </skill>\");\n\t}\n\n\tlines.push(\"</available_skills>\");\n\treturn lines.join(\"\\n\");\n}\n\nfunction escapeXml(value: string): string {\n\treturn value\n\t\t.replace(/&/g, \"&amp;\")\n\t\t.replace(/</g, \"&lt;\")\n\t\t.replace(/>/g, \"&gt;\")\n\t\t.replace(/\"/g, \"&quot;\")\n\t\t.replace(/'/g, \"&apos;\");\n}\n"]}