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 72 to 73

Compare

+18 −0 in 9 places
Lines 1–8 at 73 (were 1–6 at 72)
11// The JSON routes of the contract (docs/v2-slice1.md), as a pure function of
22// the project calls, so they can be tested in Node without a Worker.
3+
34import type { EditBody, ProjectCalls, ProjectHistory } from "./project-api.ts";
5+import { unseenError } from "./unseen.ts";
46
57export interface Answer {
68 status: number;
Lines 431–438 at 73 (were 429–434 at 72)
429431 case "publish": {
430432 const message = (body as { message?: string })?.message;
431433 if (typeof message !== "string" || !message.trim()) return fail(400, "publish needs {message} saying why");
434+ const unseen = unseenError("the message", message);
435+ if (unseen) return fail(400, unseen);
432436 // asIs (#37): publish even with collided lines untouched since the sync, both sides kept.
433437 return { status: 200, body: project.publish(agent, message, (body as { asIs?: unknown }).asIs === true) };
434438 }
Lines 470–477 at 73 (were 466–471 at 72)
466470 case "land": {
467471 const message = (body as { message?: string })?.message;
468472 if (typeof message !== "string" || !message.trim()) return fail(400, "land needs {message} saying why");
473+ const unseen = unseenError("the message", message);
474+ if (unseen) return fail(400, unseen);
469475 return { status: 200, body: project.land(agent, message) };
470476 }
471477 case "draft-sync":
Lines 497–504 at 73 (were 491–496 at 72)
491497 if (!history.amend) return fail(501, "amend needs the engine");
492498 const message = (body as { message?: unknown } | undefined)?.message;
493499 if (typeof message !== "string" || !message.trim()) return fail(400, "amend needs {message}");
500+ const unseen = unseenError("the message", message);
501+ if (unseen) return fail(400, unseen);
494502 return { status: 200, body: history.amend(agent, message) };
495503 }
496504 // Pluck (#27): take some versions of a named draft into shared.
Lines 515–522 at 73 (were 507–512 at 72)
507515 if (!Array.isArray(b.versions) || b.versions.length === 0 || !b.versions.every((v) => Number.isInteger(v)))
508516 return fail(400, "pluck needs {versions: [number]}");
509517 if (typeof b.message !== "string" || !b.message.trim()) return fail(400, "pluck needs {message} saying why");
518+ const unseen = unseenError("the message", b.message);
519+ if (unseen) return fail(400, unseen);
510520 return {
511521 status: 200,
512522 body: history.pluck(agent, b.draft, b.versions as number[], b.message, b.withDependencies === true),
Lines 530–537 at 73 (were 520–525 at 72)
520530 if (!Array.isArray(b.versions) || b.versions.length === 0 || !b.versions.every((v) => Number.isInteger(v)))
521531 return fail(400, "drop needs {versions: [number], message}");
522532 if (typeof b.message !== "string" || !b.message.trim()) return fail(400, "drop needs {message} saying why");
533+ const unseen = unseenError("the message", b.message);
534+ if (unseen) return fail(400, unseen);
523535 return { status: 200, body: history.drop(agent, b.versions as number[], b.message, b.withDependents === true) };
524536 }
525537 // Announcements, and news without an edit.
Lines 549–556 at 73 (were 537–542 at 72)
537549 if (!history.note || !history.closeNote) return fail(501, `${op} needs the engine`);
538550 const b = (body ?? {}) as Record<string, unknown>;
539551 if (op === "note-close") return { status: 200, body: history.closeNote(agent, b.id as number, b.how) };
552+ const unseen = unseenError("the note", b.text);
553+ if (unseen) return fail(400, unseen);
540554 return { status: 200, body: history.note(agent, b) };
541555 }
542556 case "announce":
Lines 560–567 at 73 (were 546–551 at 72)
546560 if (op === "news") return { status: 200, body: history.news(agent) };
547561 const b = (body ?? {}) as { text?: unknown; to?: unknown };
548562 if (typeof b.text !== "string" || !b.text.trim()) return fail(400, "announce needs {text}");
563+ const unseen = unseenError("the text", b.text);
564+ if (unseen) return fail(400, unseen);
549565 if (b.to !== undefined && (!Array.isArray(b.to) || !b.to.every((a) => typeof a === "string")))
550566 return fail(400, "to must be a list of agent names");
551567 return { status: 200, body: history.announce(agent, b.text, b.to as string[] | undefined, how) };
Lines 573–580 at 73 (were 557–562 at 72)
557573 const b = (body ?? {}) as { text?: unknown; files?: unknown; issue?: unknown; done?: unknown };
558574 if (b.text !== null && (typeof b.text !== "string" || !b.text.trim()))
559575 return fail(400, "starting needs {text}, or {text: null} to take it back");
576+ const unseen = unseenError("the note", b.text);
577+ if (unseen) return fail(400, unseen);
560578 if (b.files !== undefined && (!Array.isArray(b.files) || !b.files.every((f) => typeof f === "string")))
561579 return fail(400, "files must be a list of paths");
562580 // issue (#54): the issue the note works on; done: a take-back because the work is finished, closing it.
MCP
compare on this site's /mcp
CLI
abso diff 72 73 worker/project/http.ts --json
JSON
/christopher/abso-core/compare/72..73?file=worker%2Fproject%2Fhttp.ts&format=json