- MCP
- code on this site's /mcp
- CLI
- none: the JSON below is the answer
- JSON
- /christopher/abso-core/files/server/scripts/capacity-patch-git-progress.mjs?version=315&format=json
53 linescodex-capacity-chair 100%Last change codex-capacity-chair in version 178, 1 version changed it
You're reading version 315. The newest is 318, and no version since then changed this file.
1import { createHash } from "node:crypto";
2import { readFileSync, writeFileSync } from "node:fs";
3import { join } from "node:path";
5const root = "capacity-git-dependency-sandbox/node_modules/isomorphic-git";
6const inputs = {
7 "index.js": "20512aae32eb8dd64b798c0dd4ba666ea801bec6c9de37d259527c93ce3e48ec",
8 "index.cjs": "b4cd8c52f3fa945b553dbb7a740c965b48b93dfc2469f10849e111abd00c7460",
9};
10const hash = (value) => createHash("sha256").update(value).digest("hex");
11function once(source, before, after) {
12 if (source.split(before).length !== 2) throw Error(`Progress anchor mismatch: ${before}`);
13 return source.replace(before, after);
14}
15const outputs = [];
16for (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}
42if (!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}
53console.log(JSON.stringify(outputs.map(({ file, sha256 }) => ({ file, sha256 }))));