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 242 to 243

Compare

+12 −5 in 4 places
Lines 9–15 at 243 (were 9–15 at 242)
99import { ProjectError } from "./project-error.ts";
1010import type { FileChange, LogAnswer, LogEntry, ShowAnswer } from "./project-types.ts";
1111import { last, SHARED, type Space } from "./spaces.ts";
12−import { changesBetween } from "./view-changes.ts";
12+import { changesBetween, summariesBetween } from "./view-changes.ts";
1313
1414/** What the version list reads need from a project. */
1515export interface LogHost {
Lines 243–252 at 243 (were 243–250 at 242)
243243 host: LogHost,
244244 from: number,
245245 to: number,
246− options: { draft?: string | null; agent?: string } = {},
247−): { from: number; to: number; files: FileChange[] } {
246+ options: { draft?: string | null; agent?: string; summary?: boolean } = {},
247+):
248+ | { from: number; to: number; files: FileChange[] }
249+ | { from: number; to: number; summary: true; files: ReturnType<typeof summariesBetween> } {
248250 host.needInit();
249251 const space = host.spaceFor(options);
250252 host.checkVersion(space, from);
Lines 254–271 at 243 (were 252–264 at 242)
252254 const before = host.viewAt(space, from);
253255 const after = host.viewAt(space, to);
254256 const files = new Set<string>();
257+ // With summary, each file's size and SHA-256 instead of its texts (abso issue 680).
258+ const answer = (paths: Iterable<string>) =>
259+ options.summary
260+ ? { from, to, summary: true as const, files: summariesBetween(before, after, paths) }
261+ : { from, to, files: changesBetween(before, after, paths) };
255262 // A stored writer keeps each shared version's changed files (version-files.ts, abso Capacity): every file that
256263 // differs between two versions changed in one between them, so those lists are the candidates, not every atom
257264 // either set holds.
258265 if (space.name === SHARED && host.graph.packedFiles) {
259266 for (let v = Math.min(from, to) + 1; v <= Math.max(from, to); v++)
260267 for (const file of host.paths.versionFiles(space, v)) files.add(file);
261− return { from, to, files: changesBetween(before, after, files) };
268+ return answer(files);
262269 }
263270 const a = host.at(space, from);
264271 const b = host.at(space, to);
Lines 281–287 at 243 (were 274–280 at 242)
274281 ))
275282 files.add(file);
276283 }
277− return { from, to, files: changesBetween(before, after, files) };
284+ return answer(files);
278285}
279286
280287/** A version of shared (or of a named draft) as a ReadView, for reading lines (blame at a version). */
MCP
compare on this site's /mcp
CLI
abso diff 242 243 worker/project/version-log.ts --json
JSON
/christopher/abso-core/compare/242..243?file=worker%2Fproject%2Fversion-log.ts&format=json