- MCP
- blame on this site's /mcp
- CLI
- abso blame client/src/command-env.ts --version 271 --json
- JSON
- /christopher/abso-core/blame/client/src/command-env.ts?version=271&format=json
72 linesFirst import 85% · speed 8% · readspeed 4% · pinch 3%Last change readspeed in version 271,
72 lines from 5 changes in 5 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;
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).Compare22 /** --token-file: this machine's ~/.abso/token may sign in, where nothing else does. Never read otherwise. */
23 readonly tokenFile?: boolean;
25 readonly writeErr?: (text: string) => void;
26 /** What a box run is for, when a command runs one for its own ends (shot, bisect, publish --check). */
27 readonly runKind?: RunKind;
28 /** What a -file flag of - reads: stdin, unless a test gives it. */
29 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.Compare30 /**
31 * The server --server named, checked (server-choice.ts), when the command was given one. It is used as given,
32 * so no environment setting redirects it (ABSO_ISSUES_SERVER included).
33 */
34 readonly server?: string;
37export function plural(n: number, word: string): string {
38 return `${n} ${word}${n === 1 ? "" : "s"}`;
39}
41export function open(env: Env): { root: string; config: Config; api: Api } {
42 const root = findRoot(env.cwd);
43 if (root === undefined)
44 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.Compare45 `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.`,
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).Compare47 const config = readConfig(root, env.env, env.tokenFile === true);
49}
51/**
52 * News a command took from the server while recording first. main() prints it
53 * after whatever the command says, so every command that takes news shows it
54 * (#37, News Report: sync, run and diff took it, wrote it to .avcs/news.log and
55 * printed nothing; 94 of the game's 613 items, 54 of them announcements).
56 */
57const takenNews: string[] = [];
58export function takeNews(): string[] {
59 return takenNews.splice(0);
60}
62/** News a record answered with: kept in .avcs/news.log, and printed by main(). */
63export function heard(root: string, news: News | undefined): void {
64 const lines = newsLines(news);
65 logNews(root, lines);
66 takenNews.push(...lines);
67}
69export function newsText(news: News): string[] {
70 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.Compare71 return newsBlockLines(lines.map((n) => newsShown(n)));