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

Compare

+14 −1 in 2 places
Lines 36–45 at 318 (were 36–42 at 17)
3636 );
3737}
3838
39−/** The server's `{error: "sentence"}` answer, or the start of whatever it sent. */
39+/**
40+ * The server's `{error: "sentence"}` answer, or the start of whatever it sent. An HTML page (the host's error
41+ * page, when the server itself failed) is said by its title and Ray ID, which its first lines never reach.
42+ */
4043export function errorSentence(body: string): string {
4144 try {
4245 const parsed = JSON.parse(body) as { error?: unknown; reason?: unknown };
Lines 48–62 at 318 (were 45–49 at 17)
4548 } catch {
4649 // Not JSON.
4750 }
51+ if (/^\s*<(!doctype html|html)/i.test(body)) {
52+ const plain = (s: string) =>
53+ s
54+ .replace(/<[^>]*>/g, " ")
55+ .replace(/\s+/g, " ")
56+ .trim();
57+ const title = plain(/<title>([\s\S]*?)<\/title>/i.exec(body)?.[1] ?? "");
58+ const ray = /Ray ID:\s*(?:<[^>]*>\s*)*([0-9a-f]+)/i.exec(body)?.[1];
59+ return `an HTML error page${title !== "" ? ` titled ${JSON.stringify(title)}` : ""}${ray ? ` (Ray ID ${ray})` : ""}, not the server's own answer: the server failed before it could say why`;
60+ }
4861 return body.slice(0, 300);
4962}
MCP
compare on this site's /mcp
CLI
abso diff 17 318 client/src/api-error.ts --json
JSON
/christopher/abso-core/compare/17..318?file=client%2Fsrc%2Fapi-error.ts&format=json