Versions 80 to 318
Lines 3–17 at 318 (were 3–13 at 80)
33// when one fails. Neither prints a credential. plainError words the commonest failures the same way.
44
6−import { type Answer, type BoxRecord, boxGet, boxText, originOf, readBox } from "./box.ts";
6+import { type Answer, type BoxRecord, boxGet, boxText, originOf, readBox, signedInServers } from "./box.ts";
8−import { type Config, credentialLabel, findRoot, readConfig } from "./config.ts";
910
10−/** The lowest Node major each kind of copy runs on: the npm package is built for 20, a checkout runs its .ts as is. */
12+ * The lowest Node major each kind of copy runs on: a built one (the npm package, or a checkout's client/bin/abso.mjs)
13+ * is built for 20; a checkout's client/abso.ts runs its .ts as is, which takes Node's type stripping.
Lines 26–38 at 318 (were 22–28 at 80)
2327
25− return { fetcher: fetch, now: Date.now(), node: process.versions.node, built: builtCopy() };
29+ // Bundled, this module is client/bin/abso.mjs (or the npm package's file); from client/abso.ts, it is this .ts.
2737
Lines 49–64 at 318 (were 39–44 at 80)
4151
53+ * The servers other than `server` this box is signed in to, as one sentence for a refusal or a report to end
56+export function elsewhereText(server: string, command: string, home?: string, now = Date.now()): string {
59+ return ` This box is signed in to ${others.join(" and ")}: ${command} --server <url> uses ${others.length === 1 ? "it" : "one"}.`;
61+
4363
Lines 78–92 at 318 (were 58–64 at 80)
5878
5979function credentialWords(root: string, server: string, env: Readonly<Record<string, string | undefined>>): string {
61− return c.kind === "agent key" ? `the agent key ${c.id}` : c.kind === "shared token" ? "the shared token" : "no key";
6391
Lines 99–107 at 318 (were 71–77 at 80)
74− lines.push(`This box isn't signed in to ${originOf(server)}. Run abso login.`);
103+ `This box isn't signed in to ${originOf(server)}. Run abso login.${elsewhereText(server, "abso whoami", probe.home, probe.now)}`,
Lines 169–176 at 318 (were 139–146 at 80)
140170
142− // The folder's own server when there is one: it's the one its commands talk to.
143− const target = folder?.config?.server ?? server;
172+ // Chosen as every command chooses (server-choice.ts): --server, else the folder's own, else ABSO_SERVER, else prod.
Lines 327–340 at 318 (were 297–310 at 80)
297327
299329 * The commonest failures in plain words, with the next step: no credential, a credential the server refuses, and a
300− * server that can't be reached. Anything else is left as it was. `signedIn` is whether the call carried a key or token.
330+ * server that can't be reached. Anything else is left as it was. `sent` names the key or token the call carried, if any.
302−export function plainError(err: unknown, signedIn: boolean): string | undefined {
332+export function plainError(err: unknown, sent: string | undefined, tokenFileUnasked = false): string | undefined {
305− return signedIn
306− ? `The server didn't accept this folder's key: it may be revoked or expired. abso doctor checks it. (${err.message})`
307− : "You're not signed in. Run abso login, then abso join <project>.";
336+ ? `The server didn't accept ${sent}: it may be revoked or expired. abso doctor checks it. (${err.message})`
337+ : `You're not signed in. Run abso login, then abso join <project>.${tokenFileUnasked ? " ~/.abso/token is used only with --token-file." : ""}`;
310340 // A message that already gives its next step (publish's "Run the same command again.") keeps it as the last word.
- MCP
- compare on this site's /mcp
- CLI
- abso diff 80 318 client/src/doctor.ts --json
- JSON
- /christopher/abso-core/compare/80..318?file=client%2Fsrc%2Fdoctor.ts&format=json