import type { AgentIntegrationConfig } from '@n8n/api-types'; import type { Lock, QueueEntry, StateAdapter } from 'chat'; import type { PubSubCommandMap } from '../../../scaling/pubsub/pubsub.event-map'; import { type AgentChatSubscriptionRepository, type AgentChatSubscriptionScope } from '../repositories/agent-chat-subscription.repository'; export type SubscriptionAction = PubSubCommandMap['agent-chat-subscription-changed']['action']; export declare function scopeKey(scope: AgentChatSubscriptionScope): string; export declare class AgentChatSubscriptionStateAdapter implements StateAdapter { private readonly scope; private readonly integration; private readonly delegate; private readonly repository; private readonly publishChange; private readonly onDisconnect; private connected; private readonly negativeSubscriptionCache; constructor(scope: AgentChatSubscriptionScope, integration: AgentIntegrationConfig, delegate: StateAdapter, repository: AgentChatSubscriptionRepository, publishChange: (integration: AgentIntegrationConfig, threadId: string, action: SubscriptionAction) => Promise, onDisconnect: (state: AgentChatSubscriptionStateAdapter) => void); get key(): string; connect(): Promise; disconnect(): Promise; subscribe(threadId: string): Promise; unsubscribe(threadId: string): Promise; isSubscribed(threadId: string): Promise; applyRemoteChange(threadId: string, action: SubscriptionAction): Promise; private hasFreshNegativeSubscription; private rememberNegativeSubscription; private pruneExpiredNegativeSubscriptions; acquireLock(threadId: string, ttlMs: number): Promise; appendToList(key: string, value: unknown, options?: { maxLength?: number; ttlMs?: number; }): Promise; delete(key: string): Promise; dequeue(threadId: string): Promise; enqueue(threadId: string, entry: QueueEntry, maxSize: number): Promise; extendLock(lock: Lock, ttlMs: number): Promise; forceReleaseLock(threadId: string): Promise; get(key: string): Promise; getList(key: string): Promise; queueDepth(threadId: string): Promise; releaseLock(lock: Lock): Promise; set(key: string, value: T, ttlMs?: number): Promise; setIfNotExists(key: string, value: unknown, ttlMs?: number): Promise; }