import type { AiGatewayConfigDto, AiGatewayUsageResponse } from '@n8n/api-types';
import { AiChatRequestDto, AiApplySuggestionRequestDto, AiAskRequestDto, AiFreeCreditsRequestDto, AiBuilderChatRequestDto, AiSessionRetrievalRequestDto, AiUsageSettingsRequestDto, AiTruncateMessagesRequestDto, AiClearSessionRequestDto, AiGatewayUsageQueryDto } from '@n8n/api-types';
import { AuthenticatedRequest } from '@n8n/db';
import { type AiAssistantSDK } from '@n8n_io/ai-assistant-sdk';
import { Response } from 'express';
import { CredentialsService } from '../credentials/credentials.service';
import { AiGatewayService } from '../services/ai-gateway.service';
import { AiUsageService } from '../services/ai-usage.service';
import { WorkflowBuilderService } from '../services/ai-workflow-builder.service';
import { AiService } from '../services/ai.service';
import { UserService } from '../services/user.service';
export type FlushableResponse = Response & {
    flush: () => void;
};
export declare class AiController {
    private readonly aiService;
    private readonly workflowBuilderService;
    private readonly credentialsService;
    private readonly userService;
    private readonly aiUsageService;
    private readonly aiGatewayService;
    constructor(aiService: AiService, workflowBuilderService: WorkflowBuilderService, credentialsService: CredentialsService, userService: UserService, aiUsageService: AiUsageService, aiGatewayService: AiGatewayService);
    build(req: AuthenticatedRequest, res: FlushableResponse, payload: AiBuilderChatRequestDto): Promise<void>;
    chat(req: AuthenticatedRequest, res: FlushableResponse, payload: AiChatRequestDto): Promise<void>;
    applySuggestion(req: AuthenticatedRequest, _: Response, payload: AiApplySuggestionRequestDto): Promise<AiAssistantSDK.ApplySuggestionResponse>;
    askAi(req: AuthenticatedRequest, _: Response, payload: AiAskRequestDto): Promise<AiAssistantSDK.AskAiResponsePayload>;
    aiCredits(req: AuthenticatedRequest, _: Response, payload: AiFreeCreditsRequestDto): Promise<{
        scopes: import("@n8n/permissions").Scope[];
        name: string;
        data: string;
        type: string;
        isManaged: boolean;
        isGlobal: boolean;
        isResolvable: boolean;
        resolvableAllowFallback: boolean;
        resolverId: string | null;
        id: string;
        generateId(): void;
        createdAt: Date;
        updatedAt: Date;
        setUpdateDate(): void;
    }>;
    getSessions(req: AuthenticatedRequest, _: Response, payload: AiSessionRetrievalRequestDto): Promise<{
        sessions: import("@n8n/ai-workflow-builder").Session[];
    }>;
    getGatewayConfig(): Promise<AiGatewayConfigDto>;
    getGatewayWallet(req: AuthenticatedRequest): Promise<{
        budget: number;
        balance: number;
    }>;
    getGatewayUsage(req: AuthenticatedRequest, _: Response, query: AiGatewayUsageQueryDto): Promise<AiGatewayUsageResponse>;
    getBuilderCredits(req: AuthenticatedRequest, _: Response): Promise<AiAssistantSDK.BuilderInstanceCreditsResponse>;
    truncateMessages(req: AuthenticatedRequest, _: Response, payload: AiTruncateMessagesRequestDto): Promise<{
        success: boolean;
    }>;
    clearSession(req: AuthenticatedRequest, _: Response, payload: AiClearSessionRequestDto): Promise<{
        success: boolean;
    }>;
    updateUsageSettings(_req: AuthenticatedRequest, _res: Response, payload: AiUsageSettingsRequestDto): Promise<void>;
}
