import { InstanceAiFeedbackRequestDto, InstanceAiRenameThreadRequestDto, AssistantThreadTabsRequestDto, InstanceAiPreferenceCardEditRequestDto, InstanceAiPreferenceCardUndoRequestDto, InstanceAiSendMessageRequest, InstanceAiEventsQuery, InstanceAiCorrectTaskRequest, InstanceAiEnsureThreadRequest, InstanceAiPersistPendingAgentRequest, InstanceAiThreadMessagesQuery, InstanceAiThreadHistoryQuery } from '@n8n/api-types'; import type { AssistantThreadTabsResponse } from '@n8n/api-types'; import { GlobalConfig } from '@n8n/config'; import { AuthenticatedRequest } from '@n8n/db'; import type { NextFunction, Request, Response } from 'express'; import { InstanceAiBrowserSessionService } from './browser/instance-ai-browser-session.service'; import { DurableEventLog } from './event-bus/durable-event-log'; import { DurableLogMetrics } from './event-bus/durable-log-metrics'; import { InProcessEventBus } from './event-bus/in-process-event-bus'; import { InstanceAiErrorReporterService } from './instance-ai-error-reporter.service'; import { InstanceAiMemoryService } from './instance-ai-memory.service'; import { InstanceAiPendingAgentService } from './instance-ai-pending-agent.service'; import { InstanceAiPreferenceCardService } from './instance-ai-preference-card.service'; import { InstanceAiSettingsService } from './instance-ai-settings.service'; import { InstanceAiThreadTabsService } from './instance-ai-thread-tabs.service'; import { InstanceAiService } from './instance-ai.service'; import { InstanceAiOnboardingService } from './onboarding'; import { ProjectService } from '../../services/project.service.ee'; type FlushableResponse = Response & { flush?: () => void; }; export declare class InstanceAiController { private readonly instanceAiService; private readonly browserSessionService; private readonly memoryService; private readonly onboarding; private readonly pendingAgentService; private readonly settingsService; private readonly eventBus; private readonly eventLog; private readonly durableLogMetrics; private readonly projectService; private readonly instanceAiErrorReporter; private readonly preferenceCardService; private readonly threadTabsService; private readonly instanceAiConfig; constructor(instanceAiService: InstanceAiService, browserSessionService: InstanceAiBrowserSessionService, memoryService: InstanceAiMemoryService, onboarding: InstanceAiOnboardingService, pendingAgentService: InstanceAiPendingAgentService, settingsService: InstanceAiSettingsService, eventBus: InProcessEventBus, eventLog: DurableEventLog, durableLogMetrics: DurableLogMetrics, projectService: ProjectService, instanceAiErrorReporter: InstanceAiErrorReporterService, preferenceCardService: InstanceAiPreferenceCardService, globalConfig: GlobalConfig, threadTabsService: InstanceAiThreadTabsService); private requireInstanceAiEnabled; private requireModelConfigured; private requireRunDebugEnabled; stripBrotli(req: Request, _res: Response, next: NextFunction): void; chat(req: AuthenticatedRequest, _res: Response, threadId: string, payload: InstanceAiSendMessageRequest): Promise<{ runId: string; }>; events(req: AuthenticatedRequest, res: FlushableResponse, threadId: string, query: InstanceAiEventsQuery): Promise; confirm(req: AuthenticatedRequest, _res: Response, requestId: string): Promise; cancel(req: AuthenticatedRequest, _res: Response, threadId: string): Promise<{ ok: boolean; }>; feedback(req: AuthenticatedRequest, _res: Response, threadId: string, responseId: string, payload: InstanceAiFeedbackRequestDto): Promise<{ ok: boolean; }>; cancelTask(req: AuthenticatedRequest, _res: Response, threadId: string, taskId: string): Promise<{ ok: boolean; }>; correctTask(req: AuthenticatedRequest, _res: Response, threadId: string, taskId: string, payload: InstanceAiCorrectTaskRequest): Promise<{ ok: boolean; }>; undoPreference(req: AuthenticatedRequest, _res: Response, threadId: string, preferenceId: string, payload: InstanceAiPreferenceCardUndoRequestDto): Promise<{ ok: boolean; event: { runId: string; agentId: string; userId?: string | undefined; responseId?: string | undefined; ts?: number | undefined; type: "preference-card"; payload: { toolCallId: string; preferenceId: string; state: "edited" | "undone"; content?: string | undefined; scope?: "instance" | "project" | "user" | undefined; projectId?: string | null | undefined; }; }; }>; editPreference(req: AuthenticatedRequest, _res: Response, threadId: string, preferenceId: string, payload: InstanceAiPreferenceCardEditRequestDto): Promise; getUserPreferences(req: AuthenticatedRequest): Promise; listThreads(req: AuthenticatedRequest): Promise; listThreadHistory(req: AuthenticatedRequest, _res: Response, query: InstanceAiThreadHistoryQuery): Promise; getThread(req: AuthenticatedRequest, _res: Response, threadId: string): Promise<{ thread: import("@n8n/api-types").InstanceAiThreadInfo; }>; ensureThread(req: AuthenticatedRequest, _res: Response, payload: InstanceAiEnsureThreadRequest): Promise; deleteThread(req: AuthenticatedRequest, _res: Response, threadId: string): Promise<{ ok: boolean; }>; renameThread(req: AuthenticatedRequest, _res: Response, threadId: string, payload: InstanceAiRenameThreadRequestDto): Promise<{ thread: import("@n8n/api-types").InstanceAiThreadInfo; }>; getThreadTabs(req: AuthenticatedRequest, _res: Response, threadId: string): Promise; saveThreadTabs(req: AuthenticatedRequest, _res: Response, threadId: string, payload: AssistantThreadTabsRequestDto): Promise; persistPendingAgent(req: AuthenticatedRequest, _res: Response, threadId: string, payload: InstanceAiPersistPendingAgentRequest): Promise<{ agent: import("../agents/agent-draft.contracts").AgentDraftState; thread: import("@n8n/api-types").InstanceAiThreadInfo; }>; getThreadMessages(req: AuthenticatedRequest, _res: Response, threadId: string, query: InstanceAiThreadMessagesQuery): Promise; getThreadStatus(req: AuthenticatedRequest, _res: Response, threadId: string): Promise; getRunDebug(req: AuthenticatedRequest, _res: Response, runId: string): Promise; listThreadDebugRuns(req: AuthenticatedRequest, _res: Response, threadId: string): Promise<{ threadId: string; runs: { runId: string; threadId: string; startedAt: number; stepCount: number; workflowCodeCount: number; label: string | undefined; }[]; }>; createBrowserLink(req: AuthenticatedRequest): Promise; browserStatus(req: AuthenticatedRequest): import("@n8n/api-types").InstanceAiBrowserStatusResponse; browserDisconnectSession(req: AuthenticatedRequest): Promise<{ ok: boolean; }>; private assertBrowserChannelEnabled; private assertThreadAccess; private writeSseEvent; } export {};