{"file":"client/src/mcp.ts","version":318,"total":277,"from":1,"to":277,"lines":[{"n":1,"text":"// abso mcp: an MCP server on stdin and stdout (#42, #44). Each tool is one avcs","atom":"a0","author":"init","version":0},{"n":2,"text":"// command, run by the same code as the command line and answering with the","atom":"a0","author":"init","version":0},{"n":3,"text":"// same text, so the CLI and the tools can't drift apart and an agent learns","atom":"a0","author":"init","version":0},{"n":4,"text":"// one set of words. The folder and the token come from where the server runs,","atom":"a0","author":"init","version":0},{"n":5,"text":"// as for the CLI: .avcs/config.json, and ABSO_TOKEN or ~/.abso/token.","atom":"a213","author":"review","version":27},{"n":6,"text":"//","atom":"a0","author":"init","version":0},{"n":7,"text":"//   claude mcp add abso -- abso mcp","atom":"a656","author":"speed","version":71},{"n":8,"text":"//","atom":"a0","author":"init","version":0},{"n":9,"text":"// The protocol is JSON-RPC 2.0, one message per line, with no library: the","atom":"a0","author":"init","version":0},{"n":10,"text":"// client uses nothing outside Node.","atom":"a0","author":"init","version":0},{"n":11,"text":"","atom":"a0","author":"init","version":0},{"n":12,"text":"import { realpathSync } from \"node:fs\";","atom":"a149","author":"pinch","version":21},{"n":13,"text":"import { isAbsolute, relative, resolve, sep } from \"node:path\";","atom":"a149","author":"pinch","version":21},{"n":14,"text":"import { clientVersion } from \"./client-version.ts\";","atom":"a0","author":"init","version":0},{"n":15,"text":"import { commandTable, main } from \"./main.ts\";","atom":"a0","author":"init","version":0},{"n":16,"text":"","atom":"a0","author":"init","version":0},{"n":17,"text":"/**","atom":"a0","author":"init","version":0},{"n":18,"text":" * The commands served as tools: reading, and the writes an agent makes every","atom":"a0","author":"init","version":0},{"n":19,"text":" * day. The box commands (run, shot, bisect, prep, logs, fetch) stream for","atom":"a0","author":"init","version":0},{"n":20,"text":" * minutes and stay in the shell, as do setting a folder up (init, join) and","atom":"a0","author":"init","version":0},{"n":21,"text":" * the ones that rewrite history or move between drafts.","atom":"a0","author":"init","version":0},{"n":22,"text":" */","atom":"a0","author":"init","version":0},{"n":23,"text":"export const MCP_COMMANDS = [","atom":"a0","author":"init","version":0},{"n":24,"text":"\t\"status\",","atom":"a0","author":"init","version":0},{"n":25,"text":"\t\"log\",","atom":"a0","author":"init","version":0},{"n":26,"text":"\t\"show\",","atom":"a0","author":"init","version":0},{"n":27,"text":"\t\"diff\",","atom":"a0","author":"init","version":0},{"n":28,"text":"\t\"files\",","atom":"a0","author":"init","version":0},{"n":29,"text":"\t\"who\",","atom":"a0","author":"init","version":0},{"n":30,"text":"\t\"where\",","atom":"a0","author":"init","version":0},{"n":31,"text":"\t\"blame\",","atom":"a0","author":"init","version":0},{"n":32,"text":"\t\"why\",","atom":"a0","author":"init","version":0},{"n":33,"text":"\t\"ci\",","atom":"a0","author":"init","version":0},{"n":34,"text":"\t\"news\",","atom":"a0","author":"init","version":0},{"n":35,"text":"\t\"announce\",","atom":"a0","author":"init","version":0},{"n":36,"text":"\t\"start\",","atom":"a0","author":"init","version":0},{"n":37,"text":"\t\"record\",","atom":"a0","author":"init","version":0},{"n":38,"text":"\t\"pull\",","atom":"a845","author":"rename","version":100},{"n":39,"text":"\t\"push\",","atom":"a845","author":"rename","version":100},{"n":40,"text":"\t\"unqueue\",","atom":"a0","author":"init","version":0},{"n":41,"text":"\t\"restore\",","atom":"a0","author":"init","version":0},{"n":42,"text":"\t\"settle\",","atom":"a0","author":"init","version":0},{"n":43,"text":"\t\"check-ignore\",","atom":"a0","author":"init","version":0},{"n":44,"text":"\t\"labels\",","atom":"a0","author":"init","version":0},{"n":45,"text":"\t\"mv\",","atom":"a0","author":"init","version":0},{"n":46,"text":"\t\"review\",","atom":"a0","author":"init","version":0},{"n":47,"text":"\t\"note\",","atom":"a0","author":"init","version":0},{"n":48,"text":"\t\"notes\",","atom":"a0","author":"init","version":0},{"n":49,"text":"\t\"issues\",","atom":"a0","author":"init","version":0},{"n":50,"text":"\t\"issue\",","atom":"a0","author":"init","version":0},{"n":51,"text":"\t\"search\",","atom":"a146","author":"devops","version":20},{"n":52,"text":"\t\"ask\",","atom":"a0","author":"init","version":0},{"n":53,"text":"\t\"waiting\",","atom":"a0","author":"init","version":0},{"n":54,"text":"\t\"answer\",","atom":"a0","author":"init","version":0},{"n":55,"text":"\t\"ack\",","atom":"a483","author":"pinch","version":53},{"n":56,"text":"\t\"reply\",","atom":"a662","author":"pinch","version":72},{"n":57,"text":"\t\"groups\",","atom":"a2613","author":"groups","version":256},{"n":58,"text":"\t\"group\",","atom":"a2613","author":"groups","version":256},{"n":59,"text":"\t\"orgs\",","atom":"a291","author":"pinch","version":34},{"n":60,"text":"\t\"org\",","atom":"a291","author":"pinch","version":34},{"n":61,"text":"\t\"whoami\",","atom":"a682","author":"speed","version":76},{"n":62,"text":"\t\"doctor\",","atom":"a682","author":"speed","version":76},{"n":63,"text":"] as const;","atom":"a0","author":"init","version":0},{"n":64,"text":"","atom":"a0","author":"init","version":0},{"n":65,"text":"const PROTOCOLS = [\"2025-06-18\", \"2025-03-26\", \"2024-11-05\"];","atom":"a0","author":"init","version":0},{"n":66,"text":"","atom":"a0","author":"init","version":0},{"n":67,"text":"interface Tool {","atom":"a0","author":"init","version":0},{"n":68,"text":"\treadonly name: string;","atom":"a0","author":"init","version":0},{"n":69,"text":"\treadonly description: string;","atom":"a0","author":"init","version":0},{"n":70,"text":"\treadonly inputSchema: Record<string, unknown>;","atom":"a0","author":"init","version":0},{"n":71,"text":"}","atom":"a0","author":"init","version":0},{"n":72,"text":"","atom":"a0","author":"init","version":0},{"n":73,"text":"/** A tool's name: the command, with _ for - (check-ignore is check_ignore). */","atom":"a0","author":"init","version":0},{"n":74,"text":"const toolName = (command: string): string => command.replace(/-/g, \"_\");","atom":"a0","author":"init","version":0},{"n":75,"text":"","atom":"a0","author":"init","version":0},{"n":76,"text":"export function mcpTools(): Tool[] {","atom":"a0","author":"init","version":0},{"n":77,"text":"\tconst table = commandTable();","atom":"a0","author":"init","version":0},{"n":78,"text":"\treturn MCP_COMMANDS.map((command) => {","atom":"a0","author":"init","version":0},{"n":79,"text":"\t\tconst def = table[command]!;","atom":"a0","author":"init","version":0},{"n":80,"text":"\t\tconst flags = Object.fromEntries(","atom":"a0","author":"init","version":0},{"n":81,"text":"\t\t\t// No --token-file: a tool signs in with its folder's key, never this machine's token file.","atom":"a2714","author":"readspeed","version":271},{"n":82,"text":"\t\t\tObject.entries(def.flags)","atom":"a2714","author":"readspeed","version":271},{"n":83,"text":"\t\t\t\t.filter(([flag]) => flag !== \"token-file\")","atom":"a2714","author":"readspeed","version":271},{"n":84,"text":"\t\t\t\t.map(([flag, kind]) => [","atom":"a2714","author":"readspeed","version":271},{"n":85,"text":"\t\t\t\t\tflag,","atom":"a2714","author":"readspeed","version":271},{"n":86,"text":"\t\t\t\t\tkind === \"boolean\"","atom":"a2714","author":"readspeed","version":271},{"n":87,"text":"\t\t\t\t\t\t? { type: \"boolean\", description: `--${flag}` }","atom":"a2714","author":"readspeed","version":271},{"n":88,"text":"\t\t\t\t\t\t: {","atom":"a2714","author":"readspeed","version":271},{"n":89,"text":"\t\t\t\t\t\t\t\ttype: \"string\",","atom":"a2714","author":"readspeed","version":271},{"n":90,"text":"\t\t\t\t\t\t\t\tdescription:","atom":"a2714","author":"readspeed","version":271},{"n":91,"text":"\t\t\t\t\t\t\t\t\tkind === \"optional\" ? `--${flag} \"<value>\"; \"\" gives --${flag} alone` : `--${flag} <value>`,","atom":"a2714","author":"readspeed","version":271},{"n":92,"text":"\t\t\t\t\t\t\t},","atom":"a2714","author":"readspeed","version":271},{"n":93,"text":"\t\t\t\t]),","atom":"a2714","author":"readspeed","version":271},{"n":94,"text":"\t\t);","atom":"a0","author":"init","version":0},{"n":95,"text":"\t\treturn {","atom":"a0","author":"init","version":0},{"n":96,"text":"\t\t\tname: toolName(command),","atom":"a0","author":"init","version":0},{"n":97,"text":"\t\t\tdescription: `${def.usage}\\n${def.about}`,","atom":"a0","author":"init","version":0},{"n":98,"text":"\t\t\tinputSchema: {","atom":"a0","author":"init","version":0},{"n":99,"text":"\t\t\t\ttype: \"object\",","atom":"a0","author":"init","version":0},{"n":100,"text":"\t\t\t\tproperties: {","atom":"a0","author":"init","version":0},{"n":101,"text":"\t\t\t\t\targs: {","atom":"a0","author":"init","version":0},{"n":102,"text":"\t\t\t\t\t\ttype: \"array\",","atom":"a0","author":"init","version":0},{"n":103,"text":"\t\t\t\t\t\titems: { type: \"string\" },","atom":"a0","author":"init","version":0},{"n":104,"text":"\t\t\t\t\t\tdescription: \"The words after the command, as on the command line: files, versions, text.\",","atom":"a0","author":"init","version":0},{"n":105,"text":"\t\t\t\t\t},","atom":"a0","author":"init","version":0},{"n":106,"text":"\t\t\t\t\tfolder: {","atom":"a0","author":"init","version":0},{"n":107,"text":"\t\t\t\t\t\ttype: \"string\",","atom":"a0","author":"init","version":0},{"n":108,"text":"\t\t\t\t\t\tdescription:","atom":"a149","author":"pinch","version":21},{"n":109,"text":"\t\t\t\t\t\t\t\"The abso folder to run in: the folder this server started in (the default), or one inside it.\",","atom":"a149","author":"pinch","version":21},{"n":110,"text":"\t\t\t\t\t},","atom":"a0","author":"init","version":0},{"n":111,"text":"\t\t\t\t\tjson: { type: \"boolean\", description: \"Answer with the command's JSON (as --json) instead of its text.\" },","atom":"a0","author":"init","version":0},{"n":112,"text":"\t\t\t\t\t...flags,","atom":"a0","author":"init","version":0},{"n":113,"text":"\t\t\t\t},","atom":"a0","author":"init","version":0},{"n":114,"text":"\t\t\t\tadditionalProperties: false,","atom":"a0","author":"init","version":0},{"n":115,"text":"\t\t\t},","atom":"a0","author":"init","version":0},{"n":116,"text":"\t\t};","atom":"a0","author":"init","version":0},{"n":117,"text":"\t});","atom":"a0","author":"init","version":0},{"n":118,"text":"}","atom":"a0","author":"init","version":0},{"n":119,"text":"","atom":"a0","author":"init","version":0},{"n":120,"text":"/** A path as it really is (through links), or as given when it doesn't exist. */","atom":"a149","author":"pinch","version":21},{"n":121,"text":"function real(path: string): string {","atom":"a149","author":"pinch","version":21},{"n":122,"text":"\ttry {","atom":"a149","author":"pinch","version":21},{"n":123,"text":"\t\treturn realpathSync.native(path);","atom":"a149","author":"pinch","version":21},{"n":124,"text":"\t} catch {","atom":"a149","author":"pinch","version":21},{"n":125,"text":"\t\treturn path;","atom":"a149","author":"pinch","version":21},{"n":126,"text":"\t}","atom":"a149","author":"pinch","version":21},{"n":127,"text":"}","atom":"a149","author":"pinch","version":21},{"n":128,"text":"","atom":"a149","author":"pinch","version":21},{"n":129,"text":"/** Whether `path` is `start` or inside it, after links are followed. */","atom":"a149","author":"pinch","version":21},{"n":130,"text":"function inside(start: string, path: string): boolean {","atom":"a149","author":"pinch","version":21},{"n":131,"text":"\tconst rel = relative(real(start), real(path));","atom":"a149","author":"pinch","version":21},{"n":132,"text":"\treturn rel === \"\" || (rel !== \"..\" && !rel.startsWith(`..${sep}`) && !isAbsolute(rel));","atom":"a149","author":"pinch","version":21},{"n":133,"text":"}","atom":"a149","author":"pinch","version":21},{"n":134,"text":"","atom":"a149","author":"pinch","version":21},{"n":135,"text":"/** The tool inputs that name files or folders on this machine to read or write, comma-separated: each is confined like the folder. */","atom":"a249","author":"pinch","version":29},{"n":136,"text":"export const FILE_INPUTS = [\"attach\", \"clean\", \"save-attachments\"] as const;","atom":"a249","author":"pinch","version":29},{"n":137,"text":"","atom":"a161","author":"pinch","version":23},{"n":138,"text":"/**","atom":"a149","author":"pinch","version":21},{"n":139,"text":" * Where a tool call runs, and what it may read: its folder and","atom":"a155","author":"pinch","version":22},{"n":140,"text":" * every file a FILE_INPUTS input names stay inside the folder the server","atom":"a161","author":"pinch","version":23},{"n":141,"text":" * started in. A relative path that climbs out (..), an absolute one elsewhere,","atom":"a161","author":"pinch","version":23},{"n":142,"text":" * or a link out is refused, so no tool reads a file outside the project.","atom":"a161","author":"pinch","version":23},{"n":143,"text":" * Answers the folder, or why the call is refused.","atom":"a161","author":"pinch","version":23},{"n":144,"text":" */","atom":"a149","author":"pinch","version":21},{"n":145,"text":"export function confineCall(","atom":"a149","author":"pinch","version":21},{"n":146,"text":"\tstart: string,","atom":"a149","author":"pinch","version":21},{"n":147,"text":"\tinput: Readonly<Record<string, unknown>>,","atom":"a149","author":"pinch","version":21},{"n":148,"text":"): { folder: string } | { refused: string } {","atom":"a149","author":"pinch","version":21},{"n":149,"text":"\tconst named = typeof input.folder === \"string\" && input.folder !== \"\" ? input.folder : undefined;","atom":"a149","author":"pinch","version":21},{"n":150,"text":"\tconst folder = named === undefined ? start : resolve(start, named);","atom":"a149","author":"pinch","version":21},{"n":151,"text":"\tif (!inside(start, folder))","atom":"a149","author":"pinch","version":21},{"n":152,"text":"\t\treturn {","atom":"a149","author":"pinch","version":21},{"n":153,"text":"\t\t\trefused: `folder ${JSON.stringify(named)} is outside ${start}, the folder this server started in; tools run there or below`,","atom":"a149","author":"pinch","version":21},{"n":154,"text":"\t\t};","atom":"a149","author":"pinch","version":21},{"n":155,"text":"\tfor (const flag of FILE_INPUTS) {","atom":"a161","author":"pinch","version":23},{"n":156,"text":"\t\tconst value = input[flag];","atom":"a161","author":"pinch","version":23},{"n":157,"text":"\t\tif (typeof value !== \"string\") continue;","atom":"a161","author":"pinch","version":23},{"n":158,"text":"\t\tfor (const p of value","atom":"a161","author":"pinch","version":23},{"n":159,"text":"\t\t\t.split(\",\")","atom":"a149","author":"pinch","version":21},{"n":160,"text":"\t\t\t.map((x) => x.trim())","atom":"a149","author":"pinch","version":21},{"n":161,"text":"\t\t\t.filter((x) => x !== \"\"))","atom":"a149","author":"pinch","version":21},{"n":162,"text":"\t\t\tif (!inside(start, resolve(folder, p)))","atom":"a149","author":"pinch","version":21},{"n":163,"text":"\t\t\t\treturn {","atom":"a149","author":"pinch","version":21},{"n":164,"text":"\t\t\t\t\trefused: `--${flag} ${p} is outside ${start}, the folder this server started in; a tool reads and writes files only there or below`,","atom":"a249","author":"pinch","version":29},{"n":165,"text":"\t\t\t\t};","atom":"a149","author":"pinch","version":21},{"n":166,"text":"\t}","atom":"a161","author":"pinch","version":23},{"n":167,"text":"\treturn { folder };","atom":"a149","author":"pinch","version":21},{"n":168,"text":"}","atom":"a149","author":"pinch","version":21},{"n":169,"text":"","atom":"a149","author":"pinch","version":21},{"n":170,"text":"/** The command line a tool call stands for: flags as --name=value, then the words after --. */","atom":"a0","author":"init","version":0},{"n":171,"text":"export function argvFor(command: string, input: Readonly<Record<string, unknown>>): string[] {","atom":"a0","author":"init","version":0},{"n":172,"text":"\tconst def = commandTable()[command]!;","atom":"a0","author":"init","version":0},{"n":173,"text":"\tconst argv = [command];","atom":"a0","author":"init","version":0},{"n":174,"text":"\tfor (const [flag, kind] of Object.entries(def.flags)) {","atom":"a0","author":"init","version":0},{"n":175,"text":"\t\tconst value = input[flag];","atom":"a0","author":"init","version":0},{"n":176,"text":"\t\tif (value === undefined || value === null || value === false) continue;","atom":"a0","author":"init","version":0},{"n":177,"text":"\t\tif (kind === \"boolean\") argv.push(`--${flag}`);","atom":"a0","author":"init","version":0},{"n":178,"text":"\t\telse argv.push(`--${flag}=${String(value)}`);","atom":"a0","author":"init","version":0},{"n":179,"text":"\t}","atom":"a0","author":"init","version":0},{"n":180,"text":"\tconst words = Array.isArray(input.args) ? input.args.map(String) : [];","atom":"a0","author":"init","version":0},{"n":181,"text":"\tif (words.length > 0) argv.push(\"--\", ...words);","atom":"a0","author":"init","version":0},{"n":182,"text":"\treturn argv;","atom":"a0","author":"init","version":0},{"n":183,"text":"}","atom":"a0","author":"init","version":0},{"n":184,"text":"","atom":"a0","author":"init","version":0},{"n":185,"text":"type Message = { jsonrpc?: string; id?: string | number | null; method?: string; params?: Record<string, unknown> };","atom":"a0","author":"init","version":0},{"n":186,"text":"","atom":"a0","author":"init","version":0},{"n":187,"text":"/**","atom":"a0","author":"init","version":0},{"n":188,"text":" * Serve MCP on `lines` (each one JSON-RPC message), answering through `send`.","atom":"a0","author":"init","version":0},{"n":189,"text":" * Calls run one at a time, since a command's news is gathered process-wide.","atom":"a0","author":"init","version":0},{"n":190,"text":" */","atom":"a0","author":"init","version":0},{"n":191,"text":"export async function serveMcp(","atom":"a0","author":"init","version":0},{"n":192,"text":"\tinput: AsyncIterable<Buffer | string>,","atom":"a0","author":"init","version":0},{"n":193,"text":"\tsend: (line: string) => void,","atom":"a0","author":"init","version":0},{"n":194,"text":"\tcwd: string,","atom":"a0","author":"init","version":0},{"n":195,"text":"\tenv: Readonly<Record<string, string | undefined>>,","atom":"a0","author":"init","version":0},{"n":196,"text":"): Promise<void> {","atom":"a0","author":"init","version":0},{"n":197,"text":"\tlet queue: Promise<void> = Promise.resolve();","atom":"a0","author":"init","version":0},{"n":198,"text":"\tconst reply = (id: Message[\"id\"], result: unknown) => send(JSON.stringify({ jsonrpc: \"2.0\", id, result }));","atom":"a0","author":"init","version":0},{"n":199,"text":"\tconst fail = (id: Message[\"id\"], code: number, message: string) =>","atom":"a0","author":"init","version":0},{"n":200,"text":"\t\tsend(JSON.stringify({ jsonrpc: \"2.0\", id: id ?? null, error: { code, message } }));","atom":"a0","author":"init","version":0},{"n":201,"text":"","atom":"a0","author":"init","version":0},{"n":202,"text":"\tconst handle = async (msg: Message): Promise<void> => {","atom":"a0","author":"init","version":0},{"n":203,"text":"\t\tconst { id, method, params = {} } = msg;","atom":"a0","author":"init","version":0},{"n":204,"text":"\t\tconst isRequest = id !== undefined && id !== null;","atom":"a0","author":"init","version":0},{"n":205,"text":"\t\tswitch (method) {","atom":"a0","author":"init","version":0},{"n":206,"text":"\t\t\tcase \"initialize\": {","atom":"a0","author":"init","version":0},{"n":207,"text":"\t\t\t\tconst asked = typeof params.protocolVersion === \"string\" ? params.protocolVersion : \"\";","atom":"a0","author":"init","version":0},{"n":208,"text":"\t\t\t\treturn reply(id, {","atom":"a0","author":"init","version":0},{"n":209,"text":"\t\t\t\t\tprotocolVersion: PROTOCOLS.includes(asked) ? asked : PROTOCOLS[0],","atom":"a0","author":"init","version":0},{"n":210,"text":"\t\t\t\t\tcapabilities: { tools: {} },","atom":"a0","author":"init","version":0},{"n":211,"text":"\t\t\t\t\tserverInfo: { name: \"abso\", version: clientVersion() },","atom":"a82","author":"review","version":16},{"n":212,"text":"\t\t\t\t\tinstructions:","atom":"a0","author":"init","version":0},{"n":213,"text":"\t\t\t\t\t\t\"abso, the agent-first version control client. Each tool is the abso command of the same name and answers with the command line's text. Box runs (abso run, shot, bisect) stay in the shell.\",","atom":"a82","author":"review","version":16},{"n":214,"text":"\t\t\t\t});","atom":"a0","author":"init","version":0},{"n":215,"text":"\t\t\t}","atom":"a0","author":"init","version":0},{"n":216,"text":"\t\t\tcase \"ping\":","atom":"a0","author":"init","version":0},{"n":217,"text":"\t\t\t\treturn reply(id, {});","atom":"a0","author":"init","version":0},{"n":218,"text":"\t\t\tcase \"tools/list\":","atom":"a0","author":"init","version":0},{"n":219,"text":"\t\t\t\treturn reply(id, { tools: mcpTools() });","atom":"a0","author":"init","version":0},{"n":220,"text":"\t\t\tcase \"tools/call\": {","atom":"a0","author":"init","version":0},{"n":221,"text":"\t\t\t\tconst name = typeof params.name === \"string\" ? params.name : \"\";","atom":"a0","author":"init","version":0},{"n":222,"text":"\t\t\t\tconst command = MCP_COMMANDS.find((c) => toolName(c) === name);","atom":"a0","author":"init","version":0},{"n":223,"text":"\t\t\t\tif (command === undefined) return fail(id, -32602, `no tool ${JSON.stringify(name)}; tools/list names them`);","atom":"a0","author":"init","version":0},{"n":224,"text":"\t\t\t\tconst args = (params.arguments ?? {}) as Record<string, unknown>;","atom":"a0","author":"init","version":0},{"n":225,"text":"\t\t\t\tconst where = confineCall(cwd, args);","atom":"a149","author":"pinch","version":21},{"n":226,"text":"\t\t\t\tif (\"refused\" in where) return reply(id, { content: [{ type: \"text\", text: where.refused }], isError: true });","atom":"a149","author":"pinch","version":21},{"n":227,"text":"\t\t\t\tconst folder = where.folder;","atom":"a149","author":"pinch","version":21},{"n":228,"text":"\t\t\t\tlet streamed = \"\";","atom":"a0","author":"init","version":0},{"n":229,"text":"\t\t\t\tconst result = await main(argvFor(command, args), {","atom":"a0","author":"init","version":0},{"n":230,"text":"\t\t\t\t\tcwd: folder,","atom":"a0","author":"init","version":0},{"n":231,"text":"\t\t\t\t\tenv,","atom":"a0","author":"init","version":0},{"n":232,"text":"\t\t\t\t\twrite: (t) => (streamed += t),","atom":"a0","author":"init","version":0},{"n":233,"text":"\t\t\t\t\twriteErr: (t) => (streamed += t),","atom":"a0","author":"init","version":0},{"n":234,"text":"\t\t\t\t});","atom":"a0","author":"init","version":0},{"n":235,"text":"\t\t\t\t// Text only: Claude Code shows the model structuredContent in place of the text when both are there,","atom":"a0","author":"init","version":0},{"n":236,"text":"\t\t\t\t// and the point is the command line's words. json: true answers with the JSON instead.","atom":"a0","author":"init","version":0},{"n":237,"text":"\t\t\t\tconst text =","atom":"a0","author":"init","version":0},{"n":238,"text":"\t\t\t\t\targs.json === true && result.data","atom":"a0","author":"init","version":0},{"n":239,"text":"\t\t\t\t\t\t? JSON.stringify({ ...result.data, exit: result.exit }, null, 2)","atom":"a0","author":"init","version":0},{"n":240,"text":"\t\t\t\t\t\t: [streamed, result.stdout, result.stderr]","atom":"a0","author":"init","version":0},{"n":241,"text":"\t\t\t\t\t\t\t\t.map((t) => t.replace(/\\n+$/, \"\"))","atom":"a0","author":"init","version":0},{"n":242,"text":"\t\t\t\t\t\t\t\t.filter((t) => t !== \"\")","atom":"a0","author":"init","version":0},{"n":243,"text":"\t\t\t\t\t\t\t\t.join(\"\\n\");","atom":"a0","author":"init","version":0},{"n":244,"text":"\t\t\t\treturn reply(id, {","atom":"a0","author":"init","version":0},{"n":245,"text":"\t\t\t\t\tcontent: [{ type: \"text\", text: text === \"\" ? \"(no output)\" : text }],","atom":"a0","author":"init","version":0},{"n":246,"text":"\t\t\t\t\t// Exit 1 is a failure; 2 (refused) and 3 (still queued) are answers the text explains.","atom":"a0","author":"init","version":0},{"n":247,"text":"\t\t\t\t\tisError: result.exit === 1,","atom":"a0","author":"init","version":0},{"n":248,"text":"\t\t\t\t});","atom":"a0","author":"init","version":0},{"n":249,"text":"\t\t\t}","atom":"a0","author":"init","version":0},{"n":250,"text":"\t\t\tdefault:","atom":"a0","author":"init","version":0},{"n":251,"text":"\t\t\t\t// Notifications (no id) need no answer; an unknown request does.","atom":"a0","author":"init","version":0},{"n":252,"text":"\t\t\t\tif (isRequest) fail(id, -32601, `abso mcp doesn't know ${JSON.stringify(method)}`);","atom":"a0","author":"init","version":0},{"n":253,"text":"\t\t}","atom":"a0","author":"init","version":0},{"n":254,"text":"\t};","atom":"a0","author":"init","version":0},{"n":255,"text":"","atom":"a0","author":"init","version":0},{"n":256,"text":"\tlet buffer = \"\";","atom":"a0","author":"init","version":0},{"n":257,"text":"\tfor await (const chunk of input) {","atom":"a0","author":"init","version":0},{"n":258,"text":"\t\tbuffer += typeof chunk === \"string\" ? chunk : chunk.toString(\"utf8\");","atom":"a0","author":"init","version":0},{"n":259,"text":"\t\tlet nl: number;","atom":"a0","author":"init","version":0},{"n":260,"text":"\t\twhile ((nl = buffer.indexOf(\"\\n\")) >= 0) {","atom":"a0","author":"init","version":0},{"n":261,"text":"\t\t\tconst line = buffer.slice(0, nl).trim();","atom":"a0","author":"init","version":0},{"n":262,"text":"\t\t\tbuffer = buffer.slice(nl + 1);","atom":"a0","author":"init","version":0},{"n":263,"text":"\t\t\tif (line === \"\") continue;","atom":"a0","author":"init","version":0},{"n":264,"text":"\t\t\tlet msg: Message;","atom":"a0","author":"init","version":0},{"n":265,"text":"\t\t\ttry {","atom":"a0","author":"init","version":0},{"n":266,"text":"\t\t\t\tmsg = JSON.parse(line) as Message;","atom":"a0","author":"init","version":0},{"n":267,"text":"\t\t\t} catch {","atom":"a0","author":"init","version":0},{"n":268,"text":"\t\t\t\tfail(null, -32700, \"not JSON\");","atom":"a0","author":"init","version":0},{"n":269,"text":"\t\t\t\tcontinue;","atom":"a0","author":"init","version":0},{"n":270,"text":"\t\t\t}","atom":"a0","author":"init","version":0},{"n":271,"text":"\t\t\tqueue = queue","atom":"a0","author":"init","version":0},{"n":272,"text":"\t\t\t\t.then(() => handle(msg))","atom":"a0","author":"init","version":0},{"n":273,"text":"\t\t\t\t.catch((e: unknown) => fail(msg.id, -32603, e instanceof Error ? e.message : String(e)));","atom":"a0","author":"init","version":0},{"n":274,"text":"\t\t}","atom":"a0","author":"init","version":0},{"n":275,"text":"\t}","atom":"a0","author":"init","version":0},{"n":276,"text":"\tawait queue;","atom":"a0","author":"init","version":0},{"n":277,"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":"a82","author":"review","message":"","time":1791520995119,"timeIso":"2026-10-09T04:43:15.119Z","publish":{"draft":null,"version":16,"agent":"review","message":"The client says abso, not avcs, in everything a person reads: the hints after an issue view and abso issue new, the help for issue, issues, ask, answer and waiting, the 'abso:' prefix on notices from run, publish --check, the queue and serve, the 'News from abso' header, the MCP server's name and the claude mcp add example, and the view mod's status line. Only printed words changed: file and folder names (avcs.json, .avcs/, ~/.avcs/token), environment variables and wire headers are as they were, and the tests were updated to the new words (704 pass, biome ci clean).","time":1791521002669,"timeIso":"2026-10-09T04:43:22.669Z"}},{"atom":"a146","author":"devops","message":"","time":1791528389952,"timeIso":"2026-10-09T06:46:29.952Z","publish":{"draft":null,"version":20,"agent":"devops","message":"Add abso search: find a project's issues by words or meaning\n\n`abso search \"<words>\" [--limit <N>]` lists the project's issues that\nmatch, best first, and is served as an MCP tool as well.\n\n- Each hit shows the issue, then where it matched: the title, the\n  description, a comment, or \"by meaning\".\n- \"#N\" or \"N\" puts issue N first.\n- Where the server also searches by meaning, an issue worded unlike\n  the search still turns up; the hit says so.","time":1791528391686,"timeIso":"2026-10-09T06:46:31.686Z"}},{"atom":"a149","author":"pinch","message":"","time":1791528445601,"timeIso":"2026-10-09T06:47:25.601Z","publish":{"draft":null,"version":21,"agent":"pinch","message":"MCP tools stay inside the folder the server started in. A tool call's folder, and each file the issue tool's attach names, must be that folder or inside it. A relative path that climbs out (..), an absolute path elsewhere, or a link that leads out is refused with a plain message, so no tool reads a file outside the project. The text flags' -file twins were never served as tool inputs, and a test now keeps it that way.\n\nAlso: abso login, box and logout outside an abso folder act on https://api.abso.dev when --server isn't given, so a fresh machine can run abso login bare. Inside a folder they still use the folder's server.","time":1791528460170,"timeIso":"2026-10-09T06:47:40.170Z"}},{"atom":"a155","author":"pinch","message":"","time":1791528779455,"timeIso":"2026-10-09T06:52:59.455Z","publish":{"draft":null,"version":22,"agent":"pinch","message":"abso skill install: the abso skill for Claude Code now comes with the client. It writes ~/.claude/skills/abso/SKILL.md (--dir names another skills folder), says when the copy there is already current, and touches nothing else in the folder. abso skill show prints it.\n\nThe skill tells an agent how to work in an abso folder (sync, start, publish, settle, issues and asks) and what never to share. It's instructions only: it names no tools to allow, and installing it changes no settings. Its source is client/skills/abso/SKILL.md; the client carries the same text, and a test keeps the two equal, so the one-file client includes it. The client README gains a section on it, and its MCP section now says a tool call stays inside the folder the server started in.","time":1791528783181,"timeIso":"2026-10-09T06:53:03.181Z"}},{"atom":"a161","author":"pinch","message":"","time":1791529348322,"timeIso":"2026-10-09T07:02:28.322Z","publish":{"draft":null,"version":23,"agent":"pinch","message":"abso issue <N> --copy-to <project>: copy an issue into another project, with its comments, answered asks and labels, each keeping its author and time. The Issues server reads the source issue itself; the client sends only which issue, and any cleaned texts.\n\n- --dry-run shows what the copy would make (title, how many comments and asks, which were edited, labels) and what's left behind. It writes nothing.\n- --clean <file> gives cleaned texts by source id, as JSON: {title, description, comments: [{id, text}], asks: [{id, question, answer}]}. A comment left out of a given list isn't copied.\n- --copy-to goes alone, so a copy is never half an edit. Copying into the project the issue is already in is refused before any call.\n- When a live server refuses the copy (copying out of a project there takes an owner of it), the message says --dry-run still works.\n- The MCP issue tool's clean input is a file too, so it's confined to the server's start folder like attach.\n\nTests: client/test/issues.test.ts, against a stand-in Issues server. The run --parallel test that sometimes times out under a full run passed when rerun.","time":1791530025571,"timeIso":"2026-10-09T07:13:45.571Z"}},{"atom":"a213","author":"review","message":"","time":1791533506483,"timeIso":"2026-10-09T08:11:46.483Z","publish":{"draft":null,"version":27,"agent":"review","message":"Client: ABSO_ environment names (AVCS_ still read), .absoignore (.avcsignore still read), .abso-export.json, shot files; READMEs say abso (abso 224)","time":1791533840174,"timeIso":"2026-10-09T08:17:20.174Z"}},{"atom":"a249","author":"pinch","message":"","time":1791539259589,"timeIso":"2026-10-09T09:47:39.589Z","publish":{"draft":null,"version":29,"agent":"pinch","message":"Client: abso issue N --save-attachments <dir> saves each attachment on an issue and its comments once (an SVG's own file beside its drawing), outside the abso folder unless the place is ignored; MCP confines the folder like attach. abso export now stamps its folder with .abso-export, one line of JSON in a file with no extension, so the exported project's own formatter and linter pass it by; a folder stamped .abso-export.json or .avcs-export.json still counts as an export.","time":1791540340754,"timeIso":"2026-10-09T10:05:40.754Z"}},{"atom":"a291","author":"pinch","message":"","time":1791543389649,"timeIso":"2026-10-09T10:56:29.649Z","publish":{"draft":null,"version":34,"agent":"pinch","message":"Client: abso orgs and abso org <name>, reading as the person who approved this box's sign-in (abso login): your organizations and roles, invitations waiting for you, and an org's projects, people (by name, never id), settings and open invites. Changes (--invite, --role, --remove, --leave, --members, --projects-by), abso org new and abso init --org are made on the website for now; each says where and sends nothing. One change at a time. MCP serves orgs and org. Client tests 283/283, tsc and biome clean.","time":1791543392927,"timeIso":"2026-10-09T10:56:32.927Z"}},{"atom":"a483","author":"pinch","message":"","time":1791583010910,"timeIso":"2026-10-09T21:56:50.910Z","publish":{"draft":null,"version":53,"agent":"pinch","message":"abso ack <ask> [\"note\"]: the one asked says they have an ask and will answer later. The ask stays open and keeps blocking; abso issue shows it as acknowledged with the note, and the asker hears it. The Ask wire type gains ack, the API client gains ack(), and the skill mentions the command.","time":1791583024285,"timeIso":"2026-10-09T21:57:04.285Z"}},{"atom":"a656","author":"speed","message":"","time":1791608390071,"timeIso":"2026-10-10T04:59:50.071Z","publish":{"draft":null,"version":71,"agent":"speed","message":"Help text: abso mcp's line gives the install command for an npm install (claude mcp add abso -- abso mcp, or cmd /c abso mcp on Windows), the unknown-command answer lists mcp, and the help no longer cites internal tracker numbers.","time":1791608390305,"timeIso":"2026-10-10T04:59:50.305Z"}},{"atom":"a662","author":"pinch","message":"","time":1791609963115,"timeIso":"2026-10-10T05:26:03.115Z","publish":{"draft":null,"version":72,"agent":"pinch","message":"Asks become threads: abso reply <ask> \"...\" adds to an ask from either side, open or answered, and --question hands the turn to the asker until they reply. abso ask <N> shows one ask with its whole thread and whose turn it is; abso waiting --asked lists the asks you sent. An ack's note is the thread's first reply. reply is an MCP tool too. Needs an Issues server with the reply, ask and asked routes.","time":1791609984916,"timeIso":"2026-10-10T05:26:24.916Z"}},{"atom":"a682","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":"a845","author":"rename","message":"","time":1791659799126,"timeIso":"2026-10-10T19:16:39.126Z","publish":{"draft":null,"version":100,"agent":"rename","message":"abso publish is now abso push, abso sync is now abso pull (abso 427)\n\nCommands, 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.\n\npush -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.\n\nKept as stored: log entry kinds (publish, sync, pulled), HTTP route paths, the pipeline trigger on: publish, the yours (unpublished) marker, npm-publish.","time":1791659833853,"timeIso":"2026-10-10T19:17:13.853Z"}},{"atom":"a2613","author":"groups","message":"","time":1792091089931,"timeIso":"2026-10-15T19:04:49.931Z","publish":{"draft":null,"version":256,"agent":"groups","message":"groups: abso groups and abso group, for a project's named groups of agents and people with one shared history. abso group <name> reads its settings, members and history (newest first; --before, --limit, --kind). --post adds a message, with news for every other member unless --news names some, --except leaves some out, or --news none keeps it in the history only. --join, --leave, --add, --remove, --rename, --private on|off and --joinable on|off change it; abso group new makes one. A retried post never posts twice (the Idempotency-Key every POST sends). Both are MCP tools; a visitor folder refuses them. Tests: client/test/group-commands.test.ts, visitor.test.ts.","time":1792091364906,"timeIso":"2026-10-15T19:09:24.906Z"}},{"atom":"a2714","author":"readspeed","message":"","time":1792101952909,"timeIso":"2026-10-15T22:05:52.909Z","publish":{"draft":null,"version":271,"agent":"readspeed","message":"No command picks up a credential from a file nobody asked for\n\nFollows \"abso init signs in with the box sign-in\" (issue 25), and applies it to every command.\n\n- 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.\n- 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.\n- 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.\n\nWhat 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).\n\nTests: client/test/token-file.test.ts (3, new); client/test/client.test.ts's MCP check covers --token-file. All client tests pass (443).","time":1792101955290,"timeIso":"2026-10-15T22:05:55.290Z"}}]}