- MCP
- blame on this site's /mcp
- CLI
- abso blame client/src/command-env.ts --version 261 --json
- JSON
- /christopher/abso-core/blame/client/src/command-env.ts?version=261&format=json
70 linesFirst import 89% · speed 9% · pinch 3%Last change speed in version 155,
70 lines from 4 changes in 4 versions.
init0Start the project1// What every abso command shares: its output, its environment, the folder it opens, and the news it took.
3import { Api, type News, newsLines, type RunKind } from "./api.ts";
4import { UsageError } from "./args.ts";
5import { 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.Compare6import { newsBlockLines, newsShown } from "./core.ts";
9export const EXIT = { ok: 0, error: 1, refused: 2 } as const;
11export interface Output {
12 readonly text: string;
13 readonly json: Record<string, unknown>;
14 readonly exit?: number;
15}
17export interface Env {
18 readonly cwd: string;
19 readonly env: Readonly<Record<string, string | undefined>>;
20 /** Where `run` streams the box's output as it arrives. */
21 readonly write: (text: string) => void;
22 /** Where `run` streams the box's stderr; `write` when not given. */
23 readonly writeErr?: (text: string) => void;
24 /** What a box run is for, when a command runs one for its own ends (shot, bisect, publish --check). */
25 readonly runKind?: RunKind;
26 /** What a -file flag of - reads: stdin, unless a test gives it. */
27 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.Compare28 /**
29 * The server --server named, checked (server-choice.ts), when the command was given one. It is used as given,
30 * so no environment setting redirects it (ABSO_ISSUES_SERVER included).
31 */
32 readonly server?: string;
35export function plural(n: number, word: string): string {
36 return `${n} ${word}${n === 1 ? "" : "s"}`;
37}
39export function open(env: Env): { root: string; config: Config; api: Api } {
40 const root = findRoot(env.cwd);
41 if (root === undefined)
42 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.Compare43 `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.`,
45 const config = readConfig(root, env.env);
46 return { root, config, api: new Api(config) };
47}
49/**
50 * News a command took from the server while recording first. main() prints it
51 * after whatever the command says, so every command that takes news shows it
52 * (#37, News Report: sync, run and diff took it, wrote it to .avcs/news.log and
53 * printed nothing; 94 of the game's 613 items, 54 of them announcements).
54 */
55const takenNews: string[] = [];
56export function takeNews(): string[] {
57 return takenNews.splice(0);
58}
60/** News a record answered with: kept in .avcs/news.log, and printed by main(). */
61export function heard(root: string, news: News | undefined): void {
62 const lines = newsLines(news);
63 logNews(root, lines);
64 takenNews.push(...lines);
65}
67export function newsText(news: News): string[] {
68 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.Compare69 return newsBlockLines(lines.map((n) => newsShown(n)));