/**
 * Returns the content of the two bash scripts that integrate Planu with
 * Claude Code's Plan Mode hooks:
 *
 * - preScript: called by PreToolUse when tool name is "Task" (entering Plan Mode)
 * - postScript: called by PostToolUse when tool name is "exit_plan_mode"
 */
export function buildPlanModeHookScripts() {
    const preScript = buildPreScript();
    const postScript = buildPostScript();
    return { preScript, postScript };
}
function buildPreScript() {
    return [
        '#!/usr/bin/env bash',
        '# planu-pre-plan.sh — Auto-generated by Planu (SPEC-262)',
        '# Called by Claude Code PreToolUse hook when entering Plan Mode (Task tool).',
        '# Injects project context into .planu/plan-context.md',
        '',
        'PROJECT_PATH="${CLAUDE_PROJECT_DIR:-$(pwd)}"',
        '',
        'node -e "',
        "import('@planu/cli/dist/engine/hooks/context-injector.js')",
        '  .then(({ injectPlanContext }) =>',
        '    injectPlanContext(process.env.PROJECT_PATH || process.cwd(), process.env.CLAUDE_TOOL_INPUT || null)',
        '  )',
        '  .catch(() => {});',
        '" PROJECT_PATH="$PROJECT_PATH" 2>/dev/null || true',
        '',
    ].join('\n');
}
function buildPostScript() {
    return [
        '#!/usr/bin/env bash',
        '# planu-post-plan.sh — Auto-generated by Planu (SPEC-262)',
        '# Called by Claude Code PostToolUse hook when exiting Plan Mode.',
        '# Appends a suggestion to call `facilitate` with plan findings.',
        '',
        "echo '---'",
        "echo 'Planu: Plan Mode exited.'",
        "echo 'Tip: call `facilitate` with your findings to create a spec, or `create_spec` directly.'",
        '',
    ].join('\n');
}
//# sourceMappingURL=plan-mode-scripts.js.map