import { type CancelledErrorClass, type SessionOwners } from "./executor-base.js"; interface KernelSessionRegistryOptions { sessionId?: string; kernelOwnerId?: string; interpreter?: string; reset?: boolean; signal?: AbortSignal; deadlineMs?: number; bridge?: unknown; bridgeSessionId?: string; } interface RegistryKernelShutdownResult { confirmed?: boolean; } interface RegistryKernel { isAlive(): boolean; shutdown(options?: { timeoutMs: number; }): Promise; } export interface KernelSession extends SessionOwners { sessionKey: string; sessionId: string; cwd: string; kernel: TKernel; } export interface KernelSessionRegistryContext> { sessions: Map; startKernel: (cwd: string, options: TOptions) => Promise; replaceSessionKernel: (session: TSession, cwd: string, options: TOptions) => Promise; } interface KernelSessionRegistryDescriptor> { languageLabel: string; cancelledErrorClass: CancelledErrorClass; buildSessionKey: (sessionId: string, cwd: string, interpreter: string | undefined) => string; createSession: (session: KernelSession) => TSession; startKernel: (cwd: string, options: TOptions) => Promise; executeWithKernel: (kernel: TKernel, code: string, options: TOptions) => Promise; waitForStartup?: (promise: Promise, options: TOptions) => Promise; replaceSessionKernel?: (session: TSession, cwd: string, options: TOptions, context: KernelSessionRegistryContext) => Promise; acquireLiveSessionKernel?: (session: TSession, cwd: string, options: TOptions, context: KernelSessionRegistryContext) => Promise; invalidateSession?: (session: TSession) => void; shutdownSession?: (session: TSession, resetting: boolean) => Promise; clearResetsOnDisposeAll?: boolean; logBeforeReplacement?: boolean; isCancellation?: (error: unknown) => boolean; isTimedOutCancellation?: (error: unknown, signal?: AbortSignal) => boolean; validateKernel?: (session: TSession, kernel: TKernel) => boolean; } interface KernelSessionRegistry> { disposeAll(): Promise; disposeByOwner(ownerId: string): Promise; executeOnSession(code: string, cwd: string, options: TOptions): Promise; peekLiveKernel(cwd: string, options: TOptions): TKernel | undefined; getPresentSession(cwd: string, options: TOptions): TSession | undefined; } export declare function normalizeKernelSessionCwd(cwd: string): string; export declare function requireRemainingKernelTimeoutMs(deadlineMs: number | undefined, cancelledErrorClass: CancelledErrorClass): number | undefined; export declare function formatSessionTimeoutAnnotation(timeoutMs?: number): string; export declare function formatSessionKernelTimeoutAnnotation(timeoutMs: number | undefined, kernelKilled: boolean): string; export declare function createKernelSessionRegistry>(descriptor: KernelSessionRegistryDescriptor): KernelSessionRegistry; export {};