- MCP
- blame on this site's /mcp
- CLI
- abso blame client/test/doctor.test.ts --json
- JSON
- /christopher/abso-core/blame/client/test/doctor.test.ts?format=json
249 linesspeed 94% · pinch 4% · open 1% · rename 1%Last change pinch in version 281,
249 lines from 7 changes in 6 versions.
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.Compare1// abso whoami and abso doctor: each check's line, the next step when one fails, the server asked as the box and as
2// the folder's key, and no credential in anything printed. plainError's wording of the commonest failures.
4import assert from "node:assert/strict";
5import { mkdirSync, mkdtempSync, writeFileSync } from "node:fs";
6import { tmpdir } from "node:os";
7import { join } from "node:path";
8import { test } from "node:test";
9import { ApiError } from "../src/api-error.ts";
10import { writeBox } from "../src/box.ts";
speed156With nothing naming a server, the client now uses prod (https://api.abso.dev). Every command picks its server in one order: --server, else the joined folder's own server, else ABSO_SERVER, else prod. Which servers this box is signed in to no longer picks one, so a box signed in to staging and prod both, or to staging alone, goes to prod instead of refusing or quietly using staging; staging is a deliberate --server, a joined staging folder, or ABSO_SERVER. An explicit choice is used as given. A malformed ABSO_SERVER is refused like a malformed --server. When this box isn't signed in to the chosen server but is to others, whoami and join name them and how to pick one. Help states the order for every command that picks its server. For abso-core issue 9.Compare11import { doctor, doctorText, nodeNeeded, type Probe, plainError, whoami } from "../src/doctor.ts";
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.Compare12
13const SERVER = "https://staging.abso.example";
14const CREDENTIAL = "abso_bx_the-secret-credential";
15const KEY = "abso_sk_the-secret-key";
16const NOW = Date.parse("2026-10-10T06:00:00.000Z");
open171abso login drops --max-agents (abso ask 1947; Christopher, 2026-10-14: no arbitrary free limits). A box lets in any number of agents (the server stopped enforcing max_agents in abso 642): abso box no longer prints 'Up to N agents', the 'agent limit' 409 message is gone, and a stored grant without max_agents reads fine. Instant cutover, no alias. Bundle rebuilt.Compare17const grant = { projects: [{ project: "game", role: "writer" }] };
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.Compare18const box = (expiresAt = Date.parse("2026-10-20T00:00:00.000Z")) => ({
19 server: SERVER,
20 id: "b_0123abcd",
21 credential: CREDENTIAL,
22 grant,
23 expiresAt,
24});
26const temp = (name: string) => mkdtempSync(join(tmpdir(), `abso-doctor-${name}-`));
28function folder(): string {
29 const root = temp("folder");
30 mkdirSync(join(root, ".abso"));
31 writeFileSync(
32 join(root, ".abso", "config.json"),
33 JSON.stringify({ server: SERVER, project: "game", agent: "builder" }),
34 );
35 writeFileSync(join(root, ".abso", "key"), JSON.stringify({ server: SERVER, key: KEY, id: "k_00c0ffee" }));
36 return root;
37}
39type Seen = { url: string; auth: string | null }[];
40/** A server answering by path: /version, /box, /p/game/head. A missing path throws, like a refused connection. */
41function server(answers: Record<string, [number, unknown]>, seen: Seen = []): typeof fetch {
42 return (async (url, init) => {
43 const u = new URL(String(url));
44 seen.push({ url: u.pathname, auth: new Headers(init?.headers).get("authorization") });
45 const answer = answers[u.pathname];
46 if (!answer)
47 throw Object.assign(new TypeError("fetch failed"), {
48 cause: { code: "ECONNREFUSED", message: "connect ECONNREFUSED" },
49 });
50 return new Response(JSON.stringify(answer[1]), { status: answer[0] });
51 }) as typeof fetch;
52}
54const probe = (fetcher: typeof fetch, home: string, node = "24.7.0", built = false): Probe => ({
55 fetcher,
56 now: NOW,
57 node,
58 built,
59 home,
60});
61const accepted = { box_id: "b_0123abcd", revoked_at: null, approved_by: "christopher", grant };
63test("the npm package needs Node 20; a checkout, which runs its .ts as is, needs 24", () => {
64 assert.equal(nodeNeeded(true), 20);
65 assert.equal(nodeNeeded(false), 24);
66});
68test("doctor outside a folder with no sign-in: the box check fails with abso login, the folder check doesn't apply", async () => {
69 const checks = await doctor(
70 SERVER,
71 temp("outside"),
72 {},
73 probe(server({ "/version": [200, { commit: "ff7cd0e1" }] }), temp("home")),
74 );
75 assert.deepEqual(
76 checks.map((c) => [c.check, c.result]),
77 [
78 ["node", "ok"],
79 ["server", "ok"],
80 ["box", "fail"],
81 ["folder", "skip"],
82 ],
83 );
84 assert.match(checks[1]!.text, /answers \(version ff7cd0e\)/);
85 assert.match(checks[2]!.text, /isn't signed in to https:\/\/staging\.abso\.example\. Run abso login\./);
86 assert.match(checks[3]!.text, /abso join <project> makes one/);
87});
89test("doctor in a folder, signed in: every check passes, the box and the key each go to their own check", async () => {
90 const home = temp("home");
91 writeBox(box(), home);
92 const seen: Seen = [];
93 const checks = await doctor(
94 SERVER,
95 folder(),
96 {},
97 probe(
98 server({ "/version": [200, { commit: "ff7cd0e" }], "/box": [200, accepted], "/p/game/head": [200, {}] }, seen),
99 home,
100 ),
101 );
102 assert.deepEqual(
103 checks.map((c) => c.result),
104 ["ok", "ok", "ok", "ok"],
105 );
106 assert.match(checks[3]!.text, /agent builder in game, with the agent key k_00c0ffee, which the server accepts/);
107 assert.deepEqual(seen, [
108 { url: "/version", auth: null },
109 { url: "/box", auth: `Box ${CREDENTIAL}` },
110 { url: "/p/game/head", auth: `Bearer ${KEY}` },
111 ]);
112 const text = doctorText(checks);
113 assert.ok(!text.includes(CREDENTIAL) && !text.includes(KEY));
114 assert.match(text, /^ok {4}Node 24\.7\.0/);
115});
117test("doctor when the server can't be reached: says so with the next step, and the checks that need it don't apply", async () => {
118 const home = temp("home");
119 writeBox(box(), home);
120 const checks = await doctor(SERVER, folder(), {}, probe(server({}), home));
121 assert.deepEqual(
122 checks.map((c) => c.result),
123 ["ok", "fail", "skip", "skip"],
124 );
125 assert.match(
126 checks[1]!.text,
127 /Can't reach https:\/\/staging\.abso\.example: the connection was refused\. Check your connection, and the server in \.abso\/config\.json\./,
128 );
129});
131test("doctor when the server refuses the box and the key: each fails with what to do", async () => {
132 const home = temp("home");
133 writeBox(box(), home);
134 const checks = await doctor(
135 SERVER,
136 folder(),
137 {},
138 probe(
139 server({
140 "/version": [200, {}],
141 "/box": [200, { ...accepted, revoked_at: NOW - 1000 }],
142 "/p/game/head": [401, { error: "missing or wrong token" }],
143 }),
144 home,
145 ),
146 );
147 assert.deepEqual(
148 checks.map((c) => c.result),
149 ["ok", "ok", "fail", "fail"],
150 );
151 assert.match(checks[2]!.text, /no longer accepts this box's sign-in \(signed out or revoked\)\. Run abso login\./);
152 assert.match(checks[3]!.text, /didn't accept the agent key k_00c0ffee for game.*abso join game again/);
153});
155test("doctor: an expired sign-in and an old Node fail without asking the server about them", async () => {
156 const home = temp("home");
157 writeBox(box(NOW - 60_000), home);
158 const seen: Seen = [];
159 const checks = await doctor(
160 SERVER,
161 temp("outside"),
162 {},
163 probe(server({ "/version": [200, {}] }, seen), home, "20.11.0", false),
164 );
165 assert.equal(checks[0]!.result, "fail");
166 assert.match(checks[0]!.text, /Node 20\.11\.0 is too old: abso needs 24 or later\./);
167 assert.equal(checks[2]!.result, "fail");
168 assert.match(checks[2]!.text, /expired 2026-10-10 05:59 UTC\. Run abso login\./);
169 assert.deepEqual(
170 seen.map((s) => s.url),
171 ["/version"],
172 );
173});
175test("whoami: the box as the server sees it, who approved it, and this folder's agent and key, never a credential", async () => {
176 const home = temp("home");
177 writeBox(box(), home);
178 const out = await whoami(SERVER, folder(), {}, probe(server({ "/box": [200, accepted] }), home));
179 assert.match(
180 out.text,
181 /^Signed in to https:\/\/staging\.abso\.example as box b_0123abcd, approved by christopher\.\n/,
182 );
open171abso login drops --max-agents (abso ask 1947; Christopher, 2026-10-14: no arbitrary free limits). A box lets in any number of agents (the server stopped enforcing max_agents in abso 642): abso box no longer prints 'Up to N agents', the 'agent limit' 409 message is gone, and a stored grant without max_agents reads fine. Instant cutover, no alias. Bundle rebuilt.Compare183 assert.match(out.text, /Projects: game \(writer\)\.\n/);
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.Compare184 assert.match(
185 out.text,
186 /This folder is agent builder in project game on https:\/\/staging\.abso\.example, with the agent key k_00c0ffee\./,
187 );
188 assert.ok(!JSON.stringify(out).includes(CREDENTIAL) && !JSON.stringify(out).includes(KEY));
189 assert.equal((out.json.box as { confirmed: boolean }).confirmed, true);
190});
192test("whoami signed out, outside a folder: the next step for each", async () => {
193 const out = await whoami(SERVER, temp("outside"), {}, probe(server({}), temp("home")));
194 assert.equal(
195 out.text,
196 "This box isn't signed in to https://staging.abso.example. Run abso login.\nYou're not in an abso folder. abso join <project> makes one.",
197 );
198});
200test("whoami when the server says the box is revoked", async () => {
201 const home = temp("home");
202 writeBox(box(), home);
203 const out = await whoami(
204 SERVER,
205 temp("outside"),
206 {},
207 probe(server({ "/box": [401, { error: "missing or wrong token" }] }), home),
208 );
209 assert.match(out.text, /no longer accepts this box's sign-in \(signed out or revoked\)\. Run abso login\./);
210});
212test("plainError words a refusal by whether a credential went, and a server that can't be reached", () => {
213 const refused = new ApiError("GET /status answered 401: missing or wrong token", 401);
pinch281Client fixes from the judge dry run: help with today's names, a mod installer hint that runs, a failed init or join takes back what it wrote, a refused 401 names the credential that went, and reply --file
- help: abso.json, ABSO_ADMIN_TOKEN, ABSO_ADMIN_SERVERS, ABSO_BOX and .abso/shots/ in place of the old names, and the missing full stop. abso shot saves under .abso/shots/ as help says.
- --version, init, join and status name the mod installer by its full path, and on a Node that can't run .ts files say it needs Node 22.18 or later. A built copy, which has no installer, says abso record sends the edits.
- A failed init removes the .absoignore and abso.json it wrote. A failed join removes its .abso/ folder; a key already there, or one made for this join, stays.
- A 401 names what was sent (this folder's key, ABSO_TOKEN, a pipeline run's key, the token file) instead of always a folder key.
- reply takes --file <path> or --file - (stdin), like ask and answer.
- The mod-behind tests no longer depend on which mods the machine has.
Tests: install, body-files, failed-start (new), doctor, help, lost-pull pass; tsc clean.Compare214 assert.equal(plainError(refused, undefined), "You're not signed in. Run abso login, then abso join <project>.");
215 assert.match(
216 plainError(refused, "this folder's key")!,
217 /^The server didn't accept this folder's key.*abso doctor checks it/,
218 );
219 assert.match(plainError(refused, "ABSO_TOKEN")!, /^The server didn't accept ABSO_TOKEN: /);
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.Compare220 assert.equal(
pinch281Client fixes from the judge dry run: help with today's names, a mod installer hint that runs, a failed init or join takes back what it wrote, a refused 401 names the credential that went, and reply --file
- help: abso.json, ABSO_ADMIN_TOKEN, ABSO_ADMIN_SERVERS, ABSO_BOX and .abso/shots/ in place of the old names, and the missing full stop. abso shot saves under .abso/shots/ as help says.
- --version, init, join and status name the mod installer by its full path, and on a Node that can't run .ts files say it needs Node 22.18 or later. A built copy, which has no installer, says abso record sends the edits.
- A failed init removes the .absoignore and abso.json it wrote. A failed join removes its .abso/ folder; a key already there, or one made for this join, stays.
- A 401 names what was sent (this folder's key, ABSO_TOKEN, a pipeline run's key, the token file) instead of always a folder key.
- reply takes --file <path> or --file - (stdin), like ask and answer.
- The mod-behind tests no longer depend on which mods the machine has.
Tests: install, body-files, failed-start (new), doctor, help, lost-pull pass; tsc clean.Compare221 plainError(new ApiError("could not reach https://api.abso.dev: connect ECONNREFUSED"), "this folder's key"),
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.Compare222 "Can't reach https://api.abso.dev: connect ECONNREFUSED. Check your connection; abso doctor checks the rest.",
223 );
224 assert.equal(
225 plainError(
rename100abso publish is now abso push, abso sync is now abso pull (abso 427)
Commands, help, flags, messages, MCP tool names and descriptions, hook text, README, SKILL.md and tests say push and pull; "shared" stays the noun ("Pushed version N"). No aliases, no notices. A queued push that was "pulled" is now "turned back", so pull means one thing.
push -f/--force/-u/--all/--tags and pull --rebase/--ff-only/--squash refuse with one plain line naming the abso way; push and pull take no remote or branch.
Kept as stored: log entry kinds (publish, sync, pulled), HTTP route paths, the pipeline trigger on: publish, the yours (unpublished) marker, npm-publish.Compare226 new ApiError("could not reach http://x: refused. Nothing was pushed. Run the same command again."),
pinch281Client fixes from the judge dry run: help with today's names, a mod installer hint that runs, a failed init or join takes back what it wrote, a refused 401 names the credential that went, and reply --file
- help: abso.json, ABSO_ADMIN_TOKEN, ABSO_ADMIN_SERVERS, ABSO_BOX and .abso/shots/ in place of the old names, and the missing full stop. abso shot saves under .abso/shots/ as help says.
- --version, init, join and status name the mod installer by its full path, and on a Node that can't run .ts files say it needs Node 22.18 or later. A built copy, which has no installer, says abso record sends the edits.
- A failed init removes the .absoignore and abso.json it wrote. A failed join removes its .abso/ folder; a key already there, or one made for this join, stays.
- A 401 names what was sent (this folder's key, ABSO_TOKEN, a pipeline run's key, the token file) instead of always a folder key.
- reply takes --file <path> or --file - (stdin), like ask and answer.
- The mod-behind tests no longer depend on which mods the machine has.
Tests: install, body-files, failed-start (new), doctor, help, lost-pull pass; tsc clean.Compare227 "this folder's key",
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.Compare228 ),
rename100abso publish is now abso push, abso sync is now abso pull (abso 427)
Commands, help, flags, messages, MCP tool names and descriptions, hook text, README, SKILL.md and tests say push and pull; "shared" stays the noun ("Pushed version N"). No aliases, no notices. A queued push that was "pulled" is now "turned back", so pull means one thing.
push -f/--force/-u/--all/--tags and pull --rebase/--ff-only/--squash refuse with one plain line naming the abso way; push and pull take no remote or branch.
Kept as stored: log entry kinds (publish, sync, pulled), HTTP route paths, the pipeline trigger on: publish, the yours (unpublished) marker, npm-publish.Compare229 "Can't reach http://x: refused. Nothing was pushed. Run the same command again.",
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.Compare230 );
pinch281Client fixes from the judge dry run: help with today's names, a mod installer hint that runs, a failed init or join takes back what it wrote, a refused 401 names the credential that went, and reply --file
- help: abso.json, ABSO_ADMIN_TOKEN, ABSO_ADMIN_SERVERS, ABSO_BOX and .abso/shots/ in place of the old names, and the missing full stop. abso shot saves under .abso/shots/ as help says.
- --version, init, join and status name the mod installer by its full path, and on a Node that can't run .ts files say it needs Node 22.18 or later. A built copy, which has no installer, says abso record sends the edits.
- A failed init removes the .absoignore and abso.json it wrote. A failed join removes its .abso/ folder; a key already there, or one made for this join, stays.
- A 401 names what was sent (this folder's key, ABSO_TOKEN, a pipeline run's key, the token file) instead of always a folder key.
- reply takes --file <path> or --file - (stdin), like ask and answer.
- The mod-behind tests no longer depend on which mods the machine has.
Tests: install, body-files, failed-start (new), doctor, help, lost-pull pass; tsc clean.Compare231 assert.equal(plainError(new ApiError("GET /log answered 500: boom", 500), "this folder's key"), undefined);
232 assert.equal(plainError(new Error("anything else"), "this folder's key"), undefined);
speed84whoami and doctor pick the server as join does
After abso login --server <url>, whoami and doctor still looked at https://api.abso.dev outside a folder, so they said you weren't signed in, and doctor checked the wrong server. Both now take --server, then ABSO_SERVER, then the folder's server, then the server this box signed in to with abso login, then https://api.abso.dev. A box signed in to more than one server is asked to say which with --server, as join does. Help text says so. Test in client/test/doctor.test.ts.Compare233});
speed156With nothing naming a server, the client now uses prod (https://api.abso.dev). Every command picks its server in one order: --server, else the joined folder's own server, else ABSO_SERVER, else prod. Which servers this box is signed in to no longer picks one, so a box signed in to staging and prod both, or to staging alone, goes to prod instead of refusing or quietly using staging; staging is a deliberate --server, a joined staging folder, or ABSO_SERVER. An explicit choice is used as given. A malformed ABSO_SERVER is refused like a malformed --server. When this box isn't signed in to the chosen server but is to others, whoami and join name them and how to pick one. Help states the order for every command that picks its server. For abso-core issue 9.Compare235test("whoami with nothing named shows prod, and names the other servers this box is signed in to", async () => {
speed84whoami and doctor pick the server as join does
After abso login --server <url>, whoami and doctor still looked at https://api.abso.dev outside a folder, so they said you weren't signed in, and doctor checked the wrong server. Both now take --server, then ABSO_SERVER, then the folder's server, then the server this box signed in to with abso login, then https://api.abso.dev. A box signed in to more than one server is asked to say which with --server, as join does. Help text says so. Test in client/test/doctor.test.ts.Compare236 const outside = temp("outside");
237 const home = temp("home");
238 writeBox(box(), home);
speed156With nothing naming a server, the client now uses prod (https://api.abso.dev). Every command picks its server in one order: --server, else the joined folder's own server, else ABSO_SERVER, else prod. Which servers this box is signed in to no longer picks one, so a box signed in to staging and prod both, or to staging alone, goes to prod instead of refusing or quietly using staging; staging is a deliberate --server, a joined staging folder, or ABSO_SERVER. An explicit choice is used as given. A malformed ABSO_SERVER is refused like a malformed --server. When this box isn't signed in to the chosen server but is to others, whoami and join name them and how to pick one. Help states the order for every command that picks its server. For abso-core issue 9.Compare239 const fetcher = server({ "/box": [200, { revoked_at: null }] });
240 const prod = await whoami("https://api.abso.dev", outside, {}, probe(fetcher, home));
241 assert.match(
242 prod.text,
243 /This box isn't signed in to https:\/\/api\.abso\.dev\. Run abso login\. This box is signed in to https:\/\/staging\.abso\.example: abso whoami --server <url> uses it\./,
speed84whoami and doctor pick the server as join does
After abso login --server <url>, whoami and doctor still looked at https://api.abso.dev outside a folder, so they said you weren't signed in, and doctor checked the wrong server. Both now take --server, then ABSO_SERVER, then the folder's server, then the server this box signed in to with abso login, then https://api.abso.dev. A box signed in to more than one server is asked to say which with --server, as join does. Help text says so. Test in client/test/doctor.test.ts.Compare244 );
245 writeBox({ ...box(), server: "https://api.abso.dev" }, home);
speed156With nothing naming a server, the client now uses prod (https://api.abso.dev). Every command picks its server in one order: --server, else the joined folder's own server, else ABSO_SERVER, else prod. Which servers this box is signed in to no longer picks one, so a box signed in to staging and prod both, or to staging alone, goes to prod instead of refusing or quietly using staging; staging is a deliberate --server, a joined staging folder, or ABSO_SERVER. An explicit choice is used as given. A malformed ABSO_SERVER is refused like a malformed --server. When this box isn't signed in to the chosen server but is to others, whoami and join name them and how to pick one. Help states the order for every command that picks its server. For abso-core issue 9.Compare246 const both = await whoami("https://api.abso.dev", outside, {}, probe(fetcher, home));
247 assert.match(both.text, /Signed in to https:\/\/api\.abso\.dev as box b_0123abcd/);
248 assert.equal(both.json.server, "https://api.abso.dev");
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.Compare249});