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 74 to 318

Compare

+24 −1 in 2 places
Lines 21–49 at 318 (were 21–26 at 74)
2121 return 0;
2222}
2323
24+/**
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.
28+ */
29+function withoutConceal(sgr: string): string {
30+ const parts = sgr.slice(2, -1).split(";");
31+ const value = (p: string | undefined) => (p === undefined ? Number.NaN : Number(p.split(":")[0]));
32+ const kept: string[] = [];
33+ for (let i = 0; i < parts.length; i++) {
34+ const p = parts[i]!;
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;
39+ kept.push(...parts.slice(i, i + n));
40+ i += n - 1;
41+ } else if (v !== 8) kept.push(p);
42+ }
43+ if (kept.length === parts.length) return sgr;
44+ return kept.length === 0 ? "" : `\x1b[${kept.join(";")}m`;
45+}
2447/** Whether a character code is one the terminal acts on: C0 but tab and newline, DEL, and C1. */
2548const control = (c: number) => (c < 0x20 && c !== 0x09 && c !== 0x0a) || (c >= 0x7f && c <= 0x9f);
2649
Lines 61–67 at 318 (were 38–44 at 74)
3861 }
3962 const sgr = sgrAt(text, i);
4063 if (sgr > 0) {
41− if (colors) out += text.slice(i, i + sgr);
64+ if (colors) out += withoutConceal(text.slice(i, i + sgr));
4265 i += sgr - 1;
4366 } else if (c === 0x0d && text.charCodeAt(i + 1) === 0x0a) out += "\r";
4467 else out += c < 0x80 ? `\\x${c.toString(16).padStart(2, "0")}` : `\\u${c.toString(16).padStart(4, "0")}`;
MCP
compare on this site's /mcp
CLI
abso diff 74 318 client/src/terminal-text.ts --json
JSON
/christopher/abso-core/compare/74..318?file=client%2Fsrc%2Fterminal-text.ts&format=json