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 162 to 163

Compare

+15 −0 in 1 place
new file, 15 lines
1+import { jsonEvents } from "./json-events.ts";
2+
3+/** Decode a small canonical frame with the same validation as the streamed path. */
4+export function smallFrameJson(chunks: Iterable<string>): unknown {
5+ let text = "";
6+ for (const chunk of chunks) {
7+ if (text.length + chunk.length > 4096) throw Error("small canonical frame exceeds bound");
8+ text += chunk;
9+ }
10+ // Count UTF-8 after joining so a surrogate pair split across chunks counts once.
11+ if (new TextEncoder().encode(text).byteLength > 4096) throw Error("small canonical frame exceeds bound");
12+ // Preserve depth, key and scalar limits; the fast path must not change acceptance.
13+ for (const event of jsonEvents([text])) void event;
14+ return JSON.parse(text);
15+}
MCP
compare on this site's /mcp
CLI
abso diff 162 163 server/src/small-frame-json.ts --json
JSON
/christopher/abso-core/compare/162..163?file=server%2Fsrc%2Fsmall-frame-json.ts&format=json