@wonderwhy-er/desktop-commander
Version:
MCP server for terminal operations and file editing
126 lines (125 loc) • 3.19 kB
TypeScript
/**
* Initialize the REPL manager with a terminal manager instance
* @param terminalManager - The terminal manager instance
*/
export declare function initializeREPLManager(terminalManager: any): void;
interface REPLSessionParams {
language: string;
options?: any;
}
interface ExecuteCodeParams {
pid: number | string;
code: string;
options?: any;
}
interface SSHSessionParams {
host: string;
username?: string;
port?: number;
identity?: string;
password?: string;
options?: any;
}
interface CommandParams {
pid: number | string;
command: string;
options?: any;
}
interface IdleSessionParams {
maxIdleMs?: number;
}
/**
* Command handler for REPL-related operations
*/
export declare const replCommandHandler: {
/**
* Create a new REPL session
* @param params - Command parameters
* @returns Result object with session PID
*/
createREPLSession: (params: REPLSessionParams) => Promise<{
success: boolean;
pid: number;
message: string;
error?: undefined;
} | {
success: boolean;
error: any;
pid?: undefined;
message?: undefined;
}>;
/**
* Execute code in an existing REPL session
* @param params - Command parameters
* @returns Result with execution output
*/
executeREPLCode: (params: ExecuteCodeParams) => Promise<any>;
/**
* Create a new SSH session
* @param params - Command parameters
* @returns Result object with session PID
*/
createSSHSession: (params: SSHSessionParams) => Promise<{
success: boolean;
pid: number;
message: string;
error?: undefined;
} | {
success: boolean;
error: any;
pid?: undefined;
message?: undefined;
}>;
/**
* Execute a command in an SSH session
* @param params - Command parameters
* @returns Result with execution output
*/
executeSSHCommand: (params: CommandParams) => Promise<any>;
/**
* List all active REPL sessions
* @returns List of active sessions
*/
listREPLSessions: () => {
success: boolean;
sessions: any[];
error?: undefined;
} | {
success: boolean;
error: any;
sessions?: undefined;
};
/**
* Close a specific REPL session
* @param params - Command parameters
* @returns Result indicating success
*/
closeREPLSession: (params: {
pid: number | string;
}) => Promise<{
success: boolean;
message: string;
error?: undefined;
} | {
success: boolean;
error: any;
message?: undefined;
}>;
/**
* Close all idle REPL sessions
* @param params - Command parameters
* @returns Result with number of closed sessions
*/
closeIdleREPLSessions: (params?: IdleSessionParams) => Promise<{
success: boolean;
closedCount: number;
message: string;
error?: undefined;
} | {
success: boolean;
error: any;
closedCount?: undefined;
message?: undefined;
}>;
};
export {};