/**
 * Ordered list of placeholder definitions used during skill adaptation.
 * Each entry maps a template placeholder to a ProjectKnowledge field or a derive function.
 */
export const PLACEHOLDER_MAP = [
    {
        placeholder: '{typecheck_cmd}',
        knowledgePath: 'lintCommand',
        fallback: 'pnpm typecheck',
    },
    {
        placeholder: '{test_cmd}',
        knowledgePath: 'testCommand',
        fallback: 'pnpm test',
    },
    {
        placeholder: '{build_cmd}',
        knowledgePath: 'buildCommand',
        fallback: 'pnpm build',
    },
    {
        placeholder: '{package_manager}',
        knowledgePath: 'packageManager',
        fallback: 'npm',
    },
    {
        placeholder: '{language}',
        knowledgePath: 'language',
        fallback: 'typescript',
    },
    {
        placeholder: '{framework}',
        knowledgePath: 'framework',
        fallback: '',
    },
    {
        placeholder: '{test_runner}',
        knowledgePath: null,
        fallback: 'vitest',
        derive: (k) => {
            if (!k.testCommand) {
                return null;
            }
            // Extract the first word that isn't the package manager (e.g. 'pnpm vitest' → 'vitest')
            const parts = k.testCommand.trim().split(/\s+/);
            if (parts.length === 0) {
                return null;
            }
            const knownManagers = ['npm', 'pnpm', 'yarn', 'bun', 'npx'];
            const first = parts[0] ?? null;
            if (first === null) {
                return null;
            }
            // If first word is a package manager, return the second word (the runner)
            const second = parts[1] ?? null;
            if (knownManagers.includes(first) && second !== null) {
                return second;
            }
            return first;
        },
    },
];
//# sourceMappingURL=placeholder-map.js.map