import { type AgentBackgroundJobsResponse, type AgentSessionFilesResponse, AgentChatMessageDto, AgentChatCancelDto, AgentTaskCancellationDto, type AgentTaskCancellationState, AgentChatQueueUpdateDto, AgentChatQueueSteerDto, AgentChatQueueReorderDto, type AgentChatMessagesResponse, type AgentChatQueueResponse, AgentChatResumeDto } from '@n8n/api-types'; import { AgentsConfig } from '@n8n/config'; import type { AuthenticatedRequest } from '@n8n/db'; import type { Response } from 'express'; import { AgentPlanService } from './agent-plan.service'; import { AgentTaskCancellationService } from './agent-task-cancellation.service'; import { CredentialsService } from '../../credentials/credentials.service'; import { AgentChatAttachmentService } from './agent-chat-attachment.service'; import { AgentChatRelayService } from './agent-chat-relay.service'; import { AgentExecutionOrchestratorService } from './agent-execution-orchestrator.service'; import { AgentMessageQueueService } from './agent-message-queue.service'; import { AgentChatExecutionService } from './agent-chat-execution.service'; import { AgentExecutionService } from './agent-execution.service'; import type { FlushableResponse } from './agent-sse-stream'; import { AgentTestChatService } from './agent-test-chat.service'; import { AgentTestRunService } from './agent-test-run.service'; import { AgentsService } from './agents.service'; import { AgentBackgroundJobService } from './background/agent-background-job.service'; import { N8NCheckpointStorage } from './integrations/n8n-checkpoint-storage'; export declare class AgentChatController { private readonly taskCancellation; private readonly agentExecutionOrchestratorService; private readonly agentTestRunService; private readonly agentTestChatService; private readonly checkpointStorage; private readonly credentialsService; private readonly agentsService; private readonly agentChatAttachmentService; private readonly agentExecutionService; private readonly backgroundJobService; private readonly chatExecutionService; private readonly messageQueue; private readonly agentsConfig; private readonly chatRelay; private readonly plans; constructor(taskCancellation: AgentTaskCancellationService, agentExecutionOrchestratorService: AgentExecutionOrchestratorService, agentTestRunService: AgentTestRunService, agentTestChatService: AgentTestChatService, checkpointStorage: N8NCheckpointStorage, credentialsService: CredentialsService, agentsService: AgentsService, agentChatAttachmentService: AgentChatAttachmentService, agentExecutionService: AgentExecutionService, backgroundJobService: AgentBackgroundJobService, chatExecutionService: AgentChatExecutionService, messageQueue: AgentMessageQueueService, agentsConfig: AgentsConfig, chatRelay: AgentChatRelayService, plans: AgentPlanService); private requireProductionChat; private requireProductionThread; private requirePreviewThread; private findReadableCheckpoint; private assertQueueId; productionChat(req: AuthenticatedRequest<{ projectId: string; }>, res: FlushableResponse, agentId: string, payload: AgentChatMessageDto): Promise; productionChatResume(req: AuthenticatedRequest<{ projectId: string; }>, res: FlushableResponse, agentId: string, payload: AgentChatResumeDto): Promise; chat(req: AuthenticatedRequest<{ projectId: string; }>, res: FlushableResponse, agentId: string, payload: AgentChatMessageDto): Promise; chatResume(req: AuthenticatedRequest<{ projectId: string; }>, res: FlushableResponse, agentId: string, payload: AgentChatResumeDto): Promise; cancelChatExecution(req: AuthenticatedRequest<{ projectId: string; }>, _res: Response, agentId: string, threadId: string, executionId: string, payload?: AgentChatCancelDto): Promise<{ cancelRequested: boolean; }>; cancelChatRun(req: AuthenticatedRequest<{ projectId: string; }>, _res: Response, agentId: string, runId: string, payload?: AgentChatCancelDto): Promise<{ cancelled: boolean; }>; cancelProductionChatExecution(req: AuthenticatedRequest<{ projectId: string; }>, _res: Response, agentId: string, threadId: string, executionId: string, payload?: AgentChatCancelDto): Promise<{ cancelRequested: boolean; }>; cancelProductionChatRun(req: AuthenticatedRequest<{ projectId: string; }>, _res: Response, agentId: string, runId: string, payload?: AgentChatCancelDto): Promise<{ cancelled: boolean; }>; getProductionChatMessages(req: AuthenticatedRequest<{ projectId: string; agentId: string; threadId: string; }>): Promise; getProductionChatAttachment(req: AuthenticatedRequest<{ projectId: string; agentId: string; attachmentId: string; }>, res: Response): Promise; getProductionSessionFiles(req: AuthenticatedRequest<{ projectId: string; agentId: string; threadId: string; }>): Promise; getProductionQueuedMessages(req: AuthenticatedRequest<{ projectId: string; agentId: string; threadId: string; }>): Promise; updateProductionQueuedMessage(req: AuthenticatedRequest<{ projectId: string; agentId: string; threadId: string; queueId: string; }>, _res: Response, payload: AgentChatQueueUpdateDto): Promise; reorderProductionQueuedMessage(req: AuthenticatedRequest<{ projectId: string; agentId: string; threadId: string; queueId: string; }>, _res: Response, payload: AgentChatQueueReorderDto): Promise; steerProductionQueuedMessage(req: AuthenticatedRequest<{ projectId: string; agentId: string; threadId: string; queueId: string; }>, _res: Response, payload: AgentChatQueueSteerDto): Promise; removeProductionQueuedMessage(req: AuthenticatedRequest<{ projectId: string; agentId: string; threadId: string; queueId: string; }>): Promise<{ removed: boolean; }>; getProductionBackgroundJobs(req: AuthenticatedRequest<{ projectId: string; agentId: string; threadId: string; }>): Promise; stopProductionBackgroundJobs(req: AuthenticatedRequest<{ projectId: string; agentId: string; threadId: string; }>): Promise; resumeProductionBackgroundJob(req: AuthenticatedRequest<{ projectId: string; agentId: string; threadId: string; }>, _res: Response, payload: AgentChatResumeDto): Promise<{ resumed: true; }>; deleteProductionChatThread(req: AuthenticatedRequest<{ projectId: string; }>, _res: Response, agentId: string, threadId: string): Promise<{ success: boolean; }>; getQueuedMessages(req: AuthenticatedRequest<{ projectId: string; agentId: string; threadId: string; }>): Promise; updateQueuedMessage(req: AuthenticatedRequest<{ projectId: string; agentId: string; threadId: string; queueId: string; }>, _res: Response, payload: AgentChatQueueUpdateDto): Promise; reorderQueuedMessage(req: AuthenticatedRequest<{ projectId: string; agentId: string; threadId: string; queueId: string; }>, _res: Response, payload: AgentChatQueueReorderDto): Promise; removeQueuedMessage(req: AuthenticatedRequest<{ projectId: string; agentId: string; threadId: string; queueId: string; }>): Promise<{ removed: boolean; }>; steerQueuedMessage(req: AuthenticatedRequest<{ projectId: string; agentId: string; threadId: string; queueId: string; }>, _res: Response, payload: AgentChatQueueSteerDto): Promise; getBackgroundJobs(req: AuthenticatedRequest<{ projectId: string; agentId: string; threadId: string; }>): Promise; private mapBackgroundJobsToDto; private requireTaskThread; cancelTasks(req: AuthenticatedRequest<{ projectId: string; agentId: string; threadId: string; }>, _res: Response, payload: AgentTaskCancellationDto): Promise; streamTaskCancellation(req: AuthenticatedRequest<{ projectId: string; agentId: string; threadId: string; }>, res: FlushableResponse, payload: AgentTaskCancellationDto): Promise; private requireProductionTaskThread; cancelProductionTasks(req: AuthenticatedRequest<{ projectId: string; agentId: string; threadId: string; }>, _res: Response, payload: AgentTaskCancellationDto): Promise; streamProductionTaskCancellation(req: AuthenticatedRequest<{ projectId: string; agentId: string; threadId: string; }>, res: FlushableResponse, payload: AgentTaskCancellationDto): Promise; getProductionTaskCancellation(req: AuthenticatedRequest<{ projectId: string; agentId: string; threadId: string; }>): Promise; getProductionPlan(req: AuthenticatedRequest<{ projectId: string; agentId: string; threadId: string; }>): Promise<{ planId: string; lastActivityAt: string | null; revision: number; closed: boolean; startedAt: string; finishedAt: string | null; closedAt: string | null; document: { title: string; description: string; presentation?: { label: string; detail?: string | undefined; } | undefined; items: ({ id: string; title: string; description: string; status: "cancelled" | "done" | "failed" | "in_progress" | "paused" | "pending"; dependsOn: string[]; resultSummary?: string | undefined; kind: "task"; fallbackFor?: string | undefined; jobId?: string | undefined; } | { id: string; title: string; description: string; status: "cancelled" | "done" | "failed" | "in_progress" | "paused" | "pending"; dependsOn: string[]; resultSummary?: string | undefined; kind: "group"; tasks: { id: string; title: string; description: string; status: "cancelled" | "done" | "failed" | "in_progress" | "paused" | "pending"; dependsOn: string[]; resultSummary?: string | undefined; kind: "task"; fallbackFor?: string | undefined; jobId?: string | undefined; }[]; })[]; }; readiness: import("./plans/agent-plan.validation").AgentPlanReadiness; } | null>; getPlan(req: AuthenticatedRequest<{ projectId: string; agentId: string; threadId: string; }>): Promise<{ planId: string; lastActivityAt: string | null; revision: number; closed: boolean; startedAt: string; finishedAt: string | null; closedAt: string | null; document: { title: string; description: string; presentation?: { label: string; detail?: string | undefined; } | undefined; items: ({ id: string; title: string; description: string; status: "cancelled" | "done" | "failed" | "in_progress" | "paused" | "pending"; dependsOn: string[]; resultSummary?: string | undefined; kind: "task"; fallbackFor?: string | undefined; jobId?: string | undefined; } | { id: string; title: string; description: string; status: "cancelled" | "done" | "failed" | "in_progress" | "paused" | "pending"; dependsOn: string[]; resultSummary?: string | undefined; kind: "group"; tasks: { id: string; title: string; description: string; status: "cancelled" | "done" | "failed" | "in_progress" | "paused" | "pending"; dependsOn: string[]; resultSummary?: string | undefined; kind: "task"; fallbackFor?: string | undefined; jobId?: string | undefined; }[]; })[]; }; readiness: import("./plans/agent-plan.validation").AgentPlanReadiness; } | null>; getTaskCancellation(req: AuthenticatedRequest<{ projectId: string; agentId: string; threadId: string; }>): Promise; stopBackgroundJobs(req: AuthenticatedRequest<{ projectId: string; agentId: string; threadId: string; }>): Promise; resumeBackgroundJob(req: AuthenticatedRequest<{ projectId: string; agentId: string; threadId: string; }>, _res: Response, payload: AgentChatResumeDto): Promise<{ resumed: true; }>; getChatMessages(req: AuthenticatedRequest<{ projectId: string; agentId: string; threadId: string; }>): Promise; getTestChatMessages(req: AuthenticatedRequest<{ projectId: string; agentId: string; }>): Promise; getSessionFiles(req: AuthenticatedRequest<{ projectId: string; agentId: string; threadId: string; }>): Promise; getChatAttachment(req: AuthenticatedRequest<{ projectId: string; agentId: string; attachmentId: string; }, {}, {}, { threadId?: string; }>, res: Response): Promise; clearTestChatMessages(req: AuthenticatedRequest<{ projectId: string; agentId: string; }>): Promise<{ ok: boolean; }>; }