/**
 * Task Planning Service
 *
 * Manages file-based planning files (plan.md, findings.md, progress.md)
 * for delegated tasks. These files give agents persistent context across
 * conversation turns and session restarts.
 *
 * Key patterns implemented:
 * - Auto-create planning files when tasks are assigned
 * - Inject plan context before each agent message (first 30 lines of plan + last 15 of progress)
 * - Append progress entries after file-modifying tool calls
 * - Detect incomplete phases for auto-continuation
 *
 * @module services/agent/task-planning.service
 */
/**
 * Information needed to create planning files for a task.
 */
export interface TaskPlanInfo {
    /** Task file path (e.g. .crewly/tasks/delegated/in_progress/task_xyz.md) */
    taskFilePath: string;
    /** Task title/description */
    taskTitle: string;
    /** Priority level */
    priority: string;
    /** Assigned agent session name */
    sessionName: string;
}
/**
 * Context injection payload for the AgentRunner.
 */
export interface PlanContext {
    /** Plan header (first N lines) */
    planHeader: string;
    /** Recent progress (last N lines) */
    recentProgress: string;
    /** Combined context string for injection */
    combined: string;
}
/**
 * Result of checking task phase completion.
 */
export interface PhaseStatus {
    /** Total number of phases found in plan.md */
    totalPhases: number;
    /** Number of phases marked as complete */
    completedPhases: number;
    /** Whether all phases are done */
    allComplete: boolean;
}
/**
 * Service for managing task planning files.
 *
 * Creates and manages plan.md, findings.md, and progress.md files
 * in a directory alongside each task file.
 */
export declare class TaskPlanningService {
    private static instance;
    /**
     * Get the singleton instance.
     *
     * @returns TaskPlanningService instance
     */
    static getInstance(): TaskPlanningService;
    /**
     * Reset the singleton (for testing).
     */
    static resetInstance(): void;
    /**
     * Create planning files for a newly assigned task.
     *
     * Creates a directory alongside the task file and generates:
     * - plan.md — phases with checkboxes, goal, decisions, errors
     * - findings.md — empty template for research discoveries
     * - progress.md — session log with creation timestamp
     *
     * @param info - Task information for template population
     * @returns Path to the planning directory
     */
    createPlanningFiles(info: TaskPlanInfo): Promise<string>;
    /**
     * Get plan context for injection before an agent message.
     *
     * Reads the first PLAN_CONTEXT_LINES lines of plan.md and the
     * last PROGRESS_TAIL_LINES lines of progress.md to give the agent
     * persistent context about the task state.
     *
     * @param taskFilePath - Path to the task .md file
     * @returns Plan context or null if no planning files exist
     */
    getPlanContext(taskFilePath: string): Promise<PlanContext | null>;
    /**
     * Append a progress entry after a file-modifying tool call.
     *
     * @param taskFilePath - Path to the task .md file
     * @param toolName - Name of the tool that was called
     * @param summary - Brief description of what was done
     */
    appendProgress(taskFilePath: string, toolName: string, summary: string): Promise<void>;
    /**
     * Append a finding to findings.md.
     *
     * @param taskFilePath - Path to the task .md file
     * @param finding - The finding text to record
     */
    appendFinding(taskFilePath: string, finding: string): Promise<void>;
    /**
     * Check how many phases are complete in the task plan.
     *
     * Counts phases (### Phase N) and their completion status.
     *
     * @param taskFilePath - Path to the task .md file
     * @returns Phase status or null if no plan exists
     */
    checkPhaseStatus(taskFilePath: string): Promise<PhaseStatus | null>;
    /**
     * Get the planning directory path for a task file.
     *
     * The planning directory sits alongside the task file,
     * using the task filename (without .md) as the directory name.
     *
     * @param taskFilePath - Full path to the task .md file
     * @returns Path to the planning directory
     */
    getPlanDir(taskFilePath: string): string;
    /**
     * Generate the plan.md template for a task.
     *
     * @param info - Task info for template population
     * @returns Plan markdown content
     */
    private generatePlanTemplate;
}
//# sourceMappingURL=task-planning.service.d.ts.map