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

Compare

+23 −3 in 3 places
Lines 1–9 at 318 (were 1–6 at 273)
11// What every abso command shares: its output, its environment, the folder it opens, and the news it took.
22
3−import { Api, type News, newsLines, type RunKind } from "./api.ts";
3+import { createHash } from "node:crypto";
4+import { hostname } from "node:os";
5+import { callerHeader } from "../../src/caller.ts";
6+import { Api, type News, newsLines, type RunKind, takeSeatNotices } from "./api.ts";
47import { UsageError } from "./args.ts";
58import { type Config, findRoot, readConfig } from "./config.ts";
69import { newsBlockLines, newsShown } from "./core.ts";
Lines 48–74 at 318 (were 45–54 at 273)
4548 `You're not in an abso folder: ${env.cwd} has no .abso/config.json, nor does any folder above it. abso join <project> makes one, or abso init a new project.`,
4649 );
4750 const config = readConfig(root, env.env, env.tokenFile === true);
48− return { root, config, api: new Api(config) };
51+ const api = new Api(config);
52+ api.caller = callerFor(env.env.CLAUDE_CODE_SESSION_ID, hostname(), root);
53+ return { root, config, api };
4954}
5055
5156/**
57+ * The caller header for this chat, computer and folder. The chat's session id goes as a short SHA-256 of it and the
58+ * folder as its last part, so neither the raw id nor the path (which names the person) leaves the machine.
59+ */
60+export function callerFor(session: string | undefined, machine: string, root: string): string | undefined {
61+ const hashed = session ? createHash("sha256").update(session).digest("hex").slice(0, 16) : undefined;
62+ // The last part on either separator, so a Windows path names its folder on any machine.
63+ const folder =
64+ root
65+ .split(/[\\/]+/)
66+ .filter((p) => p !== "")
67+ .at(-1) ?? "";
68+ return callerHeader({ session: hashed, machine, folder });
69+}
71+/**
5272 * News a command took from the server while recording first. main() prints it
5373 * after whatever the command says, so every command that takes news shows it
5474 * (#37, News Report: sync, run and diff took it, wrote it to .avcs/news.log and
Lines 76–82 at 318 (were 56–62 at 273)
5676 */
5777const takenNews: string[] = [];
5878export function takeNews(): string[] {
59− return takenNews.splice(0);
79+ return [...takeSeatNotices(), ...takenNews.splice(0)];
6080}
6181
6282/** News a record answered with: kept in .avcs/news.log, and printed by main(). */
MCP
compare on this site's /mcp
CLI
abso diff 273 318 client/src/command-env.ts --json
JSON
/christopher/abso-core/compare/273..318?file=client%2Fsrc%2Fcommand-env.ts&format=json