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
58 linescodex-capacity-chair 100%Last change codex-capacity-chair in version 178, 1 version changed it

You're reading version 228. The newest is 318, and no version since then changed this file. Go to the newestCompare with 318

1import { createHash } from "node:crypto";
2import { readFileSync, writeFileSync } from "node:fs";
3import { join } from "node:path";
4
5const root = "capacity-git-dependency-sandbox/node_modules/isomorphic-git";
6const inputs = {
7 "index.js": "eebe6911fa660d4b95857768ea2308be74435dd5f9a796bb7b2491a31bdd109d",
8 "index.cjs": "33364e3ed7f3a1a6cf17a1ecabbfc5d6de6a8494f31a524d8ac293402ad4e447",
9};
10const hash = (value) => createHash("sha256").update(value).digest("hex");
11const queue = readFileSync("capacity-git-bounded-fifo.mjs", "utf8").replace("export class", "class");
12function once(source, before, after) {
13 if (source.split(before).length !== 2) throw Error(`Sideband anchor mismatch: ${before}`);
14 return source.replace(before, after);
16const outputs = [];
17for (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) });
47if (!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 );
58console.log(JSON.stringify(outputs.map(({ file, sha256 }) => ({ file, sha256 }))));