// engine/hook-generator/stack-hook-templates.ts — Git hook templates per stack (SPEC-416)
// ---------------------------------------------------------------------------
// Marker helpers — used by hook-merger for idempotent injection
// ---------------------------------------------------------------------------
export function markerStart(id) {
    return `# <!-- planu:generated:${id} -->`;
}
export function markerEnd(id) {
    return `# <!-- /planu:generated:${id} -->`;
}
// ---------------------------------------------------------------------------
// Templates
// ---------------------------------------------------------------------------
export const STACK_HOOK_TEMPLATES = {
    typescript: [
        {
            id: 'typescript-typecheck',
            phase: 'pre-commit',
            stack: 'typescript',
            content: 'pnpm typecheck || exit 1',
            description: 'TypeScript type checking',
        },
    ],
    eslint: [
        {
            id: 'eslint-fix',
            phase: 'pre-commit',
            stack: 'eslint',
            content: 'pnpm lint --fix || exit 1',
            description: 'ESLint auto-fix',
        },
    ],
    prettier: [
        {
            id: 'prettier-format',
            phase: 'pre-commit',
            stack: 'prettier',
            content: 'pnpm format || exit 1',
            description: 'Prettier formatting',
        },
    ],
    vitest: [
        {
            id: 'vitest-coverage',
            phase: 'pre-push',
            stack: 'vitest',
            content: 'pnpm test:coverage || exit 1',
            description: 'Vitest coverage threshold check',
        },
    ],
    jest: [
        {
            id: 'jest-coverage',
            phase: 'pre-push',
            stack: 'jest',
            content: 'pnpm test --coverage || exit 1',
            description: 'Jest coverage check',
        },
    ],
    python: [
        {
            id: 'python-ruff',
            phase: 'pre-commit',
            stack: 'python',
            content: 'ruff check --fix . || exit 1',
            description: 'Python ruff linting',
        },
    ],
    go: [
        {
            id: 'go-vet',
            phase: 'pre-commit',
            stack: 'go',
            content: 'go vet ./... || exit 1',
            description: 'Go vet check',
        },
    ],
    commitlint: [
        {
            id: 'commitlint',
            phase: 'commit-msg',
            stack: 'commitlint',
            content: 'npx --no -- commitlint --edit "$1" || exit 1',
            description: 'Conventional commits validation',
        },
    ],
};
// ---------------------------------------------------------------------------
// Public helper
// ---------------------------------------------------------------------------
/**
 * Returns all HookSection entries matching the requested stack tokens.
 * Unknown tokens are silently skipped.
 */
export function getHookSectionsForStack(stack) {
    const sections = [];
    for (const token of stack) {
        const templates = STACK_HOOK_TEMPLATES[token];
        if (templates !== undefined) {
            sections.push(...templates);
        }
    }
    return sections;
}
//# sourceMappingURL=stack-hook-templates.js.map