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
MCP
blame on this site's /mcp
CLI
abso blame client/src/command-env.ts --version 282 --json
JSON
/christopher/abso-core/blame/client/src/command-env.ts?version=282&format=json
87 linesFirst import 67% · pinch 16% · groups 7% · speed 7% · readspeed 3%Last change pinch in version 282,

87 lines from 7 changes in 7 versions.

init0Start the project1// What every abso command shares: its output, its environment, the folder it opens, and the news it took.
2
pinch282The caller header carries a short hash of the chat's session and only the folder's last part X-Abso-Caller sent the raw CLAUDE_CODE_SESSION_ID and the full folder path, which names the person (C:\Users\<name>\...). The client now sends the first 16 hex digits of the session id's SHA-256 and the folder's last part. The server already showed only "<folder> on <machine>", and the same chat hashes the same way, so seat notices still tell chats apart. Neither the raw id nor the path leaves the machine. Tests: client caller (6 pass); tsc clean.Compare3import { createHash } from "node:crypto";
groups277Seats say who is calling, and a seat's earlier chat can hear that another chat picked it up. The CLI sends X-Abso-Caller on every call: the chat's session id (CLAUDE_CODE_SESSION_ID, when abso runs in a Claude Code chat), the computer's name and the folder, base64url JSON, at most 512 bytes. A folder that reads signed out sends none. src/caller.ts reads it back exactly or not at all. It's information only; the agent key still decides who is calling. The engine's seatNotice(agent, place, key) queues one fixed-wording news line to that seat, once per key. An answer carrying seatNotice is printed once with the news. Tests: client caller and visitor, worker/project seat-notice, announce-person, news-*, tells (29 pass); tsc clean.Compare4import { hostname } from "node:os";
pinch282The caller header carries a short hash of the chat's session and only the folder's last part X-Abso-Caller sent the raw CLAUDE_CODE_SESSION_ID and the full folder path, which names the person (C:\Users\<name>\...). The client now sends the first 16 hex digits of the session id's SHA-256 and the folder's last part. The server already showed only "<folder> on <machine>", and the same chat hashes the same way, so seat notices still tell chats apart. Neither the raw id nor the path leaves the machine. Tests: client caller (6 pass); tsc clean.Compare5import { basename } from "node:path";
groups277Seats say who is calling, and a seat's earlier chat can hear that another chat picked it up. The CLI sends X-Abso-Caller on every call: the chat's session id (CLAUDE_CODE_SESSION_ID, when abso runs in a Claude Code chat), the computer's name and the folder, base64url JSON, at most 512 bytes. A folder that reads signed out sends none. src/caller.ts reads it back exactly or not at all. It's information only; the agent key still decides who is calling. The engine's seatNotice(agent, place, key) queues one fixed-wording news line to that seat, once per key. An answer carrying seatNotice is printed once with the news. Tests: client caller and visitor, worker/project seat-notice, announce-person, news-*, tells (29 pass); tsc clean.Compare6import { callerHeader } from "../../src/caller.ts";
7import { Api, type News, newsLines, type RunKind, takeSeatNotices } from "./api.ts";
init0Start the project8import { UsageError } from "./args.ts";
9import { type Config, findRoot, readConfig } from "./config.ts";
pinch33Client: a tell reads as who told you and how sure that is, with what was said on the lines below: "ann (as claimed) told you:", "Robin (a person) told you:", "ann (checked) told you:" for an agent with a key of its own. A person's words are unquoted and their id is left out (news.log keeps the sentence whole). Tells are never cut in an agent's context, and later lines are indented everywhere news is printed (news, the News: block, the edit hook). What the server stores is unchanged. Client tests 273/273, tsc and biome clean.Compare10import { newsBlockLines, newsShown } from "./core.ts";
init0Start the project11import { logNews } from "./folder.ts";
13export const EXIT = { ok: 0, error: 1, refused: 2 } as const;
15export interface Output {
16 readonly text: string;
17 readonly json: Record<string, unknown>;
18 readonly exit?: number;
21export interface Env {
22 readonly cwd: string;
23 readonly env: Readonly<Record<string, string | undefined>>;
24 /** Where `run` streams the box's output as it arrives. */
25 readonly write: (text: string) => void;
readspeed271No command picks up a credential from a file nobody asked for Follows "abso init signs in with the box sign-in" (issue 25), and applies it to every command. - A folder with a key signs in with that key and nothing else: not ABSO_TOKEN, not ~/.abso/token, even when the server refuses the key. A key file that can't be read is now an error ("abso key install puts a key back") instead of a quiet fall back to another credential. - With no key, a command signs in with ABSO_TOKEN (or a pipeline run's ABSO_KEY_FILE). This machine's ~/.abso/token is used only by a command given --token-file, which every command that talks to a server now takes. Without it, a refused call says "You're not signed in. Run abso login, then abso join <project>. ~/.abso/token is used only with --token-file." abso doctor says the same about a token file it finds unused. The edit hook and MCP tools never read it. - The admin token (ABSO_ADMIN_TOKEN, or ~/.abso/admin-token) is read only by abso key and abso flag. Each says "Using the admin token, from ..." every time it uses it. A test holds that no other module reads the file. What changes for you: a folder with no key that relied on ~/.abso/token needs --token-file on each command, or ABSO_TOKEN, or a key (abso login, then abso join). Tests: client/test/token-file.test.ts (3, new); client/test/client.test.ts's MCP check covers --token-file. All client tests pass (443).Compare26 /** --token-file: this machine's ~/.abso/token may sign in, where nothing else does. Never read otherwise. */
27 readonly tokenFile?: boolean;
init0Start the project28 /** Where `run` streams the box's stderr; `write` when not given. */
29 readonly writeErr?: (text: string) => void;
30 /** What a box run is for, when a command runs one for its own ends (shot, bisect, publish --check). */
31 readonly runKind?: RunKind;
32 /** What a -file flag of - reads: stdin, unless a test gives it. */
33 readonly readStdin?: () => string;
speed155Every command that talks to a server now takes --server <url>, parsed and checked in one place (client/src/server-choice.ts). A missing, empty or malformed value is refused before anything is sent. In a joined folder, --server must be the folder's own server: another one is refused rather than swapped in, so a folder's work and key go only to the server it was joined on. Commands that pick their own server (join, init, login, whoami, doctor, box, logout, orgs, org, key) use the named one as given; doctor no longer swaps in the folder's server over an explicit one, and an explicit --server takes issues to that server's own Issues Worker instead of ABSO_ISSUES_SERVER. The five local-only commands refuse --server and say why. Help shows the same --server line for every command of a kind. For abso-core issue 10.Compare34 /**
35 * The server --server named, checked (server-choice.ts), when the command was given one. It is used as given,
36 * so no environment setting redirects it (ABSO_ISSUES_SERVER included).
37 */
38 readonly server?: string;
init0Start the project39}
41export function plural(n: number, word: string): string {
42 return `${n} ${word}${n === 1 ? "" : "s"}`;
45export function open(env: Env): { root: string; config: Config; api: Api } {
46 const root = findRoot(env.cwd);
47 if (root === undefined)
48 throw new UsageError(
speed76abso whoami and abso doctor, and plainer errors. - abso whoami: this box's sign-in as the server sees it (a revoked one shows as revoked), its projects, roles and expiry, and this folder's project, agent and kind of key. It names who approved the box when the server says. - abso doctor: one line per check, ok, fail or skip: Node's version (20 or later for the npm package, 24 for a checkout), that the server answers, this box's sign-in (present, unexpired, accepted), and this folder's key against its project (a GET of the project's head, which the server answers only after checking the key). A failed check gives the next step, and the exit is 1. - Neither prints a credential. Both are MCP tools too. - The commonest failures now say what to do: a 401 with no credential reads 'You're not signed in. Run abso login, then abso join <project>.'; a refused key points to abso doctor; a server that can't be reached reads 'Can't reach <server>...' with the next step, unless the message already gives one; and outside a folder, 'You're not in an abso folder' says how to make one.Compare49 `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.`,
init0Start the project50 );
readspeed271No command picks up a credential from a file nobody asked for Follows "abso init signs in with the box sign-in" (issue 25), and applies it to every command. - A folder with a key signs in with that key and nothing else: not ABSO_TOKEN, not ~/.abso/token, even when the server refuses the key. A key file that can't be read is now an error ("abso key install puts a key back") instead of a quiet fall back to another credential. - With no key, a command signs in with ABSO_TOKEN (or a pipeline run's ABSO_KEY_FILE). This machine's ~/.abso/token is used only by a command given --token-file, which every command that talks to a server now takes. Without it, a refused call says "You're not signed in. Run abso login, then abso join <project>. ~/.abso/token is used only with --token-file." abso doctor says the same about a token file it finds unused. The edit hook and MCP tools never read it. - The admin token (ABSO_ADMIN_TOKEN, or ~/.abso/admin-token) is read only by abso key and abso flag. Each says "Using the admin token, from ..." every time it uses it. A test holds that no other module reads the file. What changes for you: a folder with no key that relied on ~/.abso/token needs --token-file on each command, or ABSO_TOKEN, or a key (abso login, then abso join). Tests: client/test/token-file.test.ts (3, new); client/test/client.test.ts's MCP check covers --token-file. All client tests pass (443).Compare51 const config = readConfig(root, env.env, env.tokenFile === true);
groups277Seats say who is calling, and a seat's earlier chat can hear that another chat picked it up. The CLI sends X-Abso-Caller on every call: the chat's session id (CLAUDE_CODE_SESSION_ID, when abso runs in a Claude Code chat), the computer's name and the folder, base64url JSON, at most 512 bytes. A folder that reads signed out sends none. src/caller.ts reads it back exactly or not at all. It's information only; the agent key still decides who is calling. The engine's seatNotice(agent, place, key) queues one fixed-wording news line to that seat, once per key. An answer carrying seatNotice is printed once with the news. Tests: client caller and visitor, worker/project seat-notice, announce-person, news-*, tells (29 pass); tsc clean.Compare52 const api = new Api(config);
pinch282The caller header carries a short hash of the chat's session and only the folder's last part X-Abso-Caller sent the raw CLAUDE_CODE_SESSION_ID and the full folder path, which names the person (C:\Users\<name>\...). The client now sends the first 16 hex digits of the session id's SHA-256 and the folder's last part. The server already showed only "<folder> on <machine>", and the same chat hashes the same way, so seat notices still tell chats apart. Neither the raw id nor the path leaves the machine. Tests: client caller (6 pass); tsc clean.Compare53 api.caller = callerFor(env.env.CLAUDE_CODE_SESSION_ID, hostname(), root);
groups277Seats say who is calling, and a seat's earlier chat can hear that another chat picked it up. The CLI sends X-Abso-Caller on every call: the chat's session id (CLAUDE_CODE_SESSION_ID, when abso runs in a Claude Code chat), the computer's name and the folder, base64url JSON, at most 512 bytes. A folder that reads signed out sends none. src/caller.ts reads it back exactly or not at all. It's information only; the agent key still decides who is calling. The engine's seatNotice(agent, place, key) queues one fixed-wording news line to that seat, once per key. An answer carrying seatNotice is printed once with the news. Tests: client caller and visitor, worker/project seat-notice, announce-person, news-*, tells (29 pass); tsc clean.Compare54 return { root, config, api };
pinch282The caller header carries a short hash of the chat's session and only the folder's last part X-Abso-Caller sent the raw CLAUDE_CODE_SESSION_ID and the full folder path, which names the person (C:\Users\<name>\...). The client now sends the first 16 hex digits of the session id's SHA-256 and the folder's last part. The server already showed only "<folder> on <machine>", and the same chat hashes the same way, so seat notices still tell chats apart. Neither the raw id nor the path leaves the machine. Tests: client caller (6 pass); tsc clean.Compare55}
57/**
58 * The caller header for this chat, computer and folder. The chat's session id goes as a short SHA-256 of it and the
59 * folder as its last part, so neither the raw id nor the path (which names the person) leaves the machine.
60 */
61export function callerFor(session: string | undefined, machine: string, root: string): string | undefined {
62 const hashed = session ? createHash("sha256").update(session).digest("hex").slice(0, 16) : undefined;
63 return callerHeader({ session: hashed, machine, folder: basename(root) });
init0Start the project64}
66/**
67 * News a command took from the server while recording first. main() prints it
68 * after whatever the command says, so every command that takes news shows it
69 * (#37, News Report: sync, run and diff took it, wrote it to .avcs/news.log and
70 * printed nothing; 94 of the game's 613 items, 54 of them announcements).
71 */
72const takenNews: string[] = [];
73export function takeNews(): string[] {
groups277Seats say who is calling, and a seat's earlier chat can hear that another chat picked it up. The CLI sends X-Abso-Caller on every call: the chat's session id (CLAUDE_CODE_SESSION_ID, when abso runs in a Claude Code chat), the computer's name and the folder, base64url JSON, at most 512 bytes. A folder that reads signed out sends none. src/caller.ts reads it back exactly or not at all. It's information only; the agent key still decides who is calling. The engine's seatNotice(agent, place, key) queues one fixed-wording news line to that seat, once per key. An answer carrying seatNotice is printed once with the news. Tests: client caller and visitor, worker/project seat-notice, announce-person, news-*, tells (29 pass); tsc clean.Compare74 return [...takeSeatNotices(), ...takenNews.splice(0)];
init0Start the project75}
77/** News a record answered with: kept in .avcs/news.log, and printed by main(). */
78export function heard(root: string, news: News | undefined): void {
79 const lines = newsLines(news);
80 logNews(root, lines);
81 takenNews.push(...lines);
84export function newsText(news: News): string[] {
85 const lines = newsLines(news);
pinch33Client: a tell reads as who told you and how sure that is, with what was said on the lines below: "ann (as claimed) told you:", "Robin (a person) told you:", "ann (checked) told you:" for an agent with a key of its own. A person's words are unquoted and their id is left out (news.log keeps the sentence whole). Tells are never cut in an agent's context, and later lines are indented everywhere news is printed (news, the News: block, the edit hook). What the server stores is unchanged. Client tests 273/273, tsc and biome clean.Compare86 return newsBlockLines(lines.map((n) => newsShown(n)));
init0Start the project87}