/** * Where a removal actually leads. * * The command text shows a name, not a target: `rm -rf /var/www/data/`, * where `data` is a link to `/`, reads as cleaning up an app directory, but * on coreutils it wipes the root. The only way to know the truth is to ask * the server, so there is one request here: resolving paths via `readlink -f`. * * The request is made only for targets ending in a slash or `/*`: `rm -rf * link` without a trailing slash removes the link itself and nothing more * — there's nothing to check there. */ import type { SSHExecutor } from './ssh-executor.js'; import type { SSHConfig } from '../utils/ssh-config.js'; import { type RemovalTarget } from '../utils/destructive-command.js'; export interface ResolutionVerdict { blocked: boolean; reason?: string; } /** * Check where removal targets actually lead. * * Three outcomes, never mixed: the target is safe, the target leads into * the root or a system tree, there is nothing to check with. The last one * is also a block: not knowing is not a reason to proceed with removal, it's a reason to ask the owner. */ export declare function resolveRemovalTargets(executor: SSHExecutor, config: SSHConfig, targets: RemovalTarget[], options: { sudo?: boolean; }): Promise;