import { DataSource, Repository } from '@n8n/typeorm';
import { AgentExecutionThread } from '../entities/agent-execution-thread.entity';
export interface AgentExecutionThreadMetadata {
    parentThreadId?: string;
    parentAgentId?: string;
}
export interface AgentExecutionThreadPage {
    threads: AgentExecutionThread[];
    nextCursor: string | null;
}
export declare class AgentExecutionThreadRepository extends Repository<AgentExecutionThread> {
    constructor(dataSource: DataSource);
    findOrCreate(threadId: string, agentId: string, agentName: string, projectId: string, metadata?: AgentExecutionThreadMetadata, taskId?: string | null, taskVersionId?: string | null): Promise<{
        thread: AgentExecutionThread;
        created: boolean;
    }>;
    private findOrCreateInSerializableTransaction;
    findByProjectIdPaginated(projectId: string, agentId: string, limit: number, cursor?: string): Promise<AgentExecutionThreadPage>;
    bumpUpdatedAt(threadId: string): Promise<void>;
    incrementUsage(threadId: string, promptTokens: number, completionTokens: number, cost: number, duration: number): Promise<void>;
    deleteByIdAndProjectId(threadId: string, projectId: string): Promise<boolean>;
}
