/**
 * Local ADR-style decision records and project knowledge snapshots.
 * Fully offline; portable Markdown/JSON export.
 */
import type { Database } from "bun:sqlite";
export declare const DECISION_RECORD_SCHEMA = "todos.decision_record.v1";
export declare const KNOWLEDGE_SNAPSHOT_SCHEMA = "todos.knowledge_snapshot.v1";
export declare const DECISION_STATUSES: readonly ["proposed", "accepted", "deprecated", "superseded", "rejected"];
export type DecisionStatus = (typeof DECISION_STATUSES)[number];
export declare const KNOWLEDGE_SNAPSHOT_SOURCES: readonly ["manual", "auto", "import"];
export type KnowledgeSnapshotSource = (typeof KNOWLEDGE_SNAPSHOT_SOURCES)[number];
export interface DecisionAlternative {
    title: string;
    description?: string;
    rejected_reason?: string;
}
export interface DecisionRecord {
    schema_version: typeof DECISION_RECORD_SCHEMA;
    id: string;
    project_id: string | null;
    task_id: string | null;
    plan_id: string | null;
    agent_id: string | null;
    sequence_num: number;
    short_ref: string;
    title: string;
    status: DecisionStatus;
    context: string | null;
    decision: string;
    consequences: string | null;
    alternatives: DecisionAlternative[];
    tags: string[];
    supersedes_id: string | null;
    superseded_by_id: string | null;
    metadata: Record<string, unknown>;
    created_at: string;
    updated_at: string;
}
export interface CreateDecisionRecordInput {
    project_id?: string;
    task_id?: string;
    plan_id?: string;
    agent_id?: string;
    title: string;
    status?: DecisionStatus;
    context?: string;
    decision: string;
    consequences?: string;
    alternatives?: DecisionAlternative[];
    tags?: string[];
    supersedes_id?: string;
    metadata?: Record<string, unknown>;
}
export interface UpdateDecisionRecordInput {
    title?: string;
    context?: string;
    decision?: string;
    consequences?: string;
    alternatives?: DecisionAlternative[];
    tags?: string[];
    metadata?: Record<string, unknown>;
}
export interface ListDecisionRecordsFilter {
    project_id?: string;
    task_id?: string;
    plan_id?: string;
    status?: DecisionStatus;
    tag?: string;
    limit?: number;
    offset?: number;
}
export interface KnowledgeSnapshotDecisionSummary {
    id: string;
    short_ref: string;
    title: string;
    status: DecisionStatus;
    decision: string;
    tags: string[];
}
export interface KnowledgeSnapshotPayload {
    schema_version: typeof KNOWLEDGE_SNAPSHOT_SCHEMA;
    captured_at: string;
    project: {
        id: string;
        name: string;
        path: string;
        description: string | null;
    } | null;
    summary: string | null;
    decisions: KnowledgeSnapshotDecisionSummary[];
    active_plans: Array<{
        id: string;
        name: string;
        status: string;
    }>;
    topics: string[];
    conventions: string[];
    notes: string | null;
}
export interface KnowledgeSnapshotRecord {
    schema_version: typeof KNOWLEDGE_SNAPSHOT_SCHEMA;
    id: string;
    project_id: string | null;
    title: string;
    summary: string | null;
    content_hash: string;
    snapshot: KnowledgeSnapshotPayload;
    decision_ids: string[];
    topics: string[];
    source: KnowledgeSnapshotSource;
    created_at: string;
}
export interface CaptureKnowledgeSnapshotInput {
    project_id: string;
    title?: string;
    summary?: string;
    notes?: string;
    conventions?: string[];
    topics?: string[];
    source?: KnowledgeSnapshotSource;
    include_statuses?: DecisionStatus[];
}
export interface ListKnowledgeSnapshotsFilter {
    project_id?: string;
    limit?: number;
    offset?: number;
}
export declare function createDecisionRecord(input: CreateDecisionRecordInput, db?: Database): DecisionRecord;
export declare function getDecisionRecord(id: string, db?: Database): DecisionRecord | null;
export declare function getDecisionRecordByRef(shortRef: string, db?: Database): DecisionRecord | null;
export declare function listDecisionRecords(filter?: ListDecisionRecordsFilter, db?: Database): DecisionRecord[];
export declare function updateDecisionRecord(id: string, input: UpdateDecisionRecordInput, db?: Database): DecisionRecord;
export declare function setDecisionStatus(id: string, status: DecisionStatus, db?: Database): DecisionRecord;
export declare function supersedeDecisionRecord(id: string, input: Omit<CreateDecisionRecordInput, "supersedes_id">, db?: Database): {
    previous: DecisionRecord;
    replacement: DecisionRecord;
};
export declare function formatDecisionRecordMarkdown(record: DecisionRecord): string;
export declare function exportDecisionRecord(id: string, outputPath?: string, format?: "json" | "markdown", db?: Database): {
    path: string;
    content: string;
};
export declare function buildKnowledgeSnapshotPayload(input: CaptureKnowledgeSnapshotInput, db?: Database): KnowledgeSnapshotPayload;
export declare function captureKnowledgeSnapshot(input: CaptureKnowledgeSnapshotInput, db?: Database): KnowledgeSnapshotRecord;
export declare function getKnowledgeSnapshot(id: string, db?: Database): KnowledgeSnapshotRecord | null;
export declare function listKnowledgeSnapshots(filter?: ListKnowledgeSnapshotsFilter, db?: Database): KnowledgeSnapshotRecord[];
export declare function formatKnowledgeSnapshotMarkdown(record: KnowledgeSnapshotRecord): string;
export declare function exportKnowledgeSnapshot(id: string, outputPath?: string, format?: "json" | "markdown", db?: Database): {
    path: string;
    content: string;
};
export declare function getDecisionRecordsDocs(): string;
//# sourceMappingURL=decision-records.d.ts.map