import { MemorySaver } from '@langchain/langgraph'; import { Logger } from '@n8n/backend-common'; import type { INodeTypeDescription } from 'n8n-workflow'; import type { HITLHistoryEntry, HITLInterruptValue } from './types/planning'; import { ISessionStorage } from './types/session-storage'; import { LangchainMessage, Session } from './types/sessions'; export declare class SessionManagerService { private readonly storage?; private readonly logger?; private checkpointer; private nodeTypes; private static readonly HITL_TTL_MS; private pendingHitlByThreadId; private hitlHistoryByThreadId; constructor(parsedNodeTypes: INodeTypeDescription[], storage?: ISessionStorage | undefined, logger?: Logger | undefined); get usesPersistence(): boolean; updateNodeTypes(nodeTypes: INodeTypeDescription[]): void; static generateThreadId(workflowId?: string, userId?: string, agentType?: 'code-builder'): string; getCheckpointer(): MemorySaver; setPendingHitl(threadId: string, value: HITLInterruptValue, triggeringMessageId?: string): void; clearPendingHitl(threadId: string): void; getAndClearPendingHitl(threadId: string): { value: HITLInterruptValue; triggeringMessageId?: string; } | undefined; getPendingHitl(threadId: string): HITLInterruptValue | undefined; private formatPendingHitlMessage; addHitlEntry(threadId: string, entry: HITLHistoryEntry): void; getHitlHistory(threadId: string): HITLHistoryEntry[]; private truncateHitlHistory; private injectHitlHistory; private hitlEntryToMessages; private findInsertPosition; private evictExpiredHitl; loadSessionMessages(threadId: string): Promise; saveSessionFromCheckpointer(threadId: string, previousSummary?: string): Promise; getPreviousSummary(threadId: string): Promise; clearSession(threadId: string): Promise; clearAllSessions(workflowId: string, userId: string): Promise; getSessions(workflowId: string | undefined, userId: string | undefined, agentType?: 'code-builder'): Promise<{ sessions: Session[]; }>; private loadMessagesForTruncation; truncateMessagesAfter(workflowId: string, userId: string | undefined, messageId: string, agentType?: 'code-builder', versionCardId?: string): Promise; private resetCodeBuilderSession; }