/**
 * install/transforms/pi.mjs — Pi coding agent transform.
 *
 * Pi uses prompt templates under `.pi/prompts/` for slash commands and
 * root-level skills under `.pi/skills/`. Unlike Codex, Pi supports
 * colon-form prompt names, so `/apt:foo` references are preserved.
 */
import { basename, dirname } from 'node:path';
import { substituteVersion } from './_shared.mjs';
function promptNameForSkill(folder) {
    if (folder === 'apt')
        return 'apt';
    if (folder.startsWith('apt-'))
        return `apt:${folder.slice('apt-'.length)}`;
    return folder;
}
/**
 * @param {import('../pipeline.mjs').TransformInput} input
 * @returns {import('../pipeline.mjs').TransformOutput[]}
 */
export function transform({ canonicalContent, canonicalRelPath, version, fileType }) {
    const content = substituteVersion(canonicalContent, version);
    if (fileType === 'skill') {
        const folder = basename(dirname(canonicalRelPath));
        const promptName = promptNameForSkill(folder);
        return [
            { outputPath: `skills/${folder}/SKILL.md`, content },
            { outputPath: `prompts/${promptName}.md`, content },
        ];
    }
    if (fileType === 'agent') {
        const file = basename(canonicalRelPath);
        return [{ outputPath: `skills/${file}`, content }];
    }
    return [];
}
//# sourceMappingURL=pi.mjs.map