@wonderwhy-er/desktop-commander
Version:
MCP server for terminal operations and file editing
74 lines (73 loc) • 1.98 kB
TypeScript
/**
* Execution result from a REPL command
*/
interface REPLExecutionResult {
success: boolean;
output: string | null;
error?: string;
timeout: boolean;
}
/**
* Options for executing code in a REPL
*/
interface REPLExecuteOptions {
timeout?: number;
waitForPrompt?: boolean;
ignoreErrors?: boolean;
multiline?: boolean;
}
/**
* Manager for REPL (Read-Eval-Print Loop) sessions
* Provides a higher-level API for working with interactive programming environments
*/
export declare class REPLManager {
private sessions;
private readonly languageConfigs;
/**
* Calculate an appropriate timeout based on code complexity
*/
private calculateTimeout;
/**
* Detect when a REPL is ready for input by looking for prompt patterns
*/
private isReadyForInput;
/**
* Detect errors in REPL output
*/
private detectErrors;
/**
* Create a new REPL session for the specified language
*/
createSession(language: string, timeout?: number): Promise<number>;
/**
* Send and read REPL output with a timeout
* This combines sending input and reading output in a single operation
*/
sendAndReadREPL(pid: number, input: string, options?: REPLExecuteOptions): Promise<REPLExecutionResult>;
/**
* Execute a code block in a REPL session
*/
executeCode(pid: number, code: string, options?: REPLExecuteOptions): Promise<REPLExecutionResult>;
/**
* Terminate a REPL session
*/
terminateSession(pid: number): Promise<boolean>;
/**
* List all active REPL sessions
*/
listSessions(): Array<{
pid: number;
language: string;
runtime: number;
}>;
/**
* Get information about a specific REPL session
*/
getSessionInfo(pid: number): {
pid: number;
language: string;
runtime: number;
} | null;
}
export declare const replManager: REPLManager;
export {};