export type TaskStatus = "pending" | "in_progress" | "completed";
export interface TeamTask {
    id: string;
    subject: string;
    description: string;
    owner?: string;
    status: TaskStatus;
    blocks: string[];
    blockedBy: string[];
    metadata?: Record<string, unknown>;
    createdAt: string;
    updatedAt: string;
}
export declare function getTaskListDir(teamDir: string, taskListId: string): string;
export declare function shortTaskId(id: string): string;
export declare function formatTaskLine(t: TeamTask, opts?: {
    blocked?: boolean;
}): string;
export declare function listTasks(teamDir: string, taskListId: string): Promise<TeamTask[]>;
export declare function getTask(teamDir: string, taskListId: string, taskId: string): Promise<TeamTask | null>;
export declare function createTask(teamDir: string, taskListId: string, input: {
    subject: string;
    description: string;
    owner?: string;
}): Promise<TeamTask>;
export declare function updateTask(teamDir: string, taskListId: string, taskId: string, updater: (current: TeamTask) => TeamTask): Promise<TeamTask | null>;
export declare function isTaskBlocked(teamDir: string, taskListId: string, task: TeamTask): Promise<boolean>;
export declare function agentHasActiveTask(teamDir: string, taskListId: string, agentName: string): Promise<boolean>;
/**
 * Claim a specific task (owner must be empty).
 * Returns the updated task if claim succeeded, otherwise null.
 */
export declare function claimTask(teamDir: string, taskListId: string, taskId: string, agentName: string, opts?: {
    checkAgentBusy?: boolean;
}): Promise<TeamTask | null>;
/**
 * Start an assigned task (owner matches), marking it in_progress.
 */
export declare function startAssignedTask(teamDir: string, taskListId: string, taskId: string, agentName: string): Promise<TeamTask | null>;
export declare function completeTask(teamDir: string, taskListId: string, taskId: string, agentName: string, result?: string): Promise<TeamTask | null>;
export declare function unassignTask(teamDir: string, taskListId: string, taskId: string, agentName: string, reason?: string, extraMetadata?: Record<string, unknown>): Promise<TeamTask | null>;
/** Reset all non-completed tasks owned by agent back to pending + unowned. */
export declare function unassignTasksForAgent(teamDir: string, taskListId: string, agentName: string, reason?: string): Promise<number>;
/**
 * Find and claim the first available task:
 * - pending
 * - unowned
 * - unblocked
 */
export declare function claimNextAvailableTask(teamDir: string, taskListId: string, agentName: string, opts?: {
    checkAgentBusy?: boolean;
}): Promise<TeamTask | null>;
export type TaskDependencyOpResult = {
    ok: true;
    task: TeamTask;
    dependency: TeamTask;
} | {
    ok: false;
    error: string;
};
/**
 * Add a dependency edge: taskId is blockedBy depId (and depId blocks taskId).
 */
export declare function addTaskDependency(teamDir: string, taskListId: string, taskId: string, depId: string): Promise<TaskDependencyOpResult>;
/**
 * Remove dependency edge: taskId no longer blockedBy depId (and depId no longer blocks taskId).
 */
export declare function removeTaskDependency(teamDir: string, taskListId: string, taskId: string, depId: string): Promise<TaskDependencyOpResult>;
export type TaskClearMode = "completed" | "all";
export interface ClearTasksResult {
    mode: TaskClearMode;
    taskListId: string;
    taskListDir: string;
    deletedTaskIds: string[];
    skippedTaskIds: string[];
    errors: Array<{
        file: string;
        error: string;
    }>;
}
/**
 * Delete task JSON files from the task list directory.
 *
 * Safety properties:
 * - Only deletes `*.json` files inside `<teamDir>/tasks/<taskListId>/`.
 * - Refuses to operate if the resolved task list directory is not within `teamDir`.
 */
export declare function clearTasks(teamDir: string, taskListId: string, mode?: TaskClearMode): Promise<ClearTasksResult>;
