repl-mcp
Version:
Universal REPL session manager MCP server
77 lines • 2.68 kB
TypeScript
import { REPLConfig, SessionState, CommandResult, SessionCreationResult } from './types.js';
export declare class SessionManager {
private sessions;
private outputBuffers;
private outputChunks;
private sessionLogs;
private globalLogs;
private serverTerminals;
private serializeAddons;
private readonly MAX_LOGS_PER_SESSION;
private readonly MAX_GLOBAL_LOGS;
private readonly MAX_OUTPUT_SIZE;
private readonly MAX_HISTORY_SIZE;
private truncateForMCPResponse;
log(message: string, sessionId?: string): void;
getDebugLogs(sessionId?: string): string[];
clearDebugLogs(sessionId?: string): void;
private getOutputBuffer;
getFullOutput(sessionId: string, offset?: number, limit?: number): {
success: boolean;
output?: string;
totalLength?: number;
offset?: number;
length?: number;
hasMore?: boolean;
nextOffset?: number;
error?: string;
};
getLogStats(): {
totalSessions: number;
totalLogs: number;
globalLogs: number;
};
createSession(config: REPLConfig, displayName?: string): Promise<SessionCreationResult>;
sendInput(sessionId: string, input: string, options?: {
wait_for_prompt?: boolean;
timeout?: number;
add_newline?: boolean;
}): Promise<CommandResult>;
sendSignal(sessionId: string, signal: string): Promise<{
success: boolean;
message?: string;
error?: string;
}>;
setSessionReady(sessionId: string, pattern: string): Promise<{
success: boolean;
message?: string;
error?: string;
}>;
waitForSession(sessionId: string, seconds: number): Promise<{
success: boolean;
message?: string;
error?: string;
}>;
markSessionFailed(sessionId: string, reason: string): Promise<{
success: boolean;
message?: string;
error?: string;
}>;
getSession(sessionId: string): SessionState | undefined;
listSessions(): SessionState[];
destroySession(sessionId: string): Promise<boolean>;
private createShellProcess;
private createServerSideTerminal;
getSerializedTerminalState(sessionId: string): string | null;
getCurrentLineCleanText(sessionId: string): string | null;
getFullCleanText(sessionId: string): string | null;
private setupOutputHandlers;
private waitForShellReady;
private executeSetupCommand;
private startREPL;
private waitForPrompt;
private generateSessionId;
private waitForPromptWithLLMFallback;
private createLLMTimeoutQuestion;
}
//# sourceMappingURL=session-manager.d.ts.map