/** * BugBox Cross-Platform Layer * * Handles the scenario where a bug was captured on one OS but replayed on another. * Instead of requiring Docker/WSL, this layer translates: * * 1. Commands — python3 ↔ python, node stays node, bash → cmd/powershell * 2. Paths — / ↔ \, $HOME ↔ %USERPROFILE%, path separators in PATH * 3. Environment variables — HOME ↔ USERPROFILE, USER ↔ USERNAME, etc. * 4. Shell wrappers — bash -c "..." → cmd /c "..." or powershell -c "..." * * Limitations (honest about what we CAN'T do): * - Compiled binaries (ELF on Windows, PE on Linux) → fail with clear message * - OS-specific syscalls (inotify, kqueue, epoll) → fail with clear message * - Shell scripts with heavy bash-isms → best-effort translation, may fail * * Philosophy: Translate what's translatable, warn clearly about what isn't. */ export interface CrossPlatformContext { /** OS the bug was captured on */ capturedPlatform: string; /** OS we're replaying on */ replayPlatform: string; /** Architecture the bug was captured on */ capturedArch?: string; /** Architecture we're replaying on */ replayArch?: string; /** Whether cross-platform translation is needed */ needsTranslation: boolean; /** Whether replay is likely to succeed */ likelyCompatible: boolean; /** Warnings to show the user */ warnings: string[]; } export interface TranslatedCommand { /** The translated command array */ command: string[]; /** Whether translation was applied */ translated: boolean; /** Description of what was translated */ translations: string[]; /** Hard blockers — replay will fail */ blockers: string[]; } export interface TranslatedEnvironment { /** The translated environment variables */ environment: Record; /** Translations applied */ translations: string[]; } /** Available runtimes on the replay platform */ export interface AvailableRuntimes { python: string | null; node: string | null; java: string | null; go: string | null; ruby: string | null; rust: string | null; dotnet: string | null; gcc: string | null; gpp: string | null; } /** Detect which runtimes are available on the current platform */ export declare function detectAvailableRuntimes(): AvailableRuntimes; /** * Detects whether cross-platform translation is needed and assesses compatibility. */ export declare function detectCrossPlatform(capturedPlatform: string, replayPlatform?: string, capturedArch?: string, replayArch?: string): CrossPlatformContext; /** * Translates a command from the captured platform to the replay platform. */ export declare function translateCommand(command: string[], capturedPlatform: string, replayPlatform?: string, availableRuntimes?: AvailableRuntimes): TranslatedCommand; /** * Translates environment variables between platforms. */ export declare function translateEnvironment(env: Record, capturedPlatform: string, replayPlatform?: string): TranslatedEnvironment; //# sourceMappingURL=cross-platform.d.ts.map