interm-mcp
Version:
MCP server for terminal applications and TUI automation with 127 tools
68 lines (67 loc) • 2.43 kB
TypeScript
import { KeyboardEvent, MouseEvent, TouchEvent, TerminalState } from './types.js';
export interface RecordedInteraction {
id: string;
sessionId: string;
name: string;
description?: string;
startTime: Date;
endTime: Date;
events: Array<KeyboardEvent | MouseEvent | TouchEvent>;
totalDuration: number;
eventCount: number;
}
export interface StateSnapshot {
id: string;
sessionId: string;
timestamp: Date;
state: TerminalState;
metadata?: Record<string, unknown>;
}
export interface StateDiff {
id: string;
fromSnapshotId: string;
toSnapshotId: string;
timestamp: Date;
changes: Array<{
type: 'content' | 'cursor' | 'dimensions' | 'attributes';
oldValue: unknown;
newValue: unknown;
path: string;
}>;
summary: string;
}
export declare class InteractionReplayManager {
private static instance;
private terminalManager;
private sessionManager;
private recordings;
private snapshots;
private diffs;
private activeRecordings;
private constructor();
static getInstance(): InteractionReplayManager;
startRecording(sessionId: string, name: string, description?: string): Promise<string>;
stopRecording(recordingId: string): Promise<RecordedInteraction>;
addEventToRecording(recordingId: string, event: KeyboardEvent | MouseEvent | TouchEvent): Promise<void>;
replayInteraction(recordingId: string, targetSessionId: string, speedMultiplier?: number): Promise<void>;
private executeEvent;
createStateSnapshot(sessionId: string, metadata?: Record<string, unknown>): Promise<string>;
generateStateDiff(fromSnapshotId: string, toSnapshotId: string): Promise<string>;
getRecording(recordingId: string): RecordedInteraction | null;
getAllRecordings(sessionId?: string): RecordedInteraction[];
getSnapshot(snapshotId: string): StateSnapshot | null;
getAllSnapshots(sessionId?: string): StateSnapshot[];
getDiff(diffId: string): StateDiff | null;
getAllDiffs(): StateDiff[];
getActiveRecordings(): Array<{
id: string;
sessionId: string;
name: string;
startTime: Date;
eventCount: number;
}>;
deleteRecording(recordingId: string): Promise<boolean>;
deleteSnapshot(snapshotId: string): Promise<boolean>;
deleteStateDiff(diffId: string): Promise<boolean>;
cleanup(): Promise<void>;
}