export interface MemoryRecord {
    id: string;
    text: string;
    userId: string;
    category: string;
    importance: number;
    confidence: number;
    source: string;
    sessionId: string;
    eventDate: string;
    tags: string[];
    embedding: Float32Array | null;
    createdAt: number;
    updatedAt: number;
    accessCount: number;
    lastAccessedAt: number;
    isArchived: boolean;
}
export interface MemoryInsertInput {
    text: string;
    userId: string;
    category?: string;
    importance?: number;
    confidence?: number;
    source?: string;
    sessionId?: string;
    eventDate?: string;
    tags?: string[];
    embedding?: Float32Array;
}
export interface MemoryUpdateInput {
    text?: string;
    category?: string;
    importance?: number;
    source?: string;
    eventDate?: string;
    tags?: string[];
    embedding?: Float32Array | null;
}
export interface MemorySearchHit {
    id: string;
    text: string;
    score: number;
    category: string;
    importance: number;
    metadata: Record<string, unknown>;
}
export interface MemoryAtlasBucket {
    id: string;
    startAt: number;
    endAt: number;
    count: number;
    avgImportance: number;
    avgConfidence: number;
    topCategory: string;
}
export interface MemoryAtlasCluster {
    id: string;
    label: string;
    kind: "source" | "category" | "tag";
    count: number;
    startAt: number;
    endAt: number;
    avgImportance: number;
    avgConfidence: number;
    topCategory: string;
}
export interface MemoryAtlasWindowCursor {
    startAt: number;
    endAt: number;
    centerAt: number;
    pageSize: number;
    hasBefore: boolean;
    hasAfter: boolean;
}
export interface MemoryAtlasResult {
    totalCount: number;
    records: MemoryRecord[];
    buckets: MemoryAtlasBucket[];
    clusters: MemoryAtlasCluster[];
    windowCursor: MemoryAtlasWindowCursor | null;
    timeRange: {
        startAt: number;
        endAt: number;
    } | null;
}
export type MemorySourceKind = "manual" | "explicit" | "document" | "image" | "video" | "auto" | "turn" | "dream" | "agent";
export type MemoryClaimStatus = "active" | "superseded" | "conflicted" | "archived" | "pending_confirmation";
export type MemoryProposalStatus = "pending" | "accepted" | "merged" | "conflicted" | "rejected";
export interface MemoryObservationInput {
    userId: string;
    text: string;
    source: string;
    sourcePriority: number;
    sessionId?: string;
    evidenceType?: string;
    payload?: Record<string, unknown>;
}
export interface MemoryObservationRecord extends Required<Omit<MemoryObservationInput, "payload" | "sessionId" | "evidenceType">> {
    id: string;
    sessionId: string;
    evidenceType: string;
    payload: Record<string, unknown>;
    createdAt: number;
}
export interface MemoryProposalInput {
    userId: string;
    observationIds: string[];
    text: string;
    category: string;
    importance: number;
    confidence: number;
    source: string;
    sourcePriority: number;
    entity: string;
    predicate: string;
    value: Record<string, unknown>;
    validTime?: string;
    tags?: string[];
    status?: MemoryProposalStatus;
    relatedClaimIds?: string[];
}
export interface MemoryProposalRecord extends Omit<MemoryProposalInput, "value" | "validTime" | "tags" | "status" | "relatedClaimIds"> {
    id: string;
    value: Record<string, unknown>;
    validTime: string;
    tags: string[];
    status: MemoryProposalStatus;
    relatedClaimIds: string[];
    createdAt: number;
    updatedAt: number;
}
export interface MemoryClaimInput {
    userId: string;
    memoryId?: string;
    entity: string;
    predicate: string;
    value: Record<string, unknown>;
    text: string;
    category: string;
    importance: number;
    confidence: number;
    source: string;
    sourcePriority: number;
    status: MemoryClaimStatus;
    validTime?: string;
    evidenceIds: string[];
    supersedesClaimId?: string;
    conflictGroupId?: string;
}
export interface MemoryClaimRecord extends Omit<MemoryClaimInput, "memoryId" | "value" | "validTime" | "supersedesClaimId" | "conflictGroupId"> {
    id: string;
    memoryId: string;
    value: Record<string, unknown>;
    validTime: string;
    supersedesClaimId: string;
    conflictGroupId: string;
    createdAt: number;
    updatedAt: number;
}
export interface MemoryConflictRecord {
    id: string;
    userId: string;
    claimAId: string;
    claimBId: string;
    reason: string;
    status: "open" | "resolved" | "dismissed";
    createdAt: number;
    updatedAt: number;
}
export interface SqliteDatabase {
    exec(sql: string): void;
    prepare(sql: string): SqliteStatement;
    pragma(pragma: string): unknown;
    close(): void;
}
export interface SqliteStatement {
    run(...params: unknown[]): {
        changes: number;
        lastInsertRowid: number | bigint;
    };
    get(...params: unknown[]): unknown;
    all(...params: unknown[]): unknown[];
}
