import type { RunStore } from "../run-state/store.js";
export type SeedBackgroundStatus = "running" | "completed" | "failed" | "cancelled";
export type SeedBackgroundNotificationStatus = "pending" | "delivered" | "dismissed";
export type SeedBackgroundNotification = {
    notification_id: string;
    run_id: string;
    background_id: string;
    parent_session_id?: string;
    session_id?: string;
    agent_call_id?: string;
    target_agent?: string;
    task_id?: string;
    background_status: Exclude<SeedBackgroundStatus, "running">;
    status: SeedBackgroundNotificationStatus;
    severity: "info" | "warning" | "error";
    title: string;
    body: string;
    next_action: "review_output" | "retry_or_handoff";
    created_at: string;
    updated_at: string;
    delivered_at?: string;
    dismissed_at?: string;
};
export type SeedBackgroundTask = {
    background_id: string;
    run_id: string;
    kind: "process" | "opencode_session";
    status: SeedBackgroundStatus;
    cwd: string;
    command?: string[];
    parent_session_id?: string;
    session_id?: string;
    agent_call_id?: string;
    owner_thread_id?: string;
    helper_id?: string;
    target_agent?: string;
    task_id?: string;
    title?: string;
    started_at: string;
    updated_at: string;
    last_heartbeat_at?: string;
    stale_after_minutes?: number;
    stale_at?: string;
    stale_reason?: string;
    completed_at?: string;
    exit_code?: number;
    output_tail: string[];
    checkpoint_count: number;
    last_checkpoint_at?: string;
    last_message?: string;
    last_tool?: string;
    error?: string;
    notified_at?: string;
};
export declare function backgroundTasksPath(store: RunStore, runId: string): string;
export declare function backgroundNotificationsPath(store: RunStore, runId: string): string;
export declare function listBackgroundTasks(store: RunStore, runId: string): Promise<SeedBackgroundTask[]>;
export declare function listBackgroundNotifications(store: RunStore, runId: string, options?: {
    status?: SeedBackgroundNotificationStatus;
    parentSessionId?: string;
}): Promise<SeedBackgroundNotification[]>;
export declare function getBackgroundTask(store: RunStore, runId: string, backgroundId: string): Promise<SeedBackgroundTask | undefined>;
export declare function upsertBackgroundTask(store: RunStore, runId: string, input: Omit<SeedBackgroundTask, "run_id" | "updated_at" | "checkpoint_count" | "output_tail"> & {
    updated_at?: string;
    checkpoint_count?: number;
    output_tail?: string[];
}): Promise<SeedBackgroundTask>;
export declare function updateBackgroundTask(store: RunStore, runId: string, backgroundId: string, patch: Partial<Omit<SeedBackgroundTask, "background_id" | "run_id" | "checkpoint_count">> & {
    checkpoint_delta?: number;
}): Promise<SeedBackgroundTask | undefined>;
export declare function markStaleBackgroundTasks(store: RunStore, runId: string, input?: {
    now?: string;
    staleAfterMinutes?: number;
    reason?: string;
}): Promise<SeedBackgroundTask[]>;
export declare function markBackgroundTaskNotified(store: RunStore, runId: string, backgroundId: string): Promise<SeedBackgroundTask | undefined>;
export declare function upsertBackgroundTerminalNotification(store: RunStore, runId: string, task: SeedBackgroundTask): Promise<SeedBackgroundNotification | undefined>;
export declare function markBackgroundNotificationDelivered(store: RunStore, runId: string, notificationId: string): Promise<SeedBackgroundNotification | undefined>;
export declare function markBackgroundNotificationsDeliveredForBackgrounds(store: RunStore, runId: string, backgroundIds: string[]): Promise<SeedBackgroundNotification[]>;
