import { InstanceAiFeedbackRequestDto, InstanceAiGatewayCapabilitiesDto, InstanceAiFilesystemResponseDto, InstanceAiRenameThreadRequestDto, InstanceAiSendMessageRequest, InstanceAiEventsQuery, InstanceAiCorrectTaskRequest, InstanceAiEnsureThreadRequest, InstanceAiThreadMessagesQuery, InstanceAiAdminSettingsUpdateRequest, InstanceAiUserPreferencesUpdateRequest, InstanceAiEvalExecutionRequest, InstanceAiEvalSubAgentRequest } from '@n8n/api-types'; import { ModuleRegistry } from '@n8n/backend-common'; import { GlobalConfig } from '@n8n/config'; import { AuthenticatedRequest } from '@n8n/db'; import type { NextFunction, Request, Response } from 'express'; import { EvalExecutionService } from './eval/execution.service'; import { SubAgentEvalService } from './eval/sub-agent-eval.service'; import { InProcessEventBus } from './event-bus/in-process-event-bus'; import { InstanceAiMemoryService } from './instance-ai-memory.service'; import { InstanceAiSettingsService } from './instance-ai-settings.service'; import { InstanceAiService } from './instance-ai.service'; import { Push } from '../../push'; import { UrlService } from '../../services/url.service'; type FlushableResponse = Response & { flush?: () => void; }; export declare class InstanceAiController { private readonly instanceAiService; private readonly memoryService; private readonly settingsService; private readonly evalExecutionService; private readonly subAgentEvalService; private readonly eventBus; private readonly moduleRegistry; private readonly push; private readonly urlService; private readonly gatewayApiKey; private static getTreeRichnessScore; private static selectBootstrapTree; constructor(instanceAiService: InstanceAiService, memoryService: InstanceAiMemoryService, settingsService: InstanceAiSettingsService, evalExecutionService: EvalExecutionService, subAgentEvalService: SubAgentEvalService, eventBus: InProcessEventBus, moduleRegistry: ModuleRegistry, push: Push, urlService: UrlService, globalConfig: GlobalConfig); private requireInstanceAiEnabled; 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<{ ok: boolean; }>; 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; }>; getCredits(req: AuthenticatedRequest): Promise<{ creditsQuota: number; creditsClaimed: number; }>; getAdminSettings(_req: AuthenticatedRequest): Promise; updateAdminSettings(_req: AuthenticatedRequest, _res: Response, payload: InstanceAiAdminSettingsUpdateRequest): Promise; getUserPreferences(req: AuthenticatedRequest): Promise; updateUserPreferences(req: AuthenticatedRequest, _res: Response, payload: InstanceAiUserPreferencesUpdateRequest): Promise; listModelCredentials(req: AuthenticatedRequest): Promise; listServiceCredentials(req: AuthenticatedRequest): Promise; listThreads(req: AuthenticatedRequest): Promise; 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; }>; getThreadMessages(req: AuthenticatedRequest, _res: Response, threadId: string, query: InstanceAiThreadMessagesQuery): Promise; getThreadStatus(req: AuthenticatedRequest, _res: Response, threadId: string): Promise; executeWithLlmMock(req: AuthenticatedRequest, _res: Response, workflowId: string, payload: InstanceAiEvalExecutionRequest): Promise; runSubAgentEval(req: AuthenticatedRequest, _res: Response, payload: InstanceAiEvalSubAgentRequest): Promise; createGatewayLink(req: AuthenticatedRequest): Promise<{ token: string; command: string; }>; gatewayEvents(req: Request, res: FlushableResponse): Promise; gatewayInit(req: Request, _res: Response, payload: InstanceAiGatewayCapabilitiesDto): Promise<{ ok: boolean; sessionKey: string; } | { ok: boolean; sessionKey?: undefined; }>; gatewayDisconnect(req: Request): { ok: boolean; }; gatewayResponse(req: Request, _res: Response, requestId: string, payload: InstanceAiFilesystemResponseDto): { ok: boolean; }; gatewayStatus(req: AuthenticatedRequest): Promise<{ connected: boolean; connectedAt: string | null; directory: string | null; hostIdentifier: string | null; toolCategories: import("@n8n/api-types").ToolCategory[]; }>; gatewayDisconnectSession(req: AuthenticatedRequest): Promise<{ ok: boolean; }>; private assertThreadAccess; private assertGatewayEnabled; private getGatewayKeyHeader; private validateGatewayApiKey; private writeSseEvent; } export {};