evals
scenario-1
scenario-2
scenario-3
scenario-4
scenario-5
scenario-6
scenario-7
Build a tiny utility that orchestrates deterministic selection of free TCP ports and Unix socket paths. It should mirror the dependency's candidate-ordering behavior while allowing callers to tune defaults.
/tmp/demo.sock that already exists, requesting 2 socket paths skips the existing path, returns the next deterministic candidate, and provides a second unique path derived from the same sequence. @testexport interface PortRange {
start?: number;
stop?: number;
host?: string;
}
export function configureDefaults(options: { basePort?: number; highestPort?: number; basePath?: string }): void;
/**
* Find a run of available TCP ports.
* Returns the first `count` free ports in ascending order, starting from the configured defaults unless overridden.
*/
export async function reservePorts(count: number, range?: PortRange): Promise<number[]>;
/**
* Suggest available local socket paths.
* Returns `count` unique, unused Unix socket (or Windows pipe) identifiers derived from the configured base path.
*/
export async function suggestSocketPaths(count: number, basePath?: string): Promise<string[]>;Uses the dependency's deterministic next-candidate search for both ports and socket paths to mirror its allocation order.