import type { PlanProgress, WorkState } from "./types"; /** * Read work state from .weave/state.json. * Returns null if file is missing, unparseable, or invalid. */ export declare function readWorkState(directory: string): WorkState | null; /** * Write work state to .weave/state.json. * Creates .weave/ directory if needed. */ export declare function writeWorkState(directory: string, state: WorkState): boolean; /** * Clear work state by deleting .weave/state.json. */ export declare function clearWorkState(directory: string): boolean; /** * Append a session ID to the work state (if not already present). * Returns the updated state, or null if no state exists. */ export declare function appendSessionId(directory: string, sessionId: string): WorkState | null; /** * Create a fresh WorkState for a plan file. */ export declare function createWorkState(planPath: string, sessionId: string, agent?: string, directory?: string): WorkState; /** * Get the current HEAD SHA of the git repo at the given directory. * Returns undefined if not a git repo or git is unavailable. */ export declare function getHeadSha(directory: string): string | undefined; /** * Find all plan files in .weave/plans/, sorted by modification time (newest first). * Returns absolute paths. */ export declare function findPlans(directory: string): string[]; /** * Count checked and unchecked markdown checkboxes in a plan file. * Returns isComplete: true if file is missing, has 0 checkboxes, or all are checked. */ export declare function getPlanProgress(planPath: string): PlanProgress; /** * Extract plan name from file path (basename minus .md extension). */ export declare function getPlanName(planPath: string): string; /** * Pause work by setting paused: true in the work state. * Returns false if no state exists (e.g., no active plan). */ export declare function pauseWork(directory: string): boolean; /** * Resume work by setting paused: false in the work state. * Returns false if no state exists. */ export declare function resumeWork(directory: string): boolean;