import type { Database } from "bun:sqlite";
import type { TaskPriority, TaskStatus } from "../types/index.js";
import { type ReviewRoutingRuleConfig } from "./config.js";
import { type TaskReview } from "./task-contracts.js";
export type ReviewQueueState = "requested" | "claimed" | "approved" | "changes_requested" | "returned" | "reopened";
export interface ReviewQueueHistoryEntry {
    state: ReviewQueueState;
    actor: string;
    note: string | null;
    at: string;
}
export interface ReviewQueueMetadata {
    schema_version: 1;
    state: ReviewQueueState;
    queue: string;
    requester: string | null;
    reviewer: string | null;
    claimed_by: string | null;
    reason: string | null;
    notes: string | null;
    changes_requested: string[];
    routing_rule: string | null;
    requested_at: string | null;
    claimed_at: string | null;
    decided_at: string | null;
    updated_at: string;
    history: ReviewQueueHistoryEntry[];
}
export interface ReviewQueueItem {
    task_id: string;
    short_id: string | null;
    title: string;
    status: TaskStatus;
    priority: TaskPriority;
    project_id: string | null;
    assigned_to: string | null;
    tags: string[];
    queue: string;
    state: ReviewQueueState;
    requester: string | null;
    reviewer: string | null;
    claimed_by: string | null;
    reason: string | null;
    notes: string | null;
    changes_requested: string[];
    routing_rule: string | null;
    requested_at: string | null;
    claimed_at: string | null;
    decided_at: string | null;
    updated_at: string;
    review: TaskReview | null;
}
export interface ReviewQueueListOptions {
    queue?: string;
    state?: ReviewQueueState;
    reviewer?: string;
    requester?: string;
    project_id?: string;
    limit?: number;
}
export interface RequestReviewQueueInput {
    task_id: string;
    requester: string;
    reviewer?: string;
    queue?: string;
    reason?: string;
    notes?: string;
}
export interface ClaimReviewInput {
    task_id: string;
    reviewer: string;
    note?: string;
}
export interface DecideReviewInput {
    task_id: string;
    reviewer: string;
    note?: string;
    changes_requested?: string[];
}
export interface UpsertReviewRoutingRuleInput {
    name: string;
    queue?: string;
    reviewers?: string[];
    tags?: string[];
    priorities?: TaskPriority[];
    project_id?: string;
    enabled?: boolean;
}
export declare function listReviewRoutingRules(): ReviewRoutingRuleConfig[];
export declare function upsertReviewRoutingRule(input: UpsertReviewRoutingRuleInput): ReviewRoutingRuleConfig;
export declare function removeReviewRoutingRule(name: string): boolean;
export declare function requestReviewQueue(input: RequestReviewQueueInput, db?: Database): ReviewQueueItem;
export declare function claimReviewItem(input: ClaimReviewInput, db?: Database): ReviewQueueItem;
export declare function approveReviewItem(input: DecideReviewInput, db?: Database): ReviewQueueItem;
export declare function returnReviewItem(input: DecideReviewInput, db?: Database): ReviewQueueItem;
export declare function reopenReviewItem(input: DecideReviewInput, db?: Database): ReviewQueueItem;
export declare function listReviewQueue(options?: ReviewQueueListOptions, db?: Database): ReviewQueueItem[];
//# sourceMappingURL=review-queues.d.ts.map