/** * What we left behind on the machine * * Control sockets outlive the server exiting: the connection is shared across * the machine, and closing it would cut the channel out from under a sibling * window. This module only reports facts — which sockets sit in the directory * and whether they're alive. Consumers assemble display text themselves: * output printing and ssh_monitor. */ /** * State of a control socket. * * `stale` — the file is left over from a killed master: the next command * will bring the connection back up, but until then the socket takes up * space and is misleading. */ type ControlSocketState = 'alive' | 'stale' | 'unknown'; export interface ControlSocket { path: string; /** * When the master came up. Not updated by commands, so this time can't be * used to judge how much longer the connection has left to live. */ since: Date; state: ControlSocketState; } /** * Control sockets left in the directory. * * The directory belongs to the server, but besides sockets it also holds the * askpass script, so names are filtered by prefix. A socket that disappears * between reading the directory and probing it is left out of the list: its * time ran out, and it's no longer ours. */ export declare function listControlSockets(controlDir?: string): Promise; /** * How long the connection lives after the last command, in seconds. * * This is the exact value that goes into the ssh command, so the caller * states a deadline, not a promise. The remaining time isn't computed: the * socket's timestamp is the moment the master came up — commands don't move it. */ export declare function idleWindowSec(): number; export {};