import { Logger } from '@n8n/backend-common'; import { AgentExecutionThread } from './entities/agent-execution-thread.entity'; import { AgentExecution } from './entities/agent-execution.entity'; import type { MessageRecord } from './execution-recorder'; import { N8nMemory } from './integrations/n8n-memory'; import { AgentExecutionThreadRepository } from './repositories/agent-execution-thread.repository'; import type { AgentExecutionThreadMetadata } from './repositories/agent-execution-thread.repository'; import { AgentExecutionRepository } from './repositories/agent-execution.repository'; export interface RecordMessageParams { threadId: string; agentId: string; agentName: string; projectId: string; userMessage: string; record: MessageRecord; hitlStatus?: 'suspended' | 'resumed'; source?: string; threadMetadata?: AgentExecutionThreadMetadata; taskId?: string; taskVersionId?: string; } export interface ThreadDetail { thread: AgentExecutionThread; executions: AgentExecution[]; } export interface ThreadListItem extends AgentExecutionThread { firstMessage: string | null; } export declare class AgentExecutionService { private readonly logger; private readonly agentExecutionRepository; private readonly agentExecutionThreadRepository; private readonly n8nMemory; constructor(logger: Logger, agentExecutionRepository: AgentExecutionRepository, agentExecutionThreadRepository: AgentExecutionThreadRepository, n8nMemory: N8nMemory); recordMessage(params: RecordMessageParams): Promise; private backfillSuspendedExecutions; private syncTitleFromMemory; deleteThread(projectId: string, threadId: string): Promise; getThreads(projectId: string, limit: number, cursor?: string, agentId?: string): Promise<{ threads: ThreadListItem[]; nextCursor: string | null; }>; getThreadDetail(threadId: string, projectId: string, agentId?: string): Promise; findThreadById(threadId: string): Promise; } export declare function threadBelongsTo(thread: AgentExecutionThread, projectId: string, agentId?: string): boolean;