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

Compare

+13 −6 in 3 places
Lines 1–7 at 318 (were 1–7 at 4)
11// Discard unpublished changes to some files, like git restore. Writes go through RestoreHost;
22// today the host is Project.
33
4−import type { AtomId, Graph, Hunk, View } from "../../src/engine/index.ts";
4+import type { AtomId, Graph, Hunk, ReadView } from "../../src/engine/index.ts";
55import { checkReadPath } from "./path-rules.ts";
66import { ProjectError } from "./project-error.ts";
77import type { AgentState, Blobs, Entry, Files, Meta, Mode, Modes, RestoreAnswer } from "./project-types.ts";
Lines 11–25 at 318 (were 11–24 at 4)
1111 readonly graph: Graph;
1212 agent(name: string, entries: Entry[]): AgentState;
1313 draft(agent: AgentState): AtomId[];
14− touchedFiles(ids: Iterable<AtomId>, views: readonly View[]): Set<string>;
14+ touchedFiles(ids: Iterable<AtomId>, views: readonly ReadView[]): Set<string>;
1515 apply(entry: Entry): void;
16− view(set: ReadonlySet<AtomId>): View;
16+ view(set: ReadonlySet<AtomId>): ReadView;
1717 agentSet(agent: AgentState): Set<AtomId>;
18− agentView(agent: AgentState): View;
18+ agentView(agent: AgentState): ReadView;
19+ agentViewWithout?(agent: AgentState, excluded: ReadonlySet<AtomId>): ReadView;
1920 recordFile(
2021 agent: AgentState,
21− view: View,
22+ view: ReadView,
2223 path: string,
2324 text: string | null | undefined,
2425 time: number,
Lines 65–79 at 318 (were 64–72 at 4)
6465 // Whatever is still changed in a target goes back with a new change.
6566 const now = host.draft(agent);
6667 const without = new Set(now);
67− const original = host.view(new Set([...host.agentSet(agent)].filter((id) => !without.has(id))));
68+ const originalAgent = { ...agent, mine: [...agent.mine] };
69+ const originalView = () =>
70+ host.agentViewWithout
71+ ? host.agentViewWithout(originalAgent, without)
72+ : host.view(new Set([...host.agentSet(originalAgent)].filter((id) => !without.has(id))));
6873 for (const path of [...targets].toSorted()) {
6974 if (!touched.has(path)) continue;
75+ // A previous file may have mutated the graph. Reopen the same base view.
76+ const original = originalView();
7077 const was = original.attrs(path);
7178 host.recordFile(
7279 agent,
MCP
compare on this site's /mcp
CLI
abso diff 4 318 worker/project/restore.ts --json
JSON
/christopher/abso-core/compare/4..318?file=worker%2Fproject%2Frestore.ts&format=json