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

Compare

+4 −4 in 4 places
Lines 7–14 at 318 (were 7–14 at 0)
77import { createHash } from "node:crypto";
88import { readFileSync, statSync } from "node:fs";
99import { join } from "node:path";
10−import { AVCS_DIR } from "./config.ts";
1110import { writeFileAtomic } from "./folder.ts";
11+import { stateDir } from "./state-dir.ts";
1212
1313/** The server's limit for one file's bytes. */
1414export const MAX_BLOB_BYTES = 20 * 1024 * 1024;
Lines 21–27 at 318 (were 21–27 at 0)
2121
2222/**
2323 * Whether normalized text is the file the server keeps whole under `sha`
24− * (#46): a text file matching avcs.json's "whole", or over 1 MB, is stored
24+ * (#46): a text file matching abso.json's "whole", or over 1 MB, is stored
2525 * like a binary file, by the hash of its text with LF endings. The client
2626 * keeps that hash in blobs.json, and the file on disk stays text.
2727 */
Lines 47–53 at 318 (were 47–53 at 0)
4747export function readKnownBlobs(root: string): Map<string, string> {
4848 try {
4949 return new Map(
50− Object.entries(JSON.parse(readFileSync(join(root, AVCS_DIR, BLOBS_FILE), "utf8")) as Record<string, string>),
50+ Object.entries(JSON.parse(readFileSync(join(stateDir(root), BLOBS_FILE), "utf8")) as Record<string, string>),
5151 );
5252 } catch {
5353 return new Map();
Lines 56–62 at 318 (were 56–62 at 0)
5656
5757export function writeKnownBlobs(root: string, blobs: ReadonlyMap<string, string>): void {
5858 const sorted = Object.fromEntries([...blobs].sort(([a], [b]) => (a < b ? -1 : a > b ? 1 : 0)));
59− writeFileAtomic(join(root, AVCS_DIR, BLOBS_FILE), `${JSON.stringify(sorted, null, 1)}\n`);
59+ writeFileAtomic(join(stateDir(root), BLOBS_FILE), `${JSON.stringify(sorted, null, 1)}\n`);
6060}
6161
6262/** Short form of a hash for people: the first 12 hex digits. */
MCP
compare on this site's /mcp
CLI
abso diff 0 318 client/src/blobs.ts --json
JSON
/christopher/abso-core/compare/0..318?file=client%2Fsrc%2Fblobs.ts&format=json