import type { Thread, Author } from 'chat'; import { AgentCredentialIntegrationConfig } from '@n8n/api-types'; import type { SuspendComponent } from './component-mapper'; export interface AgentChatIntegrationContext { agentId: string; projectId: string; credentialId: string; credential: Record; webhookUrlFor: (platform: string) => string; } export interface UnauthenticatedWebhookResponse { status: number; body: unknown; } export declare abstract class AgentChatIntegration { abstract readonly type: string; abstract readonly credentialTypes: string[]; abstract readonly displayLabel: string; abstract readonly displayIcon: string; readonly supportedComponents?: string[]; readonly needsShortCallbackData: boolean; readonly disableStreaming: boolean; requiresLeader(): boolean; abstract createAdapter(ctx: AgentChatIntegrationContext): Promise; handleUnauthenticatedWebhook?(body: unknown): UnauthenticatedWebhookResponse | undefined; onBeforeConnect?(ctx: AgentChatIntegrationContext): Promise; onAfterConnect?(ctx: AgentChatIntegrationContext): Promise; onBeforeDisconnect?(ctx: AgentChatIntegrationContext): Promise; normalizeComponents?(components: SuspendComponent[]): SuspendComponent[]; formatThreadId?: { fromSdk: (thread: Thread) => string; toSdk: (threadId: string) => string; }; isUserAllowed?(author: Author, settings: AgentCredentialIntegrationConfig | undefined): boolean; } export declare class ChatIntegrationRegistry { private readonly integrations; register(integration: AgentChatIntegration): void; get(type: string): AgentChatIntegration | undefined; require(type: string): AgentChatIntegration; list(): AgentChatIntegration[]; }