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

Compare

+53 −0 in 1 place
new file, 53 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": "20512aae32eb8dd64b798c0dd4ba666ea801bec6c9de37d259527c93ce3e48ec",
8+ "index.cjs": "b4cd8c52f3fa945b553dbb7a740c965b48b93dfc2469f10849e111abd00c7460",
9+};
10+const hash = (value) => createHash("sha256").update(value).digest("hex");
11+function once(source, before, after) {
12+ if (source.split(before).length !== 2) throw Error(`Progress anchor mismatch: ${before}`);
13+ return source.replace(before, after);
14+}
15+const outputs = [];
16+for (const [file, expected] of Object.entries(inputs)) {
17+ let source = readFileSync(join(root, file), "utf8");
18+ if (hash(source) !== expected) throw Error(`Unrecognized input: ${file}`);
19+ source = once(
20+ source,
21+ " static demux(input, bounded = false) {",
22+ " static demux(input, bounded = false, discardProgress = false) {",
23+ );
24+ source = once(
25+ source,
26+ " progress.write(line.slice(1));",
27+ " if (!discardProgress) progress.write(line.slice(1));",
28+ );
29+ source = once(source, " progress.write(error);", " if (!discardProgress) progress.write(error);");
30+ source = once(
31+ source,
32+ "async function parseUploadPackResponse(stream, bounded = false) {\n const { packetlines, packfile, progress } = GitSideBand.demux(stream, bounded);",
33+ "async function parseUploadPackResponse(stream, bounded = false, discardProgress = false) {\n const { packetlines, packfile, progress } = GitSideBand.demux(stream, bounded, discardProgress);",
34+ );
35+ source = once(
36+ source,
37+ " const response = await parseUploadPackResponse(raw.body, Boolean(cache && cache[Symbol.for('abso.git.disk-pack')]));",
38+ " const response = await parseUploadPackResponse(raw.body, Boolean(cache && cache[Symbol.for('abso.git.disk-pack')]), Boolean(cache && cache[Symbol.for('abso.git.disk-pack')]) && !onProgress && !onMessage);",
39+ );
40+ outputs.push({ file, source, sha256: hash(source) });
41+}
42+if (!process.argv.includes("--check")) {
43+ for (const { file, source } of outputs) writeFileSync(join(root, file), source);
44+ writeFileSync(
45+ "capacity-git-progress-patch-manifest.json",
46+ JSON.stringify(
47+ outputs.map(({ file, sha256 }) => ({ file, sha256 })),
48+ null,
49+ 2,
50+ ),
51+ );
52+}
53+console.log(JSON.stringify(outputs.map(({ file, sha256 }) => ({ file, sha256 }))));
MCP
compare on this site's /mcp
CLI
abso diff 177 318 server/scripts/capacity-patch-git-progress.mjs --json
JSON
/christopher/abso-core/compare/177..318?file=server%2Fscripts%2Fcapacity-patch-git-progress.mjs&format=json