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 222 to 223

Compare

+64 −0 in 1 place
Lines 35–105 at 223 (were 35–41 at 222)
3535 ].join("\n");
3636}
3737
38+/** One held push in the history, as the server answers it. */
39+interface HistoryHold {
40+ readonly id: number;
41+ readonly time: string;
42+ readonly agent: string;
43+ readonly message: string;
44+ readonly mode: AutosettleMode;
45+ readonly at: number;
46+ readonly collisions: readonly {
47+ readonly file: string;
48+ readonly theirs: { readonly agent: string; readonly version?: number };
49+ readonly advice: {
50+ readonly pick: string;
51+ readonly confidence: number;
52+ readonly by: string;
53+ readonly reason: string;
54+ };
55+ readonly settled: boolean;
56+ readonly outcome: { readonly kept: string; readonly auto: boolean; readonly version?: number } | null;
57+ readonly calls?: readonly { readonly model: string; readonly input: unknown; readonly output: unknown }[];
58+ }[];
59+}
61+/** A held push in a few lines: what the model said, and what was then kept. */
62+export function holdWords(h: HistoryHold): string {
63+ return [
64+ `${h.id}: ${h.agent}, ${h.time}, under ${h.mode}${h.mode === "settle" ? ` at ${h.at.toFixed(2)}` : ""}: "${h.message.split(/\r?\n/)[0]}"`,
65+ ...h.collisions.map((c) => {
66+ const said = `${c.advice.pick === "agent" ? "leave it to an agent" : `keep ${c.advice.pick}`} (${c.advice.by === "rule" ? "a check in code" : `${c.advice.by}, ${c.advice.confidence.toFixed(2)}`})`;
67+ const then = c.outcome
68+ ? `kept ${c.outcome.kept}${c.outcome.auto ? " automatically" : " by hand"}${c.outcome.version !== undefined ? ` in version ${c.outcome.version}` : ""}`
69+ : "not settled yet";
70+ return ` ${c.file}, against ${c.theirs.agent}${c.theirs.version !== undefined ? `'s version ${c.theirs.version}` : ""}: advised ${said}${c.settled ? ", told to settle" : ""}; ${then}.`;
71+ }),
72+ ].join("\n");
73+}
75+/** abso autosettle history [<id>]: the held pushes the model advised on, newest first, or one with its calls. */
76+async function runHistory(args: Parsed, env: Env): Promise<Output> {
77+ const { api } = open(env);
78+ const id = args.positionals[1];
79+ if (id !== undefined) {
80+ if (!/^[0-9]{1,9}$/.test(id)) throw new UsageError("abso autosettle history <id> takes a hold's number");
81+ const hold = (await api.autosettleHold(Number(id))) as HistoryHold;
82+ const calls = hold.collisions.flatMap((c) => (c.calls ?? []).map((k) => ` ${c.file}: ${k.model}`));
83+ return {
84+ text: [holdWords(hold), "Calls to the model (--json has each request and answer):", ...calls].join("\n"),
85+ json: { ...hold },
86+ };
87+ }
88+ const page = (await api.autosettleHistory()) as { holds: HistoryHold[]; next?: number };
89+ return {
90+ text:
91+ page.holds.length === 0
92+ ? "No held push has had advice in this project yet."
93+ : page.holds.map(holdWords).join("\n"),
94+ json: { ...page },
95+ };
96+}
3898export async function runAutosettle(args: Parsed, env: Env): Promise<Output> {
99+ if (args.positionals[0] === "history") {
100+ if (args.positionals.length > 2) throw new UsageError("abso autosettle history takes at most a hold's number");
101+ return runHistory(args, env);
102+ }
39103 if (args.positionals.length > 1) throw new UsageError("autosettle takes at most one word: off, advise or settle");
40104 const want = args.positionals[0];
41105 const atRaw = str(args, "at");
MCP
compare on this site's /mcp
CLI
abso diff 222 223 client/src/autosettle-commands.ts --json
JSON
/christopher/abso-core/compare/222..223?file=client%2Fsrc%2Fautosettle-commands.ts&format=json