interm-mcp
Version:
MCP server for terminal applications and TUI automation with 127 tools
125 lines (124 loc) • 3.57 kB
TypeScript
import { AccessibilityInfo, TerminalState } from './types.js';
export interface ScreenReaderEvent {
type: 'focus_changed' | 'content_changed' | 'selection_changed' | 'key_pressed';
target?: string;
content?: string;
announcement?: string;
timestamp: Date;
}
export interface VoiceCommand {
command: string;
confidence: number;
parameters?: Record<string, any>;
timestamp: Date;
}
export interface AccessibilitySettings {
screenReaderEnabled: boolean;
highContrastEnabled: boolean;
magnificationLevel: number;
voiceInputEnabled: boolean;
keyboardNavigationOnly: boolean;
announceChanges: boolean;
speechRate: number;
speechVolume: number;
}
export declare class AccessibilityManager {
private static instance;
private settings;
private screenReaderEvents;
private voiceCommands;
private currentFocus;
private lastAnnouncedContent;
private constructor();
static getInstance(): AccessibilityManager;
/**
* Initialize accessibility features based on system capabilities
*/
initialize(): Promise<AccessibilityInfo>;
/**
* Detect system accessibility features
*/
private detectAccessibilityFeatures;
/**
* macOS accessibility detection methods
*/
private detectMacOSScreenReader;
private detectMacOSHighContrast;
private detectMacOSVoiceControl;
private detectMacOSZoom;
/**
* Windows accessibility detection methods
*/
private detectWindowsNarrator;
private detectWindowsHighContrast;
private detectWindowsSpeechRecognition;
/**
* Linux accessibility detection methods
*/
private detectLinuxScreenReader;
private detectLinuxHighContrast;
/**
* Announce content changes to screen readers
*/
announceToScreenReader(content: string, priority?: 'polite' | 'assertive'): void;
/**
* Process content for speech synthesis
*/
private processContentForSpeech;
/**
* Perform platform-specific screen reader announcement
*/
private performScreenReaderAnnouncement;
/**
* Process voice command
*/
processVoiceCommand(audioData: Buffer): Promise<VoiceCommand | null>;
/**
* Generate high contrast terminal output
*/
applyHighContrastFiltering(terminalState: TerminalState): TerminalState;
/**
* Convert colors to high contrast equivalents
*/
private convertToHighContrastColor;
/**
* Get current accessibility settings
*/
getSettings(): AccessibilitySettings;
/**
* Update accessibility settings
*/
updateSettings(newSettings: Partial<AccessibilitySettings>): void;
/**
* Get screen reader event history
*/
getScreenReaderEvents(limit?: number): ScreenReaderEvent[];
/**
* Get voice command history
*/
getVoiceCommands(limit?: number): VoiceCommand[];
/**
* Clear accessibility history
*/
clearHistory(): void;
/**
* Generate accessibility report
*/
generateAccessibilityReport(): {
systemInfo: AccessibilityInfo;
settings: AccessibilitySettings;
eventStats: {
screenReaderEvents: number;
voiceCommands: number;
lastActivity: Date | null;
};
};
/**
* Handle focus changes for screen reader navigation
*/
handleFocusChange(newFocus: string, content?: string): void;
/**
* Provide keyboard navigation hints
*/
getKeyboardNavigationHints(): string[];
}