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

+54 −9 in 7 places
Lines 1–19 at 318 (were 1–10 at 0)
11// What the project looks like now: status, the paths in a folder, and the labels. They read through
22// SnapshotHost; today the host is the project in memory.
33
4−import type { AtomId, View } from "../../src/engine/index.ts";
4+import type { AtomId, ReadView } from "../../src/engine/index.ts";
55import { ProjectError } from "./project-error.ts";
6−import { countRefusals } from "./project-helpers.ts";
7−import type { AgentState, AgentStatus, EditsVia, Refusal, Starting, StatusAnswer } from "./project-types.ts";
6+import { countRefusals, type projectFileIn } from "./project-helpers.ts";
7+import type {
8+ AgentState,
9+ AgentStatus,
10+ EditsVia,
11+ Refusal,
12+ Starting,
13+ StatusAnswer,
14+ TellRecord,
15+ TellStatus,
16+} from "./project-types.ts";
817import { last, SHARED, type Space, sharedBaseOf } from "./spaces.ts";
1019/** What the snapshot reads need from a project. */
Lines 23–29 at 318 (were 14–19 at 0)
1423 queue(): readonly { readonly agent: string; readonly id: number }[];
1524 readonly refusals: readonly Refusal[];
1625 readonly labels: ReadonlyMap<string, readonly number[]>;
26+ readonly tells: ReadonlyMap<number, TellRecord>;
1727 needInit(): void;
1828 shared(): Space;
1929 draft(agent: AgentState): AtomId[];
Lines 39–66 at 318 (were 29–40 at 0)
2939 setOf(space: Space): ReadonlySet<AtomId>;
3040 spaceNamed(name: string | null): Space;
3141 checkVersion(space: Space, version: number): void;
32− viewAt(space: Space, version: number): View;
33− agentView(agent: AgentState): View;
42+ viewAt(space: Space, version: number): ReadView;
43+ /** A version's file list from kept version shapes, when every version up to it has one (pathindex.ts). */
44+ keptPaths?(space: Space, version: number): string[] | undefined;
45+ agentView(agent: AgentState): ReadView;
3446 version(): number;
47+ /** Shared's project file (224), or undefined before init or without one. */
48+ projectFile(): ReturnType<typeof projectFileIn>;
3549}
3650
3751/**
52+ * An agent with nothing of its own sees exactly its base version, so its paths are that version's kept file list
53+ * (pathindex.ts), when there is one: no layout of every known file (abso - Performance, abso 711).
54+ */
55+function viewPaths(host: SnapshotHost, agent: AgentState): string[] {
56+ const kept =
57+ agent.mine.length === 0
58+ ? host.keptPaths?.(host.spaceNamed(agent.space === SHARED ? null : agent.space), agent.base)
59+ : undefined;
60+ return kept ?? host.agentView(agent).paths();
61+}
63+/**
3864 * The paths in an agent's view now (#37): what its folder should hold.
3965 * Reading it changes nothing. Binary files are included.
4066 */
Lines 74–80 at 318 (were 48–54 at 0)
4874 return {
4975 version: agent.base,
5076 draft: agent.space === SHARED ? null : agent.space,
51− files: host.agentView(agent).paths(),
77+ files: viewPaths(host, agent),
5278 };
5379}
5480
Lines 88–94 at 318 (were 62–68 at 0)
6288 const space = host.spaceNamed(draft);
6389 const v = version ?? last(space);
6490 host.checkVersion(space, v);
65− return { version: v, draft, files: host.viewAt(space, v).paths() };
91+ return { version: v, draft, files: host.keptPaths?.(space, v) ?? host.viewAt(space, v).paths() };
6692}
6793
6894/**
Lines 106–112 at 318 (were 80–86 at 0)
80106 agent: agent.name,
81107 version: agent.base,
82108 draft: agent.space === SHARED ? null : agent.space,
83− files: host.agentView(agent).paths(),
109+ files: viewPaths(host, agent),
84110 };
85111}
86112
Lines 169–192 at 318 (were 143–147 at 0)
143169 }
144170 }
145171 const announcements = [...waiting].map(([text, names]) => ({ text, waiting: names }));
146− return { version: host.version(), agents, drafts, refusals: countRefusals(host.refusals), announcements };
172+ // Who has heard each of the newest tells, and when (277): the news and heard entries' times.
173+ const tells: TellStatus[] = [...host.tells.values()].toReversed().map((t) => ({
174+ id: t.id,
175+ text: t.text,
176+ at: t.at ?? null,
177+ to: [...t.heard]
178+ .toSorted(([a], [b]) => (a < b ? -1 : 1))
179+ .map(([agent, h]) => ({ agent, heard: h !== null, at: h?.at ?? null })),
180+ }));
181+ // Both project files in shared (224): say which one counts, never quietly.
182+ const file = host.projectFile();
183+ return {
184+ version: host.version(),
185+ agents,
186+ drafts,
187+ refusals: countRefusals(host.refusals),
188+ announcements,
189+ tells,
190+ ...(file?.ignored ? { projectFile: { used: "abso.json" as const, ignored: file.ignored } } : {}),
191+ };
147192}
MCP
compare on this site's /mcp
CLI
abso diff 0 318 worker/project/project-status.ts --json
JSON
/christopher/abso-core/compare/0..318?file=worker%2Fproject%2Fproject-status.ts&format=json