import { Tool } from '@modelcontextprotocol/sdk/types.js'; import { CLICommand, CommandProcessor, CommandResult, ProcessResult, ProcessRunner } from '../utils/types.js'; import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js'; export declare class NodeProcessRunner implements ProcessRunner { run(command: string, args?: string[], cwd?: string, stdinInput?: string): Promise; } /** * Abstract base class for command processors with shared roots management */ export declare abstract class BaseCommandProcessor implements CommandProcessor { protected roots: { uri: string; name?: string; }[]; /** * Sets the roots from the MCP server * @param roots Array of root URIs and optional names */ setRoots(roots: { uri: string; name?: string; }[]): void; abstract process(command: string, args: string[], useMcpCwd?: boolean, customWorkingDir?: string, stdinInput?: string): Promise; } export declare class CLIExecutor extends BaseCommandProcessor { private processRunner; constructor(processRunner: ProcessRunner); /** * Process a command by executing it and returning the result * Implements the CommandProcessor interface */ process(command: string, args: string[], useMcpCwd?: boolean, customWorkingDir?: string, stdinInput?: string): Promise; execute(command: string, args: string[], useMcpCwd?: boolean, customWorkingDir?: string, stdinInput?: string): Promise; } export declare class CLICmdWriter extends BaseCommandProcessor { /** * Process a command by generating its text representation without executing it * Implements the CommandProcessor interface */ process(command: string, args: string[], useMcpCwd?: boolean, customWorkingDir?: string, _stdinInput?: string): Promise; /** * For compatibility with the CLIExecutor interface - allows this class * to be used as a drop-in replacement in tests and existing code */ execute(command: string, args: string[], useMcpCwd?: boolean, customWorkingDir?: string, _stdinInput?: string): Promise; /** * Returns the text representation of a CLI command without executing it * @param command The command to generate * @param args Array of command arguments * @param useMcpCwd Whether to include the MCP working directory in the command text * @param customWorkingDir Custom working directory to use instead of MCP directory * @returns CommandResult with the command text in the output field */ private getCommandText; } export declare class CommandRegistry { private commands; register(command: CLICommand): void; getCommand(name: string): CLICommand | undefined; getAllCommands(): CLICommand[]; toMCPTools(): Tool[]; } export declare class CommandFactory { /** * Creates all CLI command instances with appropriate processors * @param executor The command processor to use for most commands that require execution * @param writer The command processor to use for commands that should return text (InitCommand) * @param mcpServer Optional MCP server for commands that support elicitation * @returns An array of command instances * * Note: AuthCommand is not exposed to MCP clients. Authentication is handled * automatically at startup via environment variables (SN_INSTANCE_URL, SN_AUTH_TYPE). * The auth alias is stored in the session and used by all SDK commands. */ static createCommands(executor: CommandProcessor, writer?: CommandProcessor, mcpServer?: McpServer): CLICommand[]; } //# sourceMappingURL=cliCommandTools.d.ts.map