/** * SSH Exec Tool * Universal tool for executing SSH commands */ import { CallToolRequest, Tool } from '@modelcontextprotocol/sdk/types.js'; import { type ToolResult } from '../utils/tool-result.js'; /** * SSH Exec Tool */ export declare class ExecTool { private executor; constructor(); /** * Get tool description for MCP */ getTool(): Tool; /** * Handle tool call */ handleCall(request: CallToolRequest, signal?: AbortSignal): Promise; /** * The answer to a call that ended before every command reported back. * * A timeout leaves the command alive on the server — we stopped waiting, it * did not stop; a cancelled call and a dropped connection end the same way. * Whatever stood after it was never sent. */ private interruptedAnswer; /** * Start the command as a background job and answer right away. * * The job's state stays on the server's disk, so the response carries only * an id: everything else is asked for with the `ssh_job_*` tools, including * after our process restarts. */ private startJob; /** * A refusal if even one command in the call would destroy data for good. * * Parsing the text settles almost everything at once and without the * network; one request goes to the server, and only for what the text * cannot show — where a symlink leads. Returns which command was refused * and why, or null if it is safe to proceed. */ private refuseDestructive; }