import type Database from 'better-sqlite3';
type SqliteDb = Database.Database;
type DbRow = Record<string, any>;
export declare function openDatabase(projectRoot: string, { dataDir }?: {
    dataDir?: string;
}): SqliteDb;
export declare function closeDatabase(): void;
export declare function listDeployments(db: SqliteDb, projectId: string): {
    id: any;
    projectId: any;
    fileName: any;
    providerId: any;
    url: any;
    deploymentId: any;
    deploymentCount: number;
    target: string;
    status: any;
    statusMessage: any;
    reachableAt: number | undefined;
    cloudflarePages: any;
    providerMetadata: any;
    createdAt: number;
    updatedAt: number;
}[];
export declare function getDeployment(db: SqliteDb, projectId: string, fileName: string, providerId: string): {
    id: any;
    projectId: any;
    fileName: any;
    providerId: any;
    url: any;
    deploymentId: any;
    deploymentCount: number;
    target: string;
    status: any;
    statusMessage: any;
    reachableAt: number | undefined;
    cloudflarePages: any;
    providerMetadata: any;
    createdAt: number;
    updatedAt: number;
} | null;
export declare function getDeploymentById(db: SqliteDb, projectId: string, id: string): {
    id: any;
    projectId: any;
    fileName: any;
    providerId: any;
    url: any;
    deploymentId: any;
    deploymentCount: number;
    target: string;
    status: any;
    statusMessage: any;
    reachableAt: number | undefined;
    cloudflarePages: any;
    providerMetadata: any;
    createdAt: number;
    updatedAt: number;
} | null;
export declare function upsertDeployment(db: SqliteDb, deployment: DbRow): {
    id: any;
    projectId: any;
    fileName: any;
    providerId: any;
    url: any;
    deploymentId: any;
    deploymentCount: number;
    target: string;
    status: any;
    statusMessage: any;
    reachableAt: number | undefined;
    cloudflarePages: any;
    providerMetadata: any;
    createdAt: number;
    updatedAt: number;
} | null;
export declare function listProjects(db: SqliteDb): {
    id: any;
    name: any;
    skillId: any;
    designSystemId: any;
    pendingPrompt: any;
    metadata: any;
    customInstructions: any;
    createdAt: number;
    updatedAt: number;
}[];
export declare function listLatestProjectRunStatuses(db: SqliteDb): Map<string, DbRow>;
export declare function listProjectsAwaitingInput(db: SqliteDb): Set<any>;
export declare function getProject(db: SqliteDb, id: string): {
    id: any;
    name: any;
    skillId: any;
    designSystemId: any;
    pendingPrompt: any;
    metadata: any;
    customInstructions: any;
    createdAt: number;
    updatedAt: number;
} | null;
export declare function insertProject(db: SqliteDb, p: DbRow): {
    id: any;
    name: any;
    skillId: any;
    designSystemId: any;
    pendingPrompt: any;
    metadata: any;
    customInstructions: any;
    createdAt: number;
    updatedAt: number;
} | null;
export declare function updateProject(db: SqliteDb, id: string, patch: DbRow): {
    id: any;
    name: any;
    skillId: any;
    designSystemId: any;
    pendingPrompt: any;
    metadata: any;
    customInstructions: any;
    createdAt: number;
    updatedAt: number;
} | null;
export declare function deleteProject(db: SqliteDb, id: string): void;
export declare function listTemplates(db: SqliteDb): {
    id: any;
    name: any;
    description: any;
    sourceProjectId: any;
    files: any;
    createdAt: number;
}[];
export declare function getTemplate(db: SqliteDb, id: string): {
    id: any;
    name: any;
    description: any;
    sourceProjectId: any;
    files: any;
    createdAt: number;
} | null;
export declare function findTemplateByNameAndProject(db: SqliteDb, name: string, sourceProjectId: string): {
    id: any;
    name: any;
    description: any;
    sourceProjectId: any;
    files: any;
    createdAt: number;
} | null;
export declare function insertTemplate(db: SqliteDb, t: DbRow): {
    id: any;
    name: any;
    description: any;
    sourceProjectId: any;
    files: any;
    createdAt: number;
} | null;
export declare function updateTemplate(db: SqliteDb, id: string, t: {
    description: string | null;
    files: unknown[];
}): {
    id: any;
    name: any;
    description: any;
    sourceProjectId: any;
    files: any;
    createdAt: number;
} | null;
export declare function deleteTemplate(db: SqliteDb, id: string): void;
export declare function listConversations(db: SqliteDb, projectId: string): {
    id: any;
    projectId: any;
    title: any;
    createdAt: number;
    updatedAt: number;
    latestRun: {
        durationMs?: number;
        endedAt?: number | undefined;
        startedAt?: number | undefined;
        status: string;
    } | undefined;
}[];
export declare function getConversation(db: SqliteDb, id: string): {
    latestRun: {
        durationMs?: number;
        endedAt?: number | undefined;
        startedAt?: number | undefined;
        status: string;
    } | undefined;
    id: any;
    projectId: any;
    title: any;
    createdAt: number;
    updatedAt: number;
} | null;
export declare function insertConversation(db: SqliteDb, c: DbRow): {
    latestRun: {
        durationMs?: number;
        endedAt?: number | undefined;
        startedAt?: number | undefined;
        status: string;
    } | undefined;
    id: any;
    projectId: any;
    title: any;
    createdAt: number;
    updatedAt: number;
} | null;
export declare function updateConversation(db: SqliteDb, id: string, patch: DbRow): {
    latestRun: {
        durationMs?: number;
        endedAt?: number | undefined;
        startedAt?: number | undefined;
        status: string;
    } | undefined;
    id: any;
    projectId: any;
    title: any;
    createdAt: number;
    updatedAt: number;
} | null;
export declare function deleteConversation(db: SqliteDb, id: string): void;
export declare function listMessages(db: SqliteDb, conversationId: string): {
    id: any;
    role: any;
    content: any;
    agentId: any;
    agentName: any;
    runId: any;
    runStatus: any;
    lastRunEventId: any;
    events: any;
    attachments: any;
    commentAttachments: any;
    producedFiles: any;
    feedback: any;
    createdAt: any;
    startedAt: any;
    endedAt: any;
}[];
export declare function upsertMessage(db: SqliteDb, conversationId: string, m: DbRow): {
    id: any;
    role: any;
    content: any;
    agentId: any;
    agentName: any;
    runId: any;
    runStatus: any;
    lastRunEventId: any;
    events: any;
    attachments: any;
    commentAttachments: any;
    producedFiles: any;
    feedback: any;
    createdAt: any;
    startedAt: any;
    endedAt: any;
} | null;
export declare function deleteMessage(db: SqliteDb, id: string): void;
export declare function listPreviewComments(db: SqliteDb, projectId: string, conversationId: string): {
    id: any;
    projectId: any;
    conversationId: any;
    filePath: any;
    elementId: any;
    selector: any;
    label: any;
    text: any;
    position: any;
    htmlHint: any;
    selectionKind: string;
    memberCount: any;
    podMembers: any[] | undefined;
    note: any;
    status: any;
    createdAt: any;
    updatedAt: any;
}[];
export declare function upsertPreviewComment(db: SqliteDb, projectId: string, conversationId: string, input: DbRow): {
    id: any;
    projectId: any;
    conversationId: any;
    filePath: any;
    elementId: any;
    selector: any;
    label: any;
    text: any;
    position: any;
    htmlHint: any;
    selectionKind: string;
    memberCount: any;
    podMembers: any[] | undefined;
    note: any;
    status: any;
    createdAt: any;
    updatedAt: any;
} | null;
export declare function updatePreviewCommentStatus(db: SqliteDb, projectId: string, conversationId: string, id: string, status: string): {
    id: any;
    projectId: any;
    conversationId: any;
    filePath: any;
    elementId: any;
    selector: any;
    label: any;
    text: any;
    position: any;
    htmlHint: any;
    selectionKind: string;
    memberCount: any;
    podMembers: any[] | undefined;
    note: any;
    status: any;
    createdAt: any;
    updatedAt: any;
} | null;
export declare function deletePreviewComment(db: SqliteDb, projectId: string, conversationId: string, id: string): boolean;
export declare function listRoutines(db: SqliteDb): {
    id: any;
    name: any;
    prompt: any;
    scheduleKind: any;
    scheduleValue: any;
    scheduleJson: any;
    projectMode: any;
    projectId: any;
    skillId: any;
    agentId: any;
    enabled: boolean;
    createdAt: number;
    updatedAt: number;
}[];
export declare function getRoutine(db: SqliteDb, id: string): {
    id: any;
    name: any;
    prompt: any;
    scheduleKind: any;
    scheduleValue: any;
    scheduleJson: any;
    projectMode: any;
    projectId: any;
    skillId: any;
    agentId: any;
    enabled: boolean;
    createdAt: number;
    updatedAt: number;
} | null;
export declare function insertRoutine(db: SqliteDb, r: DbRow): {
    id: any;
    name: any;
    prompt: any;
    scheduleKind: any;
    scheduleValue: any;
    scheduleJson: any;
    projectMode: any;
    projectId: any;
    skillId: any;
    agentId: any;
    enabled: boolean;
    createdAt: number;
    updatedAt: number;
} | null;
export declare function updateRoutine(db: SqliteDb, id: string, patch: DbRow): {
    id: any;
    name: any;
    prompt: any;
    scheduleKind: any;
    scheduleValue: any;
    scheduleJson: any;
    projectMode: any;
    projectId: any;
    skillId: any;
    agentId: any;
    enabled: boolean;
    createdAt: number;
    updatedAt: number;
} | null;
export declare function deleteRoutine(db: SqliteDb, id: string): boolean;
export declare function listRoutineRuns(db: SqliteDb, routineId: string, limit?: number): {
    id: any;
    routineId: any;
    trigger: any;
    status: any;
    projectId: any;
    conversationId: any;
    agentRunId: any;
    startedAt: number;
    completedAt: number | null;
    summary: any;
    error: any;
}[];
export declare function getLatestRoutineRun(db: SqliteDb, routineId: string): {
    id: any;
    routineId: any;
    trigger: any;
    status: any;
    projectId: any;
    conversationId: any;
    agentRunId: any;
    startedAt: number;
    completedAt: number | null;
    summary: any;
    error: any;
} | null;
export declare function getRoutineRun(db: SqliteDb, id: string): {
    id: any;
    routineId: any;
    trigger: any;
    status: any;
    projectId: any;
    conversationId: any;
    agentRunId: any;
    startedAt: number;
    completedAt: number | null;
    summary: any;
    error: any;
} | null;
export declare function insertRoutineRun(db: SqliteDb, r: DbRow): {
    id: any;
    routineId: any;
    trigger: any;
    status: any;
    projectId: any;
    conversationId: any;
    agentRunId: any;
    startedAt: number;
    completedAt: number | null;
    summary: any;
    error: any;
} | null;
export declare function updateRoutineRun(db: SqliteDb, id: string, patch: DbRow): {
    id: any;
    routineId: any;
    trigger: any;
    status: any;
    projectId: any;
    conversationId: any;
    agentRunId: any;
    startedAt: number;
    completedAt: number | null;
    summary: any;
    error: any;
} | null;
export declare function listTabs(db: SqliteDb, projectId: string): {
    tabs: any[];
    active: any;
};
export declare function setTabs(db: SqliteDb, projectId: string, names: string[], activeName: string | null): {
    tabs: any[];
    active: any;
};
export {};
