import type { Database } from "bun:sqlite";
export interface CiSnapshot {
    status: string;
    provider?: string;
    run_url?: string;
    checks?: Record<string, string>;
    captured_at?: string;
    [key: string]: unknown;
}
export interface TaskCommit {
    id: string;
    task_id: string;
    sha: string;
    message: string | null;
    author: string | null;
    files_changed: string[] | null;
    committed_at: string | null;
    branch: string | null;
    pr_url: string | null;
    pr_number: number | null;
    pr_state: string | null;
    ci_snapshot: CiSnapshot | null;
    release_tag: string | null;
    repo_path: string | null;
    traceability: Record<string, unknown>;
    created_at: string;
}
export interface TaskGitRef {
    id: string;
    task_id: string;
    ref_type: "branch" | "pull_request";
    name: string;
    url: string | null;
    provider: string | null;
    metadata: Record<string, unknown>;
    created_at: string;
    updated_at: string;
}
export interface TaskVerification {
    id: string;
    task_id: string;
    command: string;
    status: "passed" | "failed" | "unknown";
    output_summary: string | null;
    artifact_path: string | null;
    agent_id: string | null;
    run_at: string;
    created_at: string;
}
export interface TaskTraceabilityReport {
    task_id: string;
    commits: TaskCommit[];
    git_refs: TaskGitRef[];
    verifications: TaskVerification[];
    branches: string[];
    release_tags: string[];
    pull_requests: Array<{
        url: string;
        state: string | null;
        number: number | null;
    }>;
}
export interface LinkTaskToCommitInput {
    task_id: string;
    sha: string;
    message?: string;
    author?: string;
    files_changed?: string[];
    committed_at?: string;
    branch?: string;
    pr_url?: string;
    pr_number?: number;
    pr_state?: string;
    ci_snapshot?: CiSnapshot;
    release_tag?: string;
    repo_path?: string;
    traceability?: Record<string, unknown>;
}
/** Link a git commit SHA to a task. Upserts on same task+sha. */
export declare function linkTaskToCommit(input: LinkTaskToCommitInput, db?: Database): TaskCommit;
/** Get all commits linked to a task. */
export declare function getTaskCommits(taskId: string, db?: Database): TaskCommit[];
/** Find which task a commit SHA is linked to. */
export declare function findTaskByCommit(sha: string, db?: Database): {
    task_id: string;
    commit: TaskCommit;
} | null;
/** Remove a commit link. */
export declare function unlinkTaskCommit(taskId: string, sha: string, db?: Database): boolean;
export interface LinkTaskGitRefInput {
    task_id: string;
    ref_type: "branch" | "pull_request";
    name: string;
    url?: string;
    provider?: string;
    metadata?: Record<string, unknown>;
}
/** Link a local branch or pull request URL/number to a task. Upserts on task+type+name. */
export declare function linkTaskGitRef(input: LinkTaskGitRefInput, db?: Database): TaskGitRef;
export declare function getTaskGitRefs(taskId: string, db?: Database): TaskGitRef[];
export declare function findTasksByGitRef(ref: string, db?: Database): TaskGitRef[];
export interface AddTaskVerificationInput {
    task_id: string;
    command: string;
    status?: "passed" | "failed" | "unknown";
    output_summary?: string;
    artifact_path?: string;
    agent_id?: string;
    run_at?: string;
}
export declare function addTaskVerification(input: AddTaskVerificationInput, db?: Database): TaskVerification;
export declare function getTaskVerifications(taskId: string, db?: Database): TaskVerification[];
export declare function getTaskTraceability(taskId: string, db?: Database): TaskTraceabilityReport;
//# sourceMappingURL=task-commits.d.ts.map