import type { Database } from "bun:sqlite";
export type ProjectRiskStatus = "open" | "mitigating" | "resolved" | "accepted";
export type ProjectRiskSeverity = "low" | "medium" | "high" | "critical";
export type ProjectRiskProbability = "low" | "medium" | "high";
export type ProjectHealthStatus = "healthy" | "watch" | "at_risk" | "critical";
export type RiskExportFormat = "json" | "markdown";
export interface ProjectRiskRecord {
    id: string;
    title: string;
    description: string | null;
    status: ProjectRiskStatus;
    severity: ProjectRiskSeverity;
    probability: ProjectRiskProbability;
    owner: string | null;
    mitigation: string | null;
    due_at: string | null;
    project_id: string | null;
    plan_id: string | null;
    task_id: string | null;
    tags: string[];
    metadata: Record<string, unknown>;
    created_at: string;
    updated_at: string;
    closed_at: string | null;
}
export interface CreateRiskInput {
    title: string;
    description?: string;
    status?: ProjectRiskStatus;
    severity?: ProjectRiskSeverity;
    probability?: ProjectRiskProbability;
    owner?: string;
    mitigation?: string;
    due_at?: string;
    project_id?: string;
    plan_id?: string;
    task_id?: string;
    tags?: string[];
    metadata?: Record<string, unknown>;
}
export interface UpdateRiskInput {
    title?: string;
    description?: string | null;
    status?: ProjectRiskStatus;
    severity?: ProjectRiskSeverity;
    probability?: ProjectRiskProbability;
    owner?: string | null;
    mitigation?: string | null;
    due_at?: string | null;
    project_id?: string | null;
    plan_id?: string | null;
    task_id?: string | null;
    tags?: string[];
    metadata?: Record<string, unknown>;
}
export interface ListRisksOptions {
    status?: ProjectRiskStatus;
    severity?: ProjectRiskSeverity;
    probability?: ProjectRiskProbability;
    owner?: string;
    project_id?: string;
    plan_id?: string;
    task_id?: string;
    tag?: string;
    include_closed?: boolean;
    limit?: number;
}
export interface ProjectHealthReport {
    schema_version: 1;
    local_only: true;
    no_network: true;
    generated_at: string;
    scope: "plan" | "project";
    scope_id: string;
    score: number;
    status: ProjectHealthStatus;
    components: {
        total_tasks: number;
        blocked_tasks: number;
        overdue_tasks: number;
        failed_checks: number;
        failed_runs: number;
        dependency_depth: number;
        open_risks: number;
        critical_risks: number;
        overdue_risks: number;
    };
    penalties: Record<string, number>;
    blocked: Array<{
        id: string;
        short_id: string | null;
        title: string;
        blockers: Array<{
            id: string;
            short_id: string | null;
            title: string;
            status: string;
        }>;
    }>;
    overdue: Array<{
        id: string;
        short_id: string | null;
        title: string;
        due_at: string;
    }>;
    failed_checks: Array<{
        id: string;
        task_id: string;
        command: string;
        run_at: string;
    }>;
    failed_runs: Array<{
        id: string;
        task_id: string;
        title: string | null;
        completed_at: string | null;
    }>;
    risks: ProjectRiskRecord[];
    recommendations: string[];
}
export interface RiskRegisterExport {
    schema_version: 1;
    local_only: true;
    no_network: true;
    generated_at: string;
    filters: Omit<ListRisksOptions, "limit">;
    count: number;
    risks: ProjectRiskRecord[];
}
export declare function createRisk(input: CreateRiskInput, db?: Database): ProjectRiskRecord;
export declare function getRisk(id: string, db?: Database): ProjectRiskRecord | null;
export declare function updateRisk(id: string, input: UpdateRiskInput, db?: Database): ProjectRiskRecord;
export declare function closeRisk(id: string, status?: "resolved" | "accepted", db?: Database): ProjectRiskRecord;
export declare function listRisks(options?: ListRisksOptions, db?: Database): ProjectRiskRecord[];
export declare function scorePlanHealth(planId: string, db?: Database): ProjectHealthReport;
export declare function scoreProjectHealth(projectId: string, db?: Database): ProjectHealthReport;
export declare function createRiskRegisterExport(options?: ListRisksOptions, db?: Database): RiskRegisterExport;
export declare function renderRiskRegisterMarkdown(report: RiskRegisterExport): string;
//# sourceMappingURL=project-risks.d.ts.map