Skip to content

abso-core

Public

abso is version control for agents: the client, the engine and a server you can run on your own Cloudflare account.

Check passed

Versions 81 to 82

Compare

+9 −5 in 1 place
Lines 22–44 at 82 (were 22–40 at 81)
2222}
2323
2424/**
25− * An SGR sequence without parameter 8 (conceal), which would hide the text after it from the reader. The 8 in an
26− * extended color (38;5;8, 48;2;8;8;8) is a color, so those are copied whole. Nothing is left when 8 was all it said.
25+ * An SGR sequence without parameter 8 (conceal), which would hide the text after it from the reader. Parameters
26+ * are read by value, as a terminal reads them: 08 and 8:1 are 8 too. The 8 in an extended color (38;5;8,
27+ * 48;2;8;8;8, 038;05;8) is a color, so those are copied whole. Nothing is left when 8 was all it said.
2728 */
2829function withoutConceal(sgr: string): string {
2930 const parts = sgr.slice(2, -1).split(";");
31+ const value = (p: string | undefined) => (p === undefined ? Number.NaN : Number(p.split(":")[0]));
3032 const kept: string[] = [];
3133 for (let i = 0; i < parts.length; i++) {
3234 const p = parts[i]!;
33− if ((p === "38" || p === "48" || p === "58") && (parts[i + 1] === "5" || parts[i + 1] === "2")) {
34− const n = parts[i + 1] === "5" ? 3 : 5;
35+ const v = value(p);
36+ const mode = value(parts[i + 1]);
37+ if ((v === 38 || v === 48 || v === 58) && !p.includes(":") && (mode === 5 || mode === 2)) {
38+ const n = mode === 5 ? 3 : 5;
3539 kept.push(...parts.slice(i, i + n));
3640 i += n - 1;
37− } else if (p !== "8") kept.push(p);
41+ } else if (v !== 8) kept.push(p);
3842 }
3943 if (kept.length === parts.length) return sgr;
4044 return kept.length === 0 ? "" : `\x1b[${kept.join(";")}m`;
MCP
compare on this site's /mcp
CLI
abso diff 81 82 client/src/terminal-text.ts --json
JSON
/christopher/abso-core/compare/81..82?file=client%2Fsrc%2Fterminal-text.ts&format=json