/** * Session manager — tracks active x64dbg debugging sessions. * * Each session owns its own x64dbg process and bridge connection. terminate() * is the canonical full-cleanup path: disconnect bridge → kill x64dbg → drop * session entry. GC reuses the same path when an idle session expires. * * Session lifecycle: * 1. createIdle(exe, arch, port) → state="idle" (bridge connected, no debuggee) * 2. applyStateChange("loading") → state="loading" (debug.load/attach in flight) * 3. bridge push stateChange → state="paused"|"running" * 4. debuggee exits → state="idle" (session reusable) * OR session.terminate() → state="terminated" * * "terminated" is a terminal state: applyStateChange will not overwrite it. */ import { EventEmitter } from "events"; import type { Session, DebugState, Breakpoint, ModuleInfo, DebugEvent, PauseReason, TerminationReason } from "./types.js"; export declare class SessionManager { private sessions; private stateCVs; private gcTimer; private _now; start(): void; stop(): void; create(executable: string, architecture: "x86" | "x64", pid: number, bridgePort: number): Session; /** Create a session in "idle" state — bridge connected, no debuggee loaded yet. */ createIdle(executable: string, architecture: "x86" | "x64", bridgePort: number): Session; updatePid(id: string, pid: number): void; get(id: string): Session; peek(id: string): Session; has(id: string): boolean; list(): Session[]; updateState(id: string, state: DebugState): void; applyDebugEvent(id: string, event: DebugEvent): void; applyStateChange(id: string, bridgeState: { state: DebugState; pauseReason: PauseReason | null; terminationReason: TerminationReason | null; }): void; wireClient(id: string, client: EventEmitter): void; waitForStateChange(id: string, timeoutMs: number): Promise; setModules(id: string, modules: ModuleInfo[]): void; addBreakpoint(id: string, bp: Breakpoint): void; removeBreakpoint(id: string, address: string): void; /** * Full cleanup: disconnect bridge, kill the owning x64dbg, drop the session. * Safe to call repeatedly; missing pieces are tolerated. */ terminate(id: string, reason?: TerminationReason): Promise; private collectExpired; toJSON(): object[]; } /** Singleton session manager */ export declare const sessions: SessionManager; /** D7 — cross-cutting bus for MCP notification wiring; emits ("debugEvent", sessionId, event) and ("stateChange", sessionId, state). */ export declare const notificationBus: EventEmitter<[never]>; //# sourceMappingURL=session.d.ts.map