// server/templates/aptReduce.ts const PREFIXES = [ // APT / dpkg (jalon 1) "Inst ", "Conf ", "Remv ", "Err ", "E:", "W:", "dpkg:", // Docker (SJ-0) "Pulling", "Digest", "Status", "Downloaded newer image", "Recreating", "Started", "Error", ]; const CONTAINS = [ "reboot-required", "REBOOT_REQUIRED", "deleted", "Total reclaimed space", ]; /** Garde uniquement les lignes informatives (APT + Docker) d'une sortie brute. */ export function reduceLines(raw: string): string[] { return raw .split("\n") .map((l) => l.trimEnd()) .filter((l) => PREFIXES.some((p) => l.startsWith(p)) || CONTAINS.some((c) => l.includes(c))); } /** Alias rétro-compatible (jalon 1) : même comportement, conserve les imports existants. */ export const reduceAptLines = reduceLines;