/** * The command that stops a cancelled call on the server. * * Cancelling drops the local ssh client, and that is where it used to end: * with multiplexing the sshd process owning the command stays alive as long * as the master does, so the command never learns the channel is gone and * runs to completion. Nothing on the server side signals the loss — neither * the parent dying, nor EOF on stdin, nor a write error on stdout. * * So the stop is sent, not awaited: the marker sitting in the command's * arguments makes it findable, and its process group is already its own — * sshd gives each command a fresh one. */ /** What a call marker starts with — the tail is random and unique per call */ export declare const CALL_MARKER_PREFIX = "ssh-mcp-call-"; export interface CancelCommand { command: string; /** Password for `sudo -S`, when the elevated form needs one */ stdin?: string; } /** * Build the stop for a cancelled call. * * A command running under sudo is owned by root, and a signal from the login * user never reaches it — so the search itself goes under sudo, where it * covers both halves at once. Without a password sudo is asked in its * non-interactive form: there is no terminal to answer a prompt on, and a * waiting sudo would hold the stop until its own deadline. The plain form * follows as a fallback — it still takes down the wrapper and everything the * login user owns. */ export declare function buildCancelCommand(marker: string, options?: { elevated?: boolean; shell?: string; password?: string; }): CancelCommand;