/**
 * Shared helpers for reading the on-disk state files written by
 * skills/long-task/scripts/detach-task.sh:
 *
 *   task-<id>.pid       — PID of the detached process
 *   task-<id>.cmd       — literal command line
 *   task-<id>.started   — ISO-8601 start timestamp
 *   task-<id>.log       — combined stdout + stderr
 *   task-<id>.status    — current state line
 *   task-<id>.archived  — tombstone written by the janitor when it sweeps
 *                         a finished task more than 7 days old
 *
 * Both the agent-facing tools (task_list / task_cancel) and the gateway's
 * tasks.list RPC consume this helper so the two views stay in sync.
 */
export declare const TASK_FILE_PREFIX = "task-";
export declare const TASK_ID_RE: RegExp;
export declare const TASK_FILE_SUFFIXES: readonly [".pid", ".status", ".started", ".cmd", ".log", ".archived"];
export type TaskInfo = {
    id: string;
    pid: number | null;
    alive: boolean;
    archived: boolean;
    status: string;
    started: string | null;
    cmd: string | null;
    pidPath: string;
    statusPath: string;
    archivedPath: string;
    logPath: string;
};
export declare function defaultIsPidAlive(pid: number): boolean;
export declare function readTaskInfo(workdir: string, id: string, isPidAlive?: (pid: number) => boolean): Promise<TaskInfo>;
export declare function listTasksInWorkdir(workdir: string, isPidAlive?: (pid: number) => boolean): Promise<TaskInfo[]>;
