type RpcHandler = (params: Record) => Promise>; export declare class AftRpcServer { private nodeServer; private bunServer; private port; private token; private handlers; private portFilePath; private portsDir; private heartbeatTimer; /** Unique per-instance ID — distinguishes our entry from duplicate plugin loads. */ private instanceId; private sockets; constructor(storageDir: string, directory: string); /** Register an RPC method handler. */ handle(method: string, handler: RpcHandler): void; /** Start the server on a random port, write port to disk. */ start(): Promise; private startBun; private startNode; private afterServerStarted; private writePortFile; /** * Remove sibling port files whose owning process is provably dead. * Only files with a recorded pid that no longer maps to a live process are * removed; pid-less (legacy) files and live entries are left untouched. * Never touches our own freshly written file. */ private sweepDeadPortFiles; /** Rewrite the port file if it disappeared (wrongful deletion recovery). */ private ensurePortFile; /** Stop the server and clean up port file. */ stop(): void; private handleFetch; private handleWsMessage; private closeWs; private dispatch; } export {}; //# sourceMappingURL=rpc-server.d.ts.map