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 162 to 163

Compare

+7 −3 in 4 places
Lines 3–8 at 163 (were 3–9 at 162)
33// SyncHost; today the host is Project.
44
55import type { AtomId, Graph, ReadView } from "../../src/engine/index.ts";
6−import { outlastsSync } from "./news.ts";
76import { ProjectError } from "./project-error.ts";
87import type { AgentState, Entry, MergedLine, SyncAnswer } from "./project-types.ts";
98import { last, SHARED, type Space } from "./spaces.ts";
Lines 14–20 at 163 (were 15–20 at 162)
1514 agent(name: string, entries: Entry[]): AgentState;
1615 spaceOf(agent: AgentState): Space;
1716 agentView(agent: AgentState): ReadView;
17+ captureAgentView?(agent: AgentState): () => ReadView;
1818 at(space: Space, version: number): ReadonlySet<AtomId>;
1919 draft(agent: AgentState): AtomId[];
2020 strandedFiles(draft: readonly AtomId[], set: ReadonlySet<AtomId>): string[];
Lines 51–57 at 163 (were 51–56 at 162)
5151 throw new ProjectError("bad-request", `no version of shared has the label ${JSON.stringify(options.label)}`);
5252 target = versions[versions.length - 1]!;
5353 }
54+ const reopenBefore = agent.synced ? host.captureAgentView?.(agent) : undefined;
5455 const before = agent.synced ? host.agentView(agent) : new View(host.graph, []);
5556 const set = host.at(space, target);
5657 const stranded = host.strandedFiles(host.draft(agent), set);
Lines 81–97 at 163 (were 80–93 at 162)
8081 entries.push({ type: "sync", agent: agent.name, version: target });
8182 host.apply(entries[entries.length - 1]!);
8283 // News about versions the agent has now synced past is moot: the sync answer lists what's still open (#37).
83− if (agent.news.some((t) => !outlastsSync(t))) {
84+ if (agent.news.some((t) => !t.startsWith("Announcement from "))) {
8485 const heard: Entry = { type: "heard", agent: agent.name, stale: true };
8586 entries.push(heard);
8687 host.apply(heard);
8788 }
8889 const merged = host.mergeIdentical(agent, before, oldBase, oldVersion, Date.now(), entries);
8990 // full (#37, a partial join): every file in the view, as for a first sync, whatever the folder had.
90− const answer = host.changesSince(agent, options.full ? new View(host.graph, []) : before);
91+ const answer = host.changesSince(
92+ agent,
93+ options.full ? new View(host.graph, []) : reopenBefore ? reopenBefore() : before,
94+ );
9195 host.flush(entries);
9296 return merged.length > 0 ? { ...answer, merged } : answer;
9397}
MCP
compare on this site's /mcp
CLI
abso diff 162 163 worker/project/sync.ts --json
JSON
/christopher/abso-core/compare/162..163?file=worker%2Fproject%2Fsync.ts&format=json