{"file":"client/src/command-env.ts","version":261,"total":70,"from":1,"to":70,"lines":[{"n":1,"text":"// What every abso command shares: its output, its environment, the folder it opens, and the news it took.","atom":"a0","author":"init","version":0},{"n":2,"text":"","atom":"a0","author":"init","version":0},{"n":3,"text":"import { Api, type News, newsLines, type RunKind } from \"./api.ts\";","atom":"a0","author":"init","version":0},{"n":4,"text":"import { UsageError } from \"./args.ts\";","atom":"a0","author":"init","version":0},{"n":5,"text":"import { type Config, findRoot, readConfig } from \"./config.ts\";","atom":"a0","author":"init","version":0},{"n":6,"text":"import { newsBlockLines, newsShown } from \"./core.ts\";","atom":"a276","author":"pinch","version":33},{"n":7,"text":"import { logNews } from \"./folder.ts\";","atom":"a0","author":"init","version":0},{"n":8,"text":"","atom":"a0","author":"init","version":0},{"n":9,"text":"export const EXIT = { ok: 0, error: 1, refused: 2 } as const;","atom":"a0","author":"init","version":0},{"n":10,"text":"","atom":"a0","author":"init","version":0},{"n":11,"text":"export interface Output {","atom":"a0","author":"init","version":0},{"n":12,"text":"\treadonly text: string;","atom":"a0","author":"init","version":0},{"n":13,"text":"\treadonly json: Record<string, unknown>;","atom":"a0","author":"init","version":0},{"n":14,"text":"\treadonly exit?: number;","atom":"a0","author":"init","version":0},{"n":15,"text":"}","atom":"a0","author":"init","version":0},{"n":16,"text":"","atom":"a0","author":"init","version":0},{"n":17,"text":"export interface Env {","atom":"a0","author":"init","version":0},{"n":18,"text":"\treadonly cwd: string;","atom":"a0","author":"init","version":0},{"n":19,"text":"\treadonly env: Readonly<Record<string, string | undefined>>;","atom":"a0","author":"init","version":0},{"n":20,"text":"\t/** Where `run` streams the box's output as it arrives. */","atom":"a0","author":"init","version":0},{"n":21,"text":"\treadonly write: (text: string) => void;","atom":"a0","author":"init","version":0},{"n":22,"text":"\t/** Where `run` streams the box's stderr; `write` when not given. */","atom":"a0","author":"init","version":0},{"n":23,"text":"\treadonly writeErr?: (text: string) => void;","atom":"a0","author":"init","version":0},{"n":24,"text":"\t/** What a box run is for, when a command runs one for its own ends (shot, bisect, publish --check). */","atom":"a0","author":"init","version":0},{"n":25,"text":"\treadonly runKind?: RunKind;","atom":"a0","author":"init","version":0},{"n":26,"text":"\t/** What a -file flag of - reads: stdin, unless a test gives it. */","atom":"a0","author":"init","version":0},{"n":27,"text":"\treadonly readStdin?: () => string;","atom":"a0","author":"init","version":0},{"n":28,"text":"\t/**","atom":"a1557","author":"speed","version":155},{"n":29,"text":"\t * The server --server named, checked (server-choice.ts), when the command was given one. It is used as given,","atom":"a1557","author":"speed","version":155},{"n":30,"text":"\t * so no environment setting redirects it (ABSO_ISSUES_SERVER included).","atom":"a1557","author":"speed","version":155},{"n":31,"text":"\t */","atom":"a1557","author":"speed","version":155},{"n":32,"text":"\treadonly server?: string;","atom":"a1557","author":"speed","version":155},{"n":33,"text":"}","atom":"a0","author":"init","version":0},{"n":34,"text":"","atom":"a0","author":"init","version":0},{"n":35,"text":"export function plural(n: number, word: string): string {","atom":"a0","author":"init","version":0},{"n":36,"text":"\treturn `${n} ${word}${n === 1 ? \"\" : \"s\"}`;","atom":"a0","author":"init","version":0},{"n":37,"text":"}","atom":"a0","author":"init","version":0},{"n":38,"text":"","atom":"a0","author":"init","version":0},{"n":39,"text":"export function open(env: Env): { root: string; config: Config; api: Api } {","atom":"a0","author":"init","version":0},{"n":40,"text":"\tconst root = findRoot(env.cwd);","atom":"a0","author":"init","version":0},{"n":41,"text":"\tif (root === undefined)","atom":"a0","author":"init","version":0},{"n":42,"text":"\t\tthrow new UsageError(","atom":"a0","author":"init","version":0},{"n":43,"text":"\t\t\t`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.`,","atom":"a679","author":"speed","version":76},{"n":44,"text":"\t\t);","atom":"a0","author":"init","version":0},{"n":45,"text":"\tconst config = readConfig(root, env.env);","atom":"a0","author":"init","version":0},{"n":46,"text":"\treturn { root, config, api: new Api(config) };","atom":"a0","author":"init","version":0},{"n":47,"text":"}","atom":"a0","author":"init","version":0},{"n":48,"text":"","atom":"a0","author":"init","version":0},{"n":49,"text":"/**","atom":"a0","author":"init","version":0},{"n":50,"text":" * News a command took from the server while recording first. main() prints it","atom":"a0","author":"init","version":0},{"n":51,"text":" * after whatever the command says, so every command that takes news shows it","atom":"a0","author":"init","version":0},{"n":52,"text":" * (#37, News Report: sync, run and diff took it, wrote it to .avcs/news.log and","atom":"a0","author":"init","version":0},{"n":53,"text":" * printed nothing; 94 of the game's 613 items, 54 of them announcements).","atom":"a0","author":"init","version":0},{"n":54,"text":" */","atom":"a0","author":"init","version":0},{"n":55,"text":"const takenNews: string[] = [];","atom":"a0","author":"init","version":0},{"n":56,"text":"export function takeNews(): string[] {","atom":"a0","author":"init","version":0},{"n":57,"text":"\treturn takenNews.splice(0);","atom":"a0","author":"init","version":0},{"n":58,"text":"}","atom":"a0","author":"init","version":0},{"n":59,"text":"","atom":"a0","author":"init","version":0},{"n":60,"text":"/** News a record answered with: kept in .avcs/news.log, and printed by main(). */","atom":"a0","author":"init","version":0},{"n":61,"text":"export function heard(root: string, news: News | undefined): void {","atom":"a0","author":"init","version":0},{"n":62,"text":"\tconst lines = newsLines(news);","atom":"a0","author":"init","version":0},{"n":63,"text":"\tlogNews(root, lines);","atom":"a0","author":"init","version":0},{"n":64,"text":"\ttakenNews.push(...lines);","atom":"a0","author":"init","version":0},{"n":65,"text":"}","atom":"a0","author":"init","version":0},{"n":66,"text":"","atom":"a0","author":"init","version":0},{"n":67,"text":"export function newsText(news: News): string[] {","atom":"a0","author":"init","version":0},{"n":68,"text":"\tconst lines = newsLines(news);","atom":"a0","author":"init","version":0},{"n":69,"text":"\treturn newsBlockLines(lines.map((n) => newsShown(n)));","atom":"a276","author":"pinch","version":33},{"n":70,"text":"}","atom":"a0","author":"init","version":0}],"atoms":[{"atom":"a0","author":"init","message":"Start the project","time":1791506895507,"timeIso":"2026-10-09T00:48:15.507Z","publish":{"draft":null,"version":0,"agent":"init","message":"Start the project","time":1791506895507,"timeIso":"2026-10-09T00:48:15.507Z"}},{"atom":"a276","author":"pinch","message":"","time":1791542609123,"timeIso":"2026-10-09T10:43:29.123Z","publish":{"draft":null,"version":33,"agent":"pinch","message":"Client: 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.","time":1791542703308,"timeIso":"2026-10-09T10:45:03.308Z"}},{"atom":"a679","author":"speed","message":"","time":1791611187006,"timeIso":"2026-10-10T05:46:27.006Z","publish":{"draft":null,"version":76,"agent":"speed","message":"abso whoami and abso doctor, and plainer errors.\n\n- 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.\n- 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.\n- Neither prints a credential. Both are MCP tools too.\n- 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.","time":1791611187590,"timeIso":"2026-10-10T05:46:27.590Z"}},{"atom":"a1557","author":"speed","message":"","time":1791913488241,"timeIso":"2026-10-13T17:44:48.241Z","publish":{"draft":null,"version":155,"agent":"speed","message":"Every 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.","time":1791913490940,"timeIso":"2026-10-13T17:44:50.940Z"}}]}