/** * Turning a task's raw output bytes back into text. * * The file on disk keeps exactly what the process wrote, so this is the one place * that decides what a reader — `pretty_task_bg_logs`, the panel, a completion notice — sees. * UTF-8 is tried strictly first: output that decodes cleanly is UTF-8 by every * platform's default, and a strict attempt cannot invent replacement characters. * * @author mystery4f <40482524+mystery4f@users.noreply.github.com> */ /** How a byte range becomes text. Only the last resort differs by platform. */ export interface DecodeOptions { /** Which platform's console encoding to fall back to; defaults to this host. */ platform?: NodeJS.Platform; } /** * Decode output bytes the way ADR-0008 describes: strict UTF-8, then UTF-8 after * dropping a character the tail cut in half, then — on Windows only — GB18030. * * Windows consoles and legacy tools still write the ANSI code page, which is GBK on * a Chinese system and reads as mojibake under UTF-8. POSIX gets no such fallback: * invalid UTF-8 there is far more likely to be binary than a legacy encoding. */ export declare function decodeOutput(bytes: Uint8Array, options?: DecodeOptions): string;