import net from "node:net"; /** Package-owned acknowledged lifecycle control server. */ export default class BackgroundJobsLifecycleControlServer { configuration: import("../configuration.js").default; generationId: string; main: import("./main.js").default; socketPath: string; /** @type {net.Server | undefined} */ server: net.Server | undefined; /** @type {{dev: number, ino: number} | undefined} */ ownedSocketIdentity: { dev: number; ino: number; } | undefined; /** @type {Set} */ connections: Set; /** * Creates a lifecycle control server. * @param {object} args - Server options. * @param {import("../configuration.js").default} args.configuration - Configuration. * @param {string} args.generationId - Exact generation identity. * @param {import("./main.js").default} args.main - Owned jobs main. * @param {string} args.socketPath - Release-local Unix socket path. */ constructor({ configuration, generationId, main, socketPath }: { configuration: import("../configuration.js").default; generationId: string; main: import("./main.js").default; socketPath: string; }); /** * Starts the secure local listener. * @returns {Promise} - Resolves after secure listen. */ start(): Promise; /** * Closes the owned listener. * @returns {Promise} - Closes connections, listener, and only its owned path. */ close(): Promise; /** * Moves a replacement inode aside because Node unlinks its original Unix * socket pathname during `server.close()` without checking the inode. * @returns {Promise} - Protected sibling path. */ _protectReplacementDuringServerClose(): Promise; /** * Restores an inode protected across Node's automatic Unix-socket unlink. * @param {string | undefined} protectedPath - Protected sibling path. * @returns {Promise} - Resolves after restoration. */ _restoreProtectedReplacement(protectedPath: string | undefined): Promise; /** Validates that the parent is a process-owned real directory inside the release. */ _validateParentDirectory(): Promise; /** Removes only a same-owner, unchanged, stale socket inode. */ _removeStaleOwnedSocket(): Promise; /** * Probes a socket collision. * @returns {Promise} - Whether the existing socket accepts a connection. */ _socketAcceptsConnections(): Promise; /** Unlinks the path only while it is still the inode created by this server. */ _unlinkOwnedSocket(): Promise; /** * Handles a local connection. * @param {net.Socket} socket - Accepted local connection. */ _handleConnection(socket: net.Socket): void; /** * Handles exactly one request and holds retirement open through response flush. * @param {object} args - Request context. * @param {ReturnType} args.message - Parsed message. * @param {net.Socket} args.socket - Control socket. * @returns {Promise} - Resolves after the response is queued. */ _handleRequest({ message, socket }: { message: ReturnType; socket: net.Socket; }): Promise; /** * Validates one lifecycle request. * @param {ReturnType} message - Request. */ _validateRequest(message: ReturnType): void; /** * Writes one lifecycle response. * @param {net.Socket} socket - Response socket. * @param {ReturnType} response - Response. */ _writeResponse(socket: net.Socket, response: ReturnType): void; /** * Emits a lifecycle failure where ignored hook stdio cannot hide it. * @param {object} args - Failure context. * @param {string} args.action - Requested action. * @param {Error} args.error - Original error. * @param {string} args.requestId - Request id. */ _emitLifecycleFailure({ action, error, requestId }: { action: string; error: Error; requestId: string; }): void; } //# sourceMappingURL=lifecycle-control-server.d.ts.map