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

Compare

+58 −0 in 1 place
new file, 58 lines
1+import { createHash } from "node:crypto";
2+import { readFileSync, writeFileSync } from "node:fs";
3+import { join } from "node:path";
4+
5+const root = "capacity-git-dependency-sandbox/node_modules/isomorphic-git";
6+const inputs = {
7+ "index.js": "eebe6911fa660d4b95857768ea2308be74435dd5f9a796bb7b2491a31bdd109d",
8+ "index.cjs": "33364e3ed7f3a1a6cf17a1ecabbfc5d6de6a8494f31a524d8ac293402ad4e447",
9+};
10+const hash = (value) => createHash("sha256").update(value).digest("hex");
11+const queue = readFileSync("capacity-git-bounded-fifo.mjs", "utf8").replace("export class", "class");
12+function once(source, before, after) {
13+ if (source.split(before).length !== 2) throw Error(`Sideband anchor mismatch: ${before}`);
14+ return source.replace(before, after);
15+}
16+const outputs = [];
17+for (const [file, expected] of Object.entries(inputs)) {
18+ let source = readFileSync(join(root, file), "utf8");
19+ if (hash(source) !== expected) throw Error(`Unrecognized input: ${file}`);
20+ source = once(source, "class GitSideBand {", `${queue}\nclass GitSideBand {`);
21+ source = once(source, " static demux(input) {", " static demux(input, bounded = false) {");
22+ source = once(
23+ source,
24+ " const packfile = new FIFO();",
25+ " const packfile = bounded ? new BoundedPackFIFO(async () => { await getIterator(input).return?.(); }) : new FIFO();",
26+ );
27+ source = once(source, " packfile.write(line.slice(1));", " await packfile.write(line.slice(1));");
28+ source = once(
29+ source,
30+ " nextBit();\n };\n nextBit();",
31+ ` return nextBit();
32+ };
33+ nextBit().catch(error => { packetlines.destroy(error); progress.destroy(error); packfile.destroy(error); });`,
34+ );
35+ source = once(
36+ source,
37+ "async function parseUploadPackResponse(stream) {\n const { packetlines, packfile, progress } = GitSideBand.demux(stream);",
38+ "async function parseUploadPackResponse(stream, bounded = false) {\n const { packetlines, packfile, progress } = GitSideBand.demux(stream, bounded);",
39+ );
40+ source = once(
41+ source,
42+ " const response = await parseUploadPackResponse(raw.body);",
43+ " const response = await parseUploadPackResponse(raw.body, Boolean(cache && cache[Symbol.for('abso.git.disk-pack')]));",
44+ );
45+ outputs.push({ file, source, sha256: hash(source) });
46+}
47+if (!process.argv.includes("--check")) {
48+ for (const { file, source } of outputs) writeFileSync(join(root, file), source);
49+ writeFileSync(
50+ "capacity-git-sideband-patch-manifest.json",
51+ JSON.stringify(
52+ outputs.map(({ file, sha256 }) => ({ file, sha256 })),
53+ null,
54+ 2,
55+ ),
56+ );
57+}
58+console.log(JSON.stringify(outputs.map(({ file, sha256 }) => ({ file, sha256 }))));
MCP
compare on this site's /mcp
CLI
abso diff 166 318 server/scripts/capacity-patch-git-sideband.mjs --json
JSON
/christopher/abso-core/compare/166..318?file=server%2Fscripts%2Fcapacity-patch-git-sideband.mjs&format=json