import type { Logger } from '@polka-codes/core';
import type { CliWorkflowContext, Plan, Task } from './types';
/**
 * Working Space Manager
 *
 * Manages a user-specified working directory for:
 * - Storing and loading plans as markdown files
 * - Discovering pending/incomplete tasks
 * - Documenting completed tasks
 *
 * Directory Structure:
 * working-dir/
 *   plans/
 *     plan-1.md
 *     plan-2.md
 *   tasks/
 *     pending/
 *       task-1.md
 *       task-2.md
 *     completed/
 *       task-3.md
 *   logs/
 *     task-1.log
 */
export declare class WorkingSpace {
    #private;
    constructor(workingDir: string, logger: Logger);
    /**
     * Initialize working directory structure
     */
    initialize(): Promise<void>;
    /**
     * Save a plan to a markdown file
     */
    savePlan(plan: Plan): Promise<void>;
    /**
     * Load all plans from the working directory
     */
    loadPlans(): Promise<Plan[]>;
    /**
     * Discover pending tasks from the working directory
     */
    discoverPendingTasks(): Promise<Task[]>;
    /**
     * Document a completed task
     */
    documentCompletedTask(task: Task, result: string): Promise<void>;
    /**
     * Create a pending task file
     */
    createPendingTask(task: Task): Promise<void>;
    /**
     * Convert plan to markdown format
     */
    private planToMarkdown;
    /**
     * Convert task to markdown format
     */
    private taskToMarkdown;
    /**
     * Parse markdown to plan (simplified version)
     */
    private markdownToPlan;
    /**
     * Parse markdown to task (simplified version)
     */
    private markdownToTask;
    /**
     * Sanitize filename for safe filesystem usage
     */
    private sanitizeFilename;
    /**
     * Get working directory path
     */
    getWorkingDir(): string;
    /**
     * Check if working directory exists
     */
    exists(): Promise<boolean>;
    /**
     * Clean up old completed tasks (keep last N)
     */
    cleanupOldCompletedTasks(keepCount?: number): Promise<void>;
    /**
     * Get statistics about the working space
     */
    getStats(): Promise<{
        planCount: number;
        pendingTaskCount: number;
        completedTaskCount: number;
        totalSize: number;
    }>;
}
/**
 * Create a working space manager and initialize it
 */
export declare function createWorkingSpace(workingDir: string, logger: Logger, _context: CliWorkflowContext): Promise<WorkingSpace>;
//# sourceMappingURL=working-space.d.ts.map