{"path":"client/src/issues.ts","version":318,"newest":318,"draft":null,"agent":null,"exists":true,"lines":[{"n":1,"text":"// Issues (#54): abso issues, abso issue, abso ask, abso waiting and avcs","author":"review","version":16},{"n":2,"text":"// answer. The Issues Worker keeps them (avcs-issues beside avcs, or","author":"init","version":0},{"n":3,"text":"// ABSO_ISSUES_SERVER), and takes the same token. Statuses come from the work: a start note naming","author":"review","version":27},{"n":4,"text":"// an issue (abso start --issue N) puts it In progress, an open ask Blocked or","author":"review","version":16},{"n":5,"text":"// In review, and publish --done closes it. Other agents' and people's words","author":"init","version":0},{"n":6,"text":"// are quoted as JSON, so none can print as another line (#30).","author":"init","version":0},{"n":7,"text":"","author":"init","version":0},{"n":8,"text":"import { mkdirSync, readFileSync, statSync, writeFileSync } from \"node:fs\";","author":"pinch","version":29},{"n":9,"text":"import { basename, join, resolve } from \"node:path\";","author":"pinch","version":29},{"n":10,"text":"import {","author":"pinch","version":23},{"n":11,"text":"\ttype Api,","author":"pinch","version":23},{"n":12,"text":"\tApiError,","author":"pinch","version":23},{"n":13,"text":"\ttype Ask,","author":"pinch","version":23},{"n":14,"text":"\ttype Attachment,","author":"pinch","version":23},{"n":15,"text":"\ttype CopyAnswer,","author":"pinch","version":23},{"n":16,"text":"\ttype CopyBody,","author":"pinch","version":23},{"n":17,"text":"\ttype Draft,","author":"pinch","version":23},{"n":18,"text":"\ttype DraftBody,","author":"pinch","version":23},{"n":19,"text":"\ttype IssuePage,","author":"pinch","version":23},{"n":20,"text":"\ttype IssueRow,","author":"pinch","version":23},{"n":21,"text":"\ttype IssueSearchHit,","author":"pinch","version":23},{"n":22,"text":"} from \"./api.ts\";","author":"pinch","version":23},{"n":23,"text":"import { bool, type Parsed, str, UsageError } from \"./args.ts\";","author":"init","version":0},{"n":24,"text":"import { type Env, type Output, open, plural } from \"./commands.ts\";","author":"init","version":0},{"n":25,"text":"import { type Config, readMachineServers, trustedServers } from \"./config.ts\";","author":"init","version":0},{"n":26,"text":"import { issuesServerFor, tokenGoesToIssues } from \"./core.ts\";","author":"trials","version":151},{"n":27,"text":"import { fromEnv } from \"./env-names.ts\";","author":"review","version":27},{"n":28,"text":"import { ignoredHere } from \"./fetch.ts\";","author":"pinch","version":29},{"n":29,"text":"import { loadIgnore, relativeTo } from \"./folder.ts\";","author":"pinch","version":29},{"n":30,"text":"import type { AskReply } from \"./issues-wire.ts\";","author":"pinch","version":72},{"n":31,"text":"import { isLocal, LOCAL_BASE } from \"./local-store.ts\";","author":"pinch","version":294},{"n":32,"text":"import { queuedLines, standing } from \"./queue.ts\";","author":"pinch","version":36},{"n":33,"text":"import { seenText, shortWhen } from \"./times.ts\";","author":"init","version":0},{"n":34,"text":"","author":"init","version":0},{"n":35,"text":"const q = (s: string): string => JSON.stringify(s);","author":"init","version":0},{"n":36,"text":"","author":"init","version":0},{"n":37,"text":"/** The folder, with its Api pointed at the Issues Worker: the token goes only where tokenGoesTo allows, as for the avcs server. */","author":"init","version":0},{"n":38,"text":"export function openIssues(env: Env): { root: string; config: Config; api: Api } {","author":"groups","version":256},{"n":39,"text":"\tconst { root, config, api } = open(env);","author":"pinch","version":29},{"n":40,"text":"\t// A local project's issues are in its store, where the open server keeps them: at /issues.","author":"pinch","version":294},{"n":41,"text":"\tif (isLocal(config.server)) {","author":"pinch","version":294},{"n":42,"text":"\t\tapi.issuesServer = `${LOCAL_BASE}/issues`;","author":"pinch","version":294},{"n":43,"text":"\t\treturn { root, config, api };","author":"pinch","version":294},{"n":44,"text":"\t}","author":"pinch","version":294},{"n":45,"text":"\t// An explicit --server goes to that server's own Issues Worker: ABSO_ISSUES_SERVER doesn't redirect it.","author":"speed","version":155},{"n":46,"text":"\tconst server =","author":"speed","version":155},{"n":47,"text":"\t\t(env.server === undefined ? fromEnv(env.env, \"ISSUES_SERVER\") : undefined) ||","author":"speed","version":155},{"n":48,"text":"\t\tissuesServerFor(config.server, readMachineServers(env.env));","author":"speed","version":155},{"n":49,"text":"\tif (server === undefined)","author":"init","version":0},{"n":50,"text":"\t\tthrow new UsageError(","author":"init","version":0},{"n":51,"text":"\t\t\t`${config.server} has no Issues Worker beside it that abso knows; ~/.abso/servers.json or ABSO_ISSUES_SERVER names one`,","author":"review","version":27},{"n":52,"text":"\t\t);","author":"init","version":0},{"n":53,"text":"\tif (config.token !== undefined && !tokenGoesToIssues(server, trustedServers(env.env))) {","author":"trials","version":151},{"n":54,"text":"\t\tthrow new UsageError(","author":"init","version":0},{"n":55,"text":"\t\t\t`the Issues Worker is ${server}, and abso sends your token only to its own servers and this machine. If ${server} is yours, name it in ~/.abso/servers.json or ABSO_TRUSTED_SERVERS.`,","author":"review","version":27},{"n":56,"text":"\t\t);","author":"init","version":0},{"n":57,"text":"\t}","author":"init","version":0},{"n":58,"text":"\tapi.issuesServer = server;","author":"init","version":0},{"n":59,"text":"\treturn { root, config, api };","author":"pinch","version":29},{"n":60,"text":"}","author":"init","version":0},{"n":61,"text":"","author":"init","version":0},{"n":62,"text":"function issueNumber(word: string | undefined, what = \"an issue number\"): number {","author":"init","version":0},{"n":63,"text":"\tif (word === undefined || !/^#?\\d+$/.test(word)) throw new UsageError(`${what} is a number, like 12`);","author":"init","version":0},{"n":64,"text":"\treturn Number(word.replace(\"#\", \"\"));","author":"init","version":0},{"n":65,"text":"}","author":"init","version":0},{"n":66,"text":"","author":"init","version":0},{"n":67,"text":"/** One issue as a line. */","author":"init","version":0},{"n":68,"text":"export function issueLine(i: IssueRow): string {","author":"init","version":0},{"n":69,"text":"\tconst detail = [","author":"init","version":0},{"n":70,"text":"\t\ti.agent !== null && !i.agents.includes(i.agent) ? `for ${i.agent}` : \"\",","author":"init","version":0},{"n":71,"text":"\t\ti.agents.length > 0 ? i.agents.join(\", \") : \"\",","author":"init","version":0},{"n":72,"text":"\t\ti.blockedBy.length > 0 ? `blocked by ${i.blockedBy.join(\", \")}` : \"\",","author":"init","version":0},{"n":73,"text":"\t\t(i.labels ?? []).length > 0 ? `labels ${i.labels.join(\", \")}` : \"\",","author":"init","version":0},{"n":74,"text":"\t\ti.versions.length > 0 ? `${i.versions.length === 1 ? \"version\" : \"versions\"} ${i.versions.join(\", \")}` : \"\",","author":"init","version":0},{"n":75,"text":"\t\ti.waitingOn.length > 0 ? `waiting on ${i.waitingOn.join(\", \")}` : \"\",","author":"init","version":0},{"n":76,"text":"\t\ti.parent !== null ? `under ${i.parent}` : \"\",","author":"init","version":0},{"n":77,"text":"\t\ti.children > 0 ? plural(i.children, \"sub-issue\") : \"\",","author":"init","version":0},{"n":78,"text":"\t\t`updated ${shortWhen(i.updated)}`,","author":"init","version":0},{"n":79,"text":"\t].filter((d) => d !== \"\");","author":"init","version":0},{"n":80,"text":"\treturn `  ${String(i.id).padStart(3)}  ${i.status.padEnd(11)}  ${q(i.title)}${detail.length > 0 ? ` (${detail.join(\"; \")})` : \"\"}`;","author":"init","version":0},{"n":81,"text":"}","author":"init","version":0},{"n":82,"text":"","author":"init","version":0},{"n":83,"text":"/** The first line of a reply, for lists; abso ask <N> shows it whole. */","author":"pinch","version":72},{"n":84,"text":"const firstLine = (text: string): string => {","author":"pinch","version":72},{"n":85,"text":"\tconst line = text.split(\"\\n\")[0]!;","author":"pinch","version":72},{"n":86,"text":"\treturn line.length < text.length ? `${line} ...` : line;","author":"pinch","version":72},{"n":87,"text":"};","author":"pinch","version":72},{"n":88,"text":"","author":"pinch","version":72},{"n":89,"text":"/** One reply in an ask's thread. */","author":"pinch","version":72},{"n":90,"text":"function replyLine(r: AskReply, indent: string, whole: boolean): string {","author":"pinch","version":72},{"n":91,"text":"\treturn `${indent}${r.by}, ${shortWhen(r.at)}${r.question ? \", a question\" : \"\"}: ${q(whole ? r.text : firstLine(r.text))}`;","author":"pinch","version":72},{"n":92,"text":"}","author":"pinch","version":72},{"n":93,"text":"","author":"pinch","version":72},{"n":94,"text":"/**","author":"pinch","version":72},{"n":95,"text":" * An ask: its head line, its files and options, then, in a list, its newest reply, or with `thread`, every","author":"pinch","version":72},{"n":96,"text":" * reply, oldest first; then its answer. Older servers send no thread, only the one asked's acknowledgement.","author":"pinch","version":72},{"n":97,"text":" */","author":"pinch","version":72},{"n":98,"text":"function askLine(a: Ask & { title?: string | null }, api?: Pick<Api, \"attachmentUrl\">, thread = false): string {","author":"pinch","version":72},{"n":99,"text":"\tconst what = a.review ? \"a review\" : a.kind === \"task\" ? \"a task\" : \"a question\";","author":"init","version":0},{"n":100,"text":"\tconst where = a.issue === null ? \"\" : ` on issue ${a.issue}${a.title ? ` (${q(a.title)})` : \"\"}`;","author":"init","version":0},{"n":101,"text":"\tconst replies = a.replies;","author":"pinch","version":72},{"n":102,"text":"\tconst extra = [","author":"init","version":0},{"n":103,"text":"\t\t// Who answered, and when, on the ask's own line, so a handled ask can't pass for an open one.","author":"init","version":0},{"n":104,"text":"\t\ta.answer","author":"infra-split","version":14},{"n":105,"text":"\t\t\t? `${a.outcome === \"withdrawn\" ? \"withdrawn\" : \"answered\"} by ${a.answer.by}, ${shortWhen(a.answer.at)}`","author":"infra-split","version":14},{"n":106,"text":"\t\t\t: \"\",","author":"infra-split","version":14},{"n":107,"text":"\t\t!a.answer && a.ack && replies === undefined ? `acknowledged ${shortWhen(a.ack.at)}, not answered yet` : \"\",","author":"pinch","version":72},{"n":108,"text":"\t\t!a.answer && !a.ack && a.seen !== undefined ? seenText(a.seen) : \"\",","author":"pinch","version":53},{"n":109,"text":"\t\treplies && replies.length > 0 ? (replies.length === 1 ? \"1 reply\" : `${replies.length} replies`) : \"\",","author":"pinch","version":72},{"n":110,"text":"\t\t// Whose turn it is, when it isn't the one asked's: they asked something back.","author":"pinch","version":72},{"n":111,"text":"\t\t!a.answer && a.waitingOn && a.waitingOn !== a.of ? `waiting on ${a.waitingOn}` : \"\",","author":"pinch","version":72},{"n":112,"text":"\t\ta.due ? `due ${a.due}` : \"\",","author":"init","version":0},{"n":113,"text":"\t\ta.blocks.length > 0 ? `blocks ${a.blocks.join(\", \")}` : \"\",","author":"init","version":0},{"n":114,"text":"\t].filter((x) => x !== \"\");","author":"init","version":0},{"n":115,"text":"\tconst head = `  ask ${a.id}: ${a.by}, ${shortWhen(a.at)}, asks ${a.of} ${what}${where}${extra.length > 0 ? ` (${extra.join(\"; \")})` : \"\"}: ${q(a.question)}`;","author":"init","version":0},{"n":116,"text":"\tconst lines = [head, ...attachmentLines(api, a.attachments, \"    \")];","author":"pinch","version":35},{"n":117,"text":"\tif (a.options.length > 0) lines.push(`    options: ${a.options.map((o, i) => `${i + 1}. ${q(o)}`).join(\", \")}`);","author":"init","version":0},{"n":118,"text":"\tif (a.recommendation) lines.push(`    ${a.recommendation.by} recommends: ${q(a.recommendation.text)}`);","author":"init","version":0},{"n":119,"text":"\tif (replies === undefined) {","author":"pinch","version":72},{"n":120,"text":"\t\tif (!a.answer && a.ack && a.ack.note !== \"\") lines.push(`    ${a.of} acknowledged: ${q(a.ack.note)}`);","author":"pinch","version":72},{"n":121,"text":"\t} else if (thread) lines.push(...replies.map((r) => replyLine(r, \"    \", true)));","author":"pinch","version":72},{"n":122,"text":"\telse if (replies.length > 0) lines.push(replyLine(replies[replies.length - 1]!, \"    last: \", false));","author":"pinch","version":72},{"n":123,"text":"\tif (a.answer && a.outcome === \"withdrawn\") {","author":"infra-split","version":14},{"n":124,"text":"\t\tif (a.answer.words !== \"\") lines.push(`    why: ${q(a.answer.words)}`);","author":"infra-split","version":14},{"n":125,"text":"\t} else if (a.answer)","author":"pinch","version":35},{"n":126,"text":"\t\tlines.push(`    answer: ${q(a.answer.words)}`, ...attachmentLines(api, a.answer.attachments, \"      \"));","author":"pinch","version":35},{"n":127,"text":"\treturn lines.join(\"\\n\");","author":"init","version":0},{"n":128,"text":"}","author":"init","version":0},{"n":129,"text":"","author":"init","version":0},{"n":130,"text":"/** One edit in an issue's activity: what changed, and who was told. */","author":"init","version":0},{"n":131,"text":"function editLine(e: IssuePage[\"edits\"][number]): string {","author":"init","version":0},{"n":132,"text":"\tconst c = e.changes;","author":"init","version":0},{"n":133,"text":"\tconst said = [","author":"init","version":0},{"n":134,"text":"\t\tc.title ? `title ${q(String(c.title.from))} to ${q(String(c.title.to))}` : \"\",","author":"init","version":0},{"n":135,"text":"\t\tc.description ? \"the description\" : \"\",","author":"init","version":0},{"n":136,"text":"\t\tc.parent ? (c.parent.to === null ? \"no parent\" : `parent issue ${String(c.parent.to)}`) : \"\",","author":"init","version":0},{"n":137,"text":"\t\tc.agent ? (c.agent.to === null ? \"no Agent\" : `Agent ${String(c.agent.to)}`) : \"\",","author":"init","version":0},{"n":138,"text":"\t\tc.blockedBy","author":"init","version":0},{"n":139,"text":"\t\t\t? (c.blockedBy.to as number[]).length === 0","author":"init","version":0},{"n":140,"text":"\t\t\t\t? \"blocked by nothing\"","author":"init","version":0},{"n":141,"text":"\t\t\t\t: `blocked by ${(c.blockedBy.to as number[]).join(\", \")}`","author":"init","version":0},{"n":142,"text":"\t\t\t: \"\",","author":"init","version":0},{"n":143,"text":"\t\tc.labels","author":"init","version":0},{"n":144,"text":"\t\t\t? (c.labels.to as string[]).length === 0","author":"init","version":0},{"n":145,"text":"\t\t\t\t? \"no labels\"","author":"init","version":0},{"n":146,"text":"\t\t\t\t: `labels ${(c.labels.to as string[]).join(\", \")}`","author":"init","version":0},{"n":147,"text":"\t\t\t: \"\",","author":"init","version":0},{"n":148,"text":"\t].filter((x) => x !== \"\");","author":"init","version":0},{"n":149,"text":"\treturn `  ${e.by}, ${shortWhen(e.at)}: ${said.join(\"; \")} (${e.notified.length > 0 ? `told ${e.notified.join(\", \")}` : \"told nobody\"})`;","author":"init","version":0},{"n":150,"text":"}","author":"init","version":0},{"n":151,"text":"","author":"init","version":0},{"n":152,"text":"/** Labels as typed, lower-cased, since the Worker refuses upper case: --label Friction means friction. */","author":"infra-split","version":37},{"n":153,"text":"function labelList(value: string): string[] {","author":"init","version":0},{"n":154,"text":"\treturn listOf(value).map((l) => l.toLowerCase());","author":"init","version":0},{"n":155,"text":"}","author":"init","version":0},{"n":156,"text":"","author":"init","version":0},{"n":157,"text":"/** A comma-separated list of names or issue numbers; \"none\" is the empty list. */","author":"init","version":0},{"n":158,"text":"function listOf(value: string): string[] {","author":"init","version":0},{"n":159,"text":"\treturn value.trim() === \"none\"","author":"init","version":0},{"n":160,"text":"\t\t? []","author":"init","version":0},{"n":161,"text":"\t\t: value","author":"init","version":0},{"n":162,"text":"\t\t\t\t.split(\",\")","author":"init","version":0},{"n":163,"text":"\t\t\t\t.map((v) => v.trim())","author":"init","version":0},{"n":164,"text":"\t\t\t\t.filter((v) => v !== \"\");","author":"init","version":0},{"n":165,"text":"}","author":"init","version":0},{"n":166,"text":"","author":"init","version":0},{"n":167,"text":"/** \" with 2 attachments (a…, a…)\" after a write that carried some; nothing otherwise. */","author":"pinch","version":35},{"n":168,"text":"function withFiles(ids: readonly string[]): string {","author":"pinch","version":35},{"n":169,"text":"\treturn ids.length > 0 ? ` with ${plural(ids.length, \"attachment\")} (${ids.join(\", \")})` : \"\";","author":"pinch","version":35},{"n":170,"text":"}","author":"pinch","version":35},{"n":171,"text":"","author":"pinch","version":35},{"n":172,"text":"/**","author":"pinch","version":35},{"n":173,"text":" * What to say when a write sent files the server didn't keep: an Issues server from before asks carried","author":"pinch","version":35},{"n":174,"text":" * attachments takes the words and leaves the files out. Nothing to say when it kept them, or none were sent.","author":"pinch","version":35},{"n":175,"text":" */","author":"pinch","version":35},{"n":176,"text":"function notKept(sent: readonly string[], kept: readonly string[] | undefined, what: string): string | undefined {","author":"pinch","version":35},{"n":177,"text":"\tif (sent.length === 0 || (kept !== undefined && sent.every((id) => kept.includes(id)))) return undefined;","author":"pinch","version":35},{"n":178,"text":"\treturn `The Issues server didn't keep the ${sent.length === 1 ? \"file\" : \"files\"} on ${what}: it is older than this client. The words went; the ${sent.length === 1 ? \"file goes\" : \"files go\"} on a comment instead (abso issue <N> --comment \"...\" --attach ...).`;","author":"pinch","version":35},{"n":179,"text":"}","author":"pinch","version":35},{"n":180,"text":"","author":"pinch","version":35},{"n":181,"text":"/** The most one attachment may be: the Issues Worker's cap, checked here before sending (abso issue 171). */","author":"pinch","version":5},{"n":182,"text":"const ATTACH_MAX = 10 * 1024 * 1024;","author":"pinch","version":5},{"n":183,"text":"","author":"pinch","version":5},{"n":184,"text":"/** Uploads each file --attach names (comma-separated), in order, and answers their ids. Nothing is sent if a file is missing or too big. */","author":"pinch","version":5},{"n":185,"text":"async function uploadAttachments(api: Api, cwd: string, value: string | undefined): Promise<string[]> {","author":"pinch","version":5},{"n":186,"text":"\tif (value === undefined) return [];","author":"pinch","version":5},{"n":187,"text":"\tconst paths = listOf(value);","author":"pinch","version":5},{"n":188,"text":"\tif (paths.length === 0) throw new UsageError(\"--attach names files, comma-separated: --attach shot.png,after.png\");","author":"pinch","version":5},{"n":189,"text":"\tconst files = paths.map((p) => {","author":"pinch","version":5},{"n":190,"text":"\t\tconst full = resolve(cwd, p);","author":"pinch","version":5},{"n":191,"text":"\t\tlet size: number;","author":"pinch","version":5},{"n":192,"text":"\t\ttry {","author":"pinch","version":5},{"n":193,"text":"\t\t\tsize = statSync(full).size;","author":"pinch","version":5},{"n":194,"text":"\t\t} catch {","author":"pinch","version":5},{"n":195,"text":"\t\t\tthrow new UsageError(`--attach ${p}: no such file`);","author":"pinch","version":5},{"n":196,"text":"\t\t}","author":"pinch","version":5},{"n":197,"text":"\t\tif (size > ATTACH_MAX)","author":"pinch","version":5},{"n":198,"text":"\t\t\tthrow new UsageError(`--attach ${p} is ${sizeText(size)}; one attachment is at most ${sizeText(ATTACH_MAX)}`);","author":"pinch","version":5},{"n":199,"text":"\t\treturn { full, name: basename(full) };","author":"pinch","version":5},{"n":200,"text":"\t});","author":"pinch","version":5},{"n":201,"text":"\tconst ids: string[] = [];","author":"pinch","version":5},{"n":202,"text":"\tfor (const f of files) ids.push((await api.attachmentUpload(readFileSync(f.full), f.name)).id);","author":"pinch","version":5},{"n":203,"text":"\treturn ids;","author":"pinch","version":5},{"n":204,"text":"}","author":"pinch","version":5},{"n":205,"text":"","author":"pinch","version":5},{"n":206,"text":"function sizeText(n: number): string {","author":"pinch","version":5},{"n":207,"text":"\treturn n < 1024 ? `${n} B` : n < 1024 * 1024 ? `${Math.round(n / 1024)} KB` : `${(n / (1024 * 1024)).toFixed(1)} MB`;","author":"pinch","version":5},{"n":208,"text":"}","author":"pinch","version":5},{"n":209,"text":"","author":"pinch","version":5},{"n":210,"text":"/** Attachments as lines under what carries them: name, size and where it's served. */","author":"pinch","version":5},{"n":211,"text":"function attachmentLines(","author":"pinch","version":5},{"n":212,"text":"\tapi: Pick<Api, \"attachmentUrl\"> | undefined,","author":"pinch","version":5},{"n":213,"text":"\tfiles: readonly Attachment[] | undefined,","author":"pinch","version":5},{"n":214,"text":"\tindent: string,","author":"pinch","version":5},{"n":215,"text":"): string[] {","author":"pinch","version":5},{"n":216,"text":"\treturn (files ?? []).flatMap((a) => [","author":"pinch","version":24},{"n":217,"text":"\t\t`${indent}attached ${a.id}: ${q(a.name)}, ${sizeText(a.size)}${api ? `, ${api.attachmentUrl(a.id)}` : \"\"}`,","author":"pinch","version":24},{"n":218,"text":"\t\t// An SVG is shown as the PNG drawn from it; its own file is a download beside it.","author":"pinch","version":24},{"n":219,"text":"\t\t...(a.source","author":"pinch","version":24},{"n":220,"text":"\t\t\t? [","author":"pinch","version":24},{"n":221,"text":"\t\t\t\t\t`${indent}  drawn from ${q(a.source.name)}, ${sizeText(a.source.size)}${api ? `, ${api.attachmentUrl(a.id)}/source` : \"\"}`,","author":"pinch","version":24},{"n":222,"text":"\t\t\t\t]","author":"pinch","version":24},{"n":223,"text":"\t\t\t: []),","author":"pinch","version":24},{"n":224,"text":"\t]);","author":"pinch","version":24},{"n":225,"text":"}","author":"pinch","version":29},{"n":226,"text":"","author":"pinch","version":29},{"n":227,"text":"/** A saved attachment's file name: its id, then its own name with anything but letters, digits, . - _ made _. */","author":"pinch","version":29},{"n":228,"text":"export function savedName(id: string, name: string): string {","author":"pinch","version":29},{"n":229,"text":"\tconst own = (name.split(/[\\\\/]/).pop() ?? \"\")","author":"pinch","version":29},{"n":230,"text":"\t\t.replace(/[^A-Za-z0-9._-]/g, \"_\")","author":"pinch","version":29},{"n":231,"text":"\t\t.replace(/^\\.+/, \"_\")","author":"pinch","version":29},{"n":232,"text":"\t\t.slice(0, 100);","author":"pinch","version":29},{"n":233,"text":"\treturn `${id}-${own || \"file\"}`;","author":"pinch","version":29},{"n":234,"text":"}","author":"pinch","version":29},{"n":235,"text":"","author":"pinch","version":29},{"n":236,"text":"/**","author":"pinch","version":29},{"n":237,"text":" * abso issue N --save-attachments <folder>: every attachment on the issue, its","author":"pinch","version":35},{"n":238,"text":" * comments and its asks and answers, written to that folder as <id>-<name>; an svg's own file","author":"pinch","version":35},{"n":239,"text":" * beside the png drawn from it. Not into the abso folder unless abso leaves","author":"pinch","version":29},{"n":240,"text":" * that place out, or the images would be recorded as edits.","author":"pinch","version":29},{"n":241,"text":" */","author":"pinch","version":29},{"n":242,"text":"async function saveAttachments(api: Api, root: string, cwd: string, dir: string, page: IssuePage): Promise<Output> {","author":"pinch","version":29},{"n":243,"text":"\tconst target = resolve(cwd, dir);","author":"pinch","version":29},{"n":244,"text":"\tconst inside = target === resolve(root) ? \"\" : relativeTo(root, target);","author":"pinch","version":29},{"n":245,"text":"\tif (inside !== undefined && (inside === \"\" || !ignoredHere(loadIgnore(root), inside, true)))","author":"pinch","version":29},{"n":246,"text":"\t\tthrow new UsageError(","author":"pinch","version":29},{"n":247,"text":"\t\t\t`${dir} is inside this abso folder, so abso would record the images as your edits. Save them outside the folder, or into a folder .absoignore leaves out`,","author":"pinch","version":29},{"n":248,"text":"\t\t);","author":"pinch","version":29},{"n":249,"text":"\tconst seen = new Set<string>();","author":"pinch","version":29},{"n":250,"text":"\tconst all = [","author":"pinch","version":35},{"n":251,"text":"\t\t...(page.issue.attachments ?? []),","author":"pinch","version":35},{"n":252,"text":"\t\t...page.comments.flatMap((c) => c.attachments ?? []),","author":"pinch","version":35},{"n":253,"text":"\t\t...page.asks.flatMap((a) => [...(a.attachments ?? []), ...(a.answer?.attachments ?? [])]),","author":"pinch","version":35},{"n":254,"text":"\t].filter((a) => !seen.has(a.id) && seen.add(a.id));","author":"pinch","version":35},{"n":255,"text":"\tif (all.length === 0)","author":"pinch","version":29},{"n":256,"text":"\t\treturn {","author":"pinch","version":29},{"n":257,"text":"\t\t\ttext: `Issue ${page.issue.id} has no attachments.`,","author":"pinch","version":29},{"n":258,"text":"\t\t\tjson: { issue: page.issue.id, folder: target, files: [] },","author":"pinch","version":29},{"n":259,"text":"\t\t};","author":"pinch","version":29},{"n":260,"text":"\tmkdirSync(target, { recursive: true });","author":"pinch","version":29},{"n":261,"text":"\tconst files: { id: string; path: string; size: number }[] = [];","author":"pinch","version":29},{"n":262,"text":"\tfor (const a of all) {","author":"pinch","version":29},{"n":263,"text":"\t\tconst wanted = [{ name: a.name, source: false }, ...(a.source ? [{ name: a.source.name, source: true }] : [])];","author":"pinch","version":29},{"n":264,"text":"\t\tfor (const w of wanted) {","author":"pinch","version":29},{"n":265,"text":"\t\t\tconst bytes = await api.attachmentBytes(a.id, w.source, ATTACH_MAX);","author":"pinch","version":29},{"n":266,"text":"\t\t\tconst path = join(target, savedName(a.id, w.name));","author":"pinch","version":29},{"n":267,"text":"\t\t\twriteFileSync(path, bytes);","author":"pinch","version":29},{"n":268,"text":"\t\t\tfiles.push({ id: a.id, path, size: bytes.length });","author":"pinch","version":29},{"n":269,"text":"\t\t}","author":"pinch","version":29},{"n":270,"text":"\t}","author":"pinch","version":29},{"n":271,"text":"\treturn {","author":"pinch","version":29},{"n":272,"text":"\t\ttext: [","author":"pinch","version":29},{"n":273,"text":"\t\t\t`Saved ${plural(files.length, \"file\")} from issue ${page.issue.id} to ${target}:`,","author":"pinch","version":29},{"n":274,"text":"\t\t\t...files.map((f) => `  ${basename(f.path)}, ${sizeText(f.size)}`),","author":"pinch","version":29},{"n":275,"text":"\t\t].join(\"\\n\"),","author":"pinch","version":29},{"n":276,"text":"\t\tjson: { issue: page.issue.id, folder: target, files },","author":"pinch","version":29},{"n":277,"text":"\t};","author":"pinch","version":29},{"n":278,"text":"}","author":"pinch","version":5},{"n":279,"text":"","author":"pinch","version":5},{"n":280,"text":"/** An issue's page, as text. */","author":"init","version":0},{"n":281,"text":"export function issuePage(p: IssuePage, api?: Pick<Api, \"attachmentUrl\">): string[] {","author":"pinch","version":5},{"n":282,"text":"\tconst i = p.issue;","author":"init","version":0},{"n":283,"text":"\tconst facts = [","author":"init","version":0},{"n":284,"text":"\t\ti.parent !== null ? `Under issue ${i.parent}.` : \"\",","author":"init","version":0},{"n":285,"text":"\t\t`Opened by ${i.opened.by}, ${shortWhen(i.opened.at)}.`,","author":"init","version":0},{"n":286,"text":"\t\ti.agent !== null ? `Agent: ${i.agent}.` : \"\",","author":"init","version":0},{"n":287,"text":"\t\ti.agents.length > 0 ? `Working on it: ${i.agents.join(\", \")}.` : \"\",","author":"init","version":0},{"n":288,"text":"\t\ti.blockedBy.length > 0 ? `Blocked by: issue${i.blockedBy.length === 1 ? \"\" : \"s\"} ${i.blockedBy.join(\", \")}.` : \"\",","author":"init","version":0},{"n":289,"text":"\t\t(i.labels ?? []).length > 0 ? `Labels: ${i.labels.join(\", \")}.` : \"\",","author":"init","version":0},{"n":290,"text":"\t\ti.versions.length > 0 ? `Versions: ${i.versions.join(\", \")}.` : \"\",","author":"init","version":0},{"n":291,"text":"\t\ti.waitingOn.length > 0 ? `Waiting on: ${i.waitingOn.join(\", \")}.` : \"\",","author":"init","version":0},{"n":292,"text":"\t\ti.closed","author":"init","version":0},{"n":293,"text":"\t\t\t? `${i.closed.how === \"done\" ? \"Done\" : \"Dropped\"} by ${i.closed.by}${i.closed.version !== null ? ` in version ${i.closed.version}` : \"\"}, ${shortWhen(i.closed.at)}.`","author":"init","version":0},{"n":294,"text":"\t\t\t: \"\",","author":"init","version":0},{"n":295,"text":"\t].filter((f) => f !== \"\");","author":"init","version":0},{"n":296,"text":"\t// The links below open for people signed in on the website; an agent's fetch of one is refused. Say the way in","author":"pinch","version":47},{"n":297,"text":"\t// before the first link, so an agent reads the files instead of hunting for them.","author":"pinch","version":47},{"n":298,"text":"\tconst files =","author":"pinch","version":47},{"n":299,"text":"\t\t(i.attachments ?? []).length +","author":"pinch","version":47},{"n":300,"text":"\t\tp.comments.reduce((n, c) => n + (c.attachments ?? []).length, 0) +","author":"pinch","version":47},{"n":301,"text":"\t\tp.asks.reduce((n, a) => n + (a.attachments ?? []).length + (a.answer?.attachments ?? []).length, 0);","author":"pinch","version":47},{"n":302,"text":"\treturn [","author":"init","version":0},{"n":303,"text":"\t\t`Issue ${i.id}: ${q(i.title)} [${i.status}]`,","author":"init","version":0},{"n":304,"text":"\t\tfacts.join(\" \"),","author":"init","version":0},{"n":305,"text":"\t\t...(files > 0","author":"pinch","version":47},{"n":306,"text":"\t\t\t? [","author":"pinch","version":47},{"n":307,"text":"\t\t\t\t\t`${files === 1 ? \"1 file is\" : `${files} files are`} attached below. To read ${files === 1 ? \"it\" : \"them\"}: abso issue ${i.id} --save-attachments <folder> saves ${files === 1 ? \"it\" : \"every one\"} there, then open the files. The links are for people signed in on the website.`,","author":"pinch","version":47},{"n":308,"text":"\t\t\t\t]","author":"pinch","version":47},{"n":309,"text":"\t\t\t: []),","author":"pinch","version":47},{"n":310,"text":"\t\t...(i.lines ? [`From ${i.lines.file} lines ${i.lines.from}-${i.lines.to} at version ${i.lines.version}.`] : []),","author":"init","version":0},{"n":311,"text":"\t\t...(i.description !== \"\" ? [\"\", ...i.description.split(\"\\n\").map((l) => `  ${l}`)] : []),","author":"init","version":0},{"n":312,"text":"\t\t...attachmentLines(api, i.attachments, \"  \"),","author":"pinch","version":5},{"n":313,"text":"\t\t...(p.asks.length > 0 ? [\"\", \"Asks:\", ...p.asks.map((a) => askLine(a, api))] : []),","author":"pinch","version":35},{"n":314,"text":"\t\t...(p.comments.length > 0","author":"init","version":0},{"n":315,"text":"\t\t\t? [","author":"init","version":0},{"n":316,"text":"\t\t\t\t\t\"\",","author":"init","version":0},{"n":317,"text":"\t\t\t\t\t\"Comments:\",","author":"init","version":0},{"n":318,"text":"\t\t\t\t\t...p.comments.flatMap((c) => [","author":"pinch","version":5},{"n":319,"text":"\t\t\t\t\t\t`  ${c.by}${c.kind === \"objection\" ? \" objects\" : \"\"}, ${shortWhen(c.at)}: ${q(c.text)}`,","author":"pinch","version":5},{"n":320,"text":"\t\t\t\t\t\t...attachmentLines(api, c.attachments, \"    \"),","author":"pinch","version":5},{"n":321,"text":"\t\t\t\t\t]),","author":"pinch","version":5},{"n":322,"text":"\t\t\t\t]","author":"init","version":0},{"n":323,"text":"\t\t\t: []),","author":"init","version":0},{"n":324,"text":"\t\t...((p.edits ?? []).length > 0 ? [\"\", \"Edits:\", ...p.edits.map(editLine)] : []),","author":"init","version":0},{"n":325,"text":"\t\t...(p.children.length > 0 ? [\"\", \"Sub-issues:\", ...p.children.map(issueLine)] : []),","author":"init","version":0},{"n":326,"text":"\t\t...((i.watchers ?? []).length > 0 ? [\"\", `Watchers: ${i.watchers.join(\", \")}.`] : []),","author":"init","version":0},{"n":327,"text":"\t\t\"\",","author":"init","version":0},{"n":328,"text":"\t\t`abso start \"...\" --issue ${i.id} starts on it; abso issue ${i.id} --comment \"...\" comments; abso ask <who> \"...\" --issue ${i.id} asks.`,","author":"review","version":16},{"n":329,"text":"\t];","author":"init","version":0},{"n":330,"text":"}","author":"init","version":0},{"n":331,"text":"","author":"init","version":0},{"n":332,"text":"export async function runIssues(args: Parsed, env: Env): Promise<Output> {","author":"init","version":0},{"n":333,"text":"\tif (args.positionals.length > 0)","author":"init","version":0},{"n":334,"text":"\t\tthrow new UsageError(","author":"init","version":0},{"n":335,"text":"\t\t\t\"issues takes no words: abso issues [--open] [--status <s>] [--agent <a>] [--parent <N>] [--label <l,l>] | abso issues --labels; abso issue <N> shows one\",","author":"review","version":16},{"n":336,"text":"\t\t);","author":"init","version":0},{"n":337,"text":"\tconst { api } = openIssues(env);","author":"init","version":0},{"n":338,"text":"\tif (bool(args, \"drafts\")) {","author":"init","version":0},{"n":339,"text":"\t\tconst { drafts } = await api.drafts();","author":"init","version":0},{"n":340,"text":"\t\treturn {","author":"init","version":0},{"n":341,"text":"\t\t\ttext:","author":"init","version":0},{"n":342,"text":"\t\t\t\tdrafts.length === 0","author":"init","version":0},{"n":343,"text":"\t\t\t\t\t? 'No drafts. abso issue draft \"<title>\" saves one: only you see it, and nobody hears of it.'","author":"review","version":16},{"n":344,"text":"\t\t\t\t\t: [","author":"init","version":0},{"n":345,"text":"\t\t\t\t\t\t\t`${plural(drafts.length, \"draft\")}, newest first (only you see them):`,","author":"init","version":0},{"n":346,"text":"\t\t\t\t\t\t\t...drafts.map(draftLine),","author":"init","version":0},{"n":347,"text":"\t\t\t\t\t\t\t\"abso issue draft <D> --open opens one as an issue; --delete deletes it.\",","author":"review","version":16},{"n":348,"text":"\t\t\t\t\t\t].join(\"\\n\"),","author":"init","version":0},{"n":349,"text":"\t\t\tjson: { drafts },","author":"init","version":0},{"n":350,"text":"\t\t};","author":"init","version":0},{"n":351,"text":"\t}","author":"init","version":0},{"n":352,"text":"\tif (bool(args, \"labels\")) {","author":"init","version":0},{"n":353,"text":"\t\tconst { labels } = await api.issueLabels();","author":"init","version":0},{"n":354,"text":"\t\treturn {","author":"init","version":0},{"n":355,"text":"\t\t\ttext:","author":"init","version":0},{"n":356,"text":"\t\t\t\tlabels.length === 0","author":"init","version":0},{"n":357,"text":"\t\t\t\t\t? 'No labels yet. abso issue new \"<title>\" --label friction labels a new issue; abso issue <N> --label <l> labels one.'","author":"review","version":16},{"n":358,"text":"\t\t\t\t\t: [","author":"init","version":0},{"n":359,"text":"\t\t\t\t\t\t\t`${plural(labels.length, \"label\")} in use:`,","author":"init","version":0},{"n":360,"text":"\t\t\t\t\t\t\t...labels.map((l) => `  ${l.label}: ${l.open} open of ${l.total}`),","author":"init","version":0},{"n":361,"text":"\t\t\t\t\t\t\t\"abso issues --label <label> lists a label's issues.\",","author":"review","version":16},{"n":362,"text":"\t\t\t\t\t\t].join(\"\\n\"),","author":"init","version":0},{"n":363,"text":"\t\t\tjson: { labels },","author":"init","version":0},{"n":364,"text":"\t\t};","author":"init","version":0},{"n":365,"text":"\t}","author":"init","version":0},{"n":366,"text":"\tconst parent = str(args, \"parent\");","author":"init","version":0},{"n":367,"text":"\tconst filter = {","author":"init","version":0},{"n":368,"text":"\t\t...(str(args, \"status\") ? { status: str(args, \"status\")! } : {}),","author":"init","version":0},{"n":369,"text":"\t\t...(str(args, \"agent\") ? { agent: str(args, \"agent\")! } : {}),","author":"init","version":0},{"n":370,"text":"\t\t...(parent !== undefined ? { parent: issueNumber(parent, \"--parent\") } : {}),","author":"init","version":0},{"n":371,"text":"\t\t...(str(args, \"label\") !== undefined ? { labels: labelList(str(args, \"label\")!) } : {}),","author":"init","version":0},{"n":372,"text":"\t\topen: bool(args, \"open\"),","author":"init","version":0},{"n":373,"text":"\t};","author":"init","version":0},{"n":374,"text":"\tconst { issues } = await api.issues(filter);","author":"init","version":0},{"n":375,"text":"\tconst scope = [","author":"init","version":0},{"n":376,"text":"\t\tfilter.open ? \"open \" : \"\",","author":"init","version":0},{"n":377,"text":"\t\tfilter.status ? `${filter.status} ` : \"\",","author":"init","version":0},{"n":378,"text":"\t\tfilter.labels ? `${filter.labels.join(\", \")} ` : \"\",","author":"init","version":0},{"n":379,"text":"\t].join(\"\");","author":"init","version":0},{"n":380,"text":"\treturn {","author":"init","version":0},{"n":381,"text":"\t\ttext:","author":"init","version":0},{"n":382,"text":"\t\t\tissues.length === 0","author":"init","version":0},{"n":383,"text":"\t\t\t\t? `No ${scope}issues${filter.agent ? ` for ${filter.agent}` : \"\"}${parent !== undefined ? ` under ${parent}` : \"\"}. abso issue new \"<title>\" opens one.`","author":"review","version":16},{"n":384,"text":"\t\t\t\t: [","author":"init","version":0},{"n":385,"text":"\t\t\t\t\t\t`${plural(issues.length, `${scope}issue`)}, most recently updated first:`,","author":"init","version":0},{"n":386,"text":"\t\t\t\t\t\t...issues.map(issueLine),","author":"init","version":0},{"n":387,"text":"\t\t\t\t\t\t\"abso issue <N> shows one.\",","author":"review","version":16},{"n":388,"text":"\t\t\t\t\t].join(\"\\n\"),","author":"init","version":0},{"n":389,"text":"\t\tjson: { issues },","author":"init","version":0},{"n":390,"text":"\t};","author":"init","version":0},{"n":391,"text":"}","author":"init","version":0},{"n":392,"text":"","author":"init","version":0},{"n":393,"text":"/** A new issue's fields from the command line, as open and drafts take them; `title` only when words were given. */","author":"init","version":0},{"n":394,"text":"function openFields(args: Parsed, title: string): DraftBody {","author":"init","version":0},{"n":395,"text":"\tconst lines = str(args, \"lines\");","author":"init","version":0},{"n":396,"text":"\tconst at = lines === undefined ? undefined : /^(.+):(\\d+)(?:-(\\d+))?@(\\d+)$/.exec(lines);","author":"init","version":0},{"n":397,"text":"\tif (lines !== undefined && !at)","author":"init","version":0},{"n":398,"text":"\t\tthrow new UsageError(\"--lines is <file>:<from>-<to>@<version>, like src/a.ts:10-14@140\");","author":"init","version":0},{"n":399,"text":"\tconst parent = str(args, \"parent\");","author":"init","version":0},{"n":400,"text":"\treturn {","author":"init","version":0},{"n":401,"text":"\t\t...(title !== \"\" ? { title } : {}),","author":"init","version":0},{"n":402,"text":"\t\t...(str(args, \"description\") ? { description: str(args, \"description\")! } : {}),","author":"init","version":0},{"n":403,"text":"\t\t...(parent !== undefined ? { parent: issueNumber(parent, \"--parent\") } : {}),","author":"init","version":0},{"n":404,"text":"\t\t...(at ? { lines: { file: at[1]!, from: Number(at[2]), to: Number(at[3] ?? at[2]), version: Number(at[4]) } } : {}),","author":"init","version":0},{"n":405,"text":"\t\t...(str(args, \"agent\") ? { agent: str(args, \"agent\")! } : {}),","author":"init","version":0},{"n":406,"text":"\t\t...(str(args, \"blocked-by\") !== undefined","author":"init","version":0},{"n":407,"text":"\t\t\t? { blockedBy: listOf(str(args, \"blocked-by\")!).map((b) => issueNumber(b, \"--blocked-by\")) }","author":"init","version":0},{"n":408,"text":"\t\t\t: {}),","author":"init","version":0},{"n":409,"text":"\t\t...(str(args, \"notify\") !== undefined ? { notify: listOf(str(args, \"notify\")!) } : {}),","author":"init","version":0},{"n":410,"text":"\t\t...(str(args, \"label\") !== undefined ? { labels: labelList(str(args, \"label\")!) } : {}),","author":"init","version":0},{"n":411,"text":"\t};","author":"init","version":0},{"n":412,"text":"}","author":"init","version":0},{"n":413,"text":"","author":"init","version":0},{"n":414,"text":"/** One draft as a line: its number, title, and what else it holds. */","author":"init","version":0},{"n":415,"text":"function draftLine(d: Draft): string {","author":"init","version":0},{"n":416,"text":"\tconst b = d.body;","author":"init","version":0},{"n":417,"text":"\tconst more = [","author":"init","version":0},{"n":418,"text":"\t\tb.agent ? `for ${b.agent}` : \"\",","author":"init","version":0},{"n":419,"text":"\t\tb.parent ? `under ${b.parent}` : \"\",","author":"init","version":0},{"n":420,"text":"\t\t(b.labels ?? []).length > 0 ? `labels ${b.labels!.join(\", \")}` : \"\",","author":"init","version":0},{"n":421,"text":"\t\tb.description ? \"a description\" : \"\",","author":"init","version":0},{"n":422,"text":"\t].filter((m) => m !== \"\");","author":"init","version":0},{"n":423,"text":"\treturn `  draft ${d.id}: ${b.title ? q(b.title) : \"(no title yet)\"}${more.length > 0 ? ` (${more.join(\"; \")})` : \"\"}, saved ${shortWhen(d.saved)}`;","author":"init","version":0},{"n":424,"text":"}","author":"init","version":0},{"n":425,"text":"","author":"init","version":0},{"n":426,"text":"/**","author":"init","version":0},{"n":427,"text":" * Drafts (abso issue 3): an issue not opened yet, this agent's alone, with no","author":"init","version":0},{"n":428,"text":" * number and no news. `abso issue draft \"<title>\" [fields]` saves a new one;","author":"init","version":0},{"n":429,"text":" * `abso issue draft <D> [fields]` changes one; --open opens it as an issue;","author":"init","version":0},{"n":430,"text":" * --delete deletes it. `abso issues --drafts` lists them.","author":"init","version":0},{"n":431,"text":" */","author":"init","version":0},{"n":432,"text":"async function runDraft(api: Api, args: Parsed, words: string[]): Promise<Output> {","author":"init","version":0},{"n":433,"text":"\tconst [d, ...more] = words;","author":"init","version":0},{"n":434,"text":"\tif (d !== undefined && /^\\d+$/.test(d) && more.length === 0) {","author":"init","version":0},{"n":435,"text":"\t\tconst id = Number(d);","author":"init","version":0},{"n":436,"text":"\t\tif (bool(args, \"delete\") && bool(args, \"open\")) throw new UsageError(\"--open or --delete, not both\");","author":"init","version":0},{"n":437,"text":"\t\tif (bool(args, \"delete\")) {","author":"init","version":0},{"n":438,"text":"\t\t\tawait api.deleteDraft(id);","author":"init","version":0},{"n":439,"text":"\t\t\treturn { text: `Deleted draft ${id}.`, json: { draft: id, deleted: true } };","author":"init","version":0},{"n":440,"text":"\t\t}","author":"init","version":0},{"n":441,"text":"\t\tif (bool(args, \"open\")) {","author":"init","version":0},{"n":442,"text":"\t\t\tconst r = await api.openDraft(id, openFields(args, \"\"));","author":"init","version":0},{"n":443,"text":"\t\t\treturn {","author":"init","version":0},{"n":444,"text":"\t\t\t\ttext: `Opened draft ${id} as issue ${r.id}. abso start \"...\" --issue ${r.id} starts on it.`,","author":"review","version":16},{"n":445,"text":"\t\t\t\tjson: { draft: id, id: r.id },","author":"init","version":0},{"n":446,"text":"\t\t\t};","author":"init","version":0},{"n":447,"text":"\t\t}","author":"init","version":0},{"n":448,"text":"\t\t// Saving replaces the draft's body, so the fields given go over what it holds.","author":"init","version":0},{"n":449,"text":"\t\tconst found = (await api.drafts()).drafts.find((x) => x.id === id);","author":"init","version":0},{"n":450,"text":"\t\tif (!found) throw new UsageError(`you have no draft ${id}; abso issues --drafts lists yours`);","author":"review","version":16},{"n":451,"text":"\t\tawait api.saveDraft({ ...found.body, ...openFields(args, \"\"), id });","author":"init","version":0},{"n":452,"text":"\t\treturn { text: `Saved draft ${id}.`, json: { draft: id } };","author":"init","version":0},{"n":453,"text":"\t}","author":"init","version":0},{"n":454,"text":"\tif (bool(args, \"open\") || bool(args, \"delete\"))","author":"init","version":0},{"n":455,"text":"\t\tthrow new UsageError(\"--open and --delete take a draft's number: abso issue draft <D> --open\");","author":"review","version":16},{"n":456,"text":"\tconst r = await api.saveDraft(openFields(args, words.join(\" \")));","author":"init","version":0},{"n":457,"text":"\treturn {","author":"init","version":0},{"n":458,"text":"\t\ttext: `Saved draft ${r.id}. Only you see it, and nobody hears of it. abso issue draft ${r.id} --open opens it as an issue.`,","author":"review","version":16},{"n":459,"text":"\t\tjson: { draft: r.id },","author":"init","version":0},{"n":460,"text":"\t};","author":"init","version":0},{"n":461,"text":"}","author":"init","version":0},{"n":462,"text":"","author":"init","version":0},{"n":463,"text":"/** The flags --copy-to goes with: anything else on the same command is refused, so a copy is never half an edit. */","author":"pinch","version":23},{"n":464,"text":"const COPY_FLAGS = new Set([\"copy-to\", \"clean\", \"dry-run\"]);","author":"pinch","version":23},{"n":465,"text":"","author":"pinch","version":23},{"n":466,"text":"/** abso issue <N> --copy-to <project>: the server reads the issue and writes the copy. */","author":"pinch","version":23},{"n":467,"text":"async function runCopy(api: Api, id: number, to: string, args: Parsed, env: Env): Promise<Output> {","author":"pinch","version":23},{"n":468,"text":"\tconst other = [...args.flags.keys()].filter((f) => !COPY_FLAGS.has(f) && f !== \"json\");","author":"pinch","version":23},{"n":469,"text":"\tif (other.length > 0)","author":"pinch","version":23},{"n":470,"text":"\t\tthrow new UsageError(`--copy-to goes alone (with --clean and --dry-run), not with --${other[0]}`);","author":"pinch","version":23},{"n":471,"text":"\tif (to === api.config.project)","author":"pinch","version":23},{"n":472,"text":"\t\tthrow new UsageError(`issue ${id} is already in ${to}; --copy-to names another project`);","author":"pinch","version":23},{"n":473,"text":"\tconst clean = str(args, \"clean\");","author":"pinch","version":23},{"n":474,"text":"\tconst texts = clean === undefined ? {} : readClean(resolve(env.cwd, clean), clean);","author":"pinch","version":23},{"n":475,"text":"\tconst dryRun = bool(args, \"dry-run\");","author":"pinch","version":23},{"n":476,"text":"\tconst from = api.config.project;","author":"pinch","version":23},{"n":477,"text":"\tlet answer: CopyAnswer;","author":"pinch","version":23},{"n":478,"text":"\ttry {","author":"pinch","version":23},{"n":479,"text":"\t\tanswer = await api.issueCopy(to, { ...texts, from, issue: id, ...(dryRun ? { dryRun: true } : {}) });","author":"pinch","version":23},{"n":480,"text":"\t} catch (e) {","author":"pinch","version":23},{"n":481,"text":"\t\tif (e instanceof ApiError && e.status === 403 && !dryRun)","author":"pinch","version":23},{"n":482,"text":"\t\t\tthrow new ApiError(`${e.message}. --dry-run still shows what would go.`, e.status);","author":"pinch","version":23},{"n":483,"text":"\t\tthrow e;","author":"pinch","version":23},{"n":484,"text":"\t}","author":"pinch","version":23},{"n":485,"text":"\tif (\"dryRun\" in answer) {","author":"pinch","version":23},{"n":486,"text":"\t\tconst p = answer.plan;","author":"pinch","version":23},{"n":487,"text":"\t\tconst edited = (list: { edited: boolean }[]) => list.filter((x) => x.edited).length;","author":"pinch","version":23},{"n":488,"text":"\t\tconst lines = [","author":"pinch","version":23},{"n":489,"text":"\t\t\t`A dry run: nothing was written. Copying ${from} issue ${id} into ${to} would make:`,","author":"pinch","version":23},{"n":490,"text":"\t\t\t`  ${q(p.title)}${p.closed ? `, ${p.closed.how}` : \"\"}${p.edited.length > 0 ? ` (${p.edited.join(\" and \")} edited when copied)` : \"\"}`,","author":"pinch","version":23},{"n":491,"text":"\t\t\t`  ${plural(p.comments.length, \"comment\")}${edited(p.comments) > 0 ? ` (${edited(p.comments)} edited)` : \"\"}, ${plural(p.asks.length, \"answered ask\")}${edited(p.asks) > 0 ? ` (${edited(p.asks)} edited)` : \"\"}${p.labels.length > 0 ? `, labelled ${p.labels.join(\", \")}` : \"\"}`,","author":"pinch","version":23},{"n":492,"text":"\t\t\t...skippedLines(p.skipped),","author":"pinch","version":23},{"n":493,"text":"\t\t\t`Run it again without --dry-run to copy it.`,","author":"pinch","version":23},{"n":494,"text":"\t\t];","author":"pinch","version":23},{"n":495,"text":"\t\treturn { text: lines.join(\"\\n\"), json: answer };","author":"pinch","version":23},{"n":496,"text":"\t}","author":"pinch","version":23},{"n":497,"text":"\treturn {","author":"pinch","version":23},{"n":498,"text":"\t\ttext: [","author":"pinch","version":23},{"n":499,"text":"\t\t\t`Copied ${from} issue ${id} to ${to} issue ${answer.id}. Its comments and asks keep their authors and times, and issue ${id} has a comment saying where it went.`,","author":"pinch","version":23},{"n":500,"text":"\t\t\t...skippedLines(answer.skipped),","author":"pinch","version":23},{"n":501,"text":"\t\t].join(\"\\n\"),","author":"pinch","version":23},{"n":502,"text":"\t\tjson: answer,","author":"pinch","version":23},{"n":503,"text":"\t};","author":"pinch","version":23},{"n":504,"text":"}","author":"pinch","version":23},{"n":505,"text":"","author":"pinch","version":23},{"n":506,"text":"function skippedLines(skipped: { comments: number[]; asks: number[] }): string[] {","author":"pinch","version":23},{"n":507,"text":"\tconst parts = [","author":"pinch","version":23},{"n":508,"text":"\t\t...(skipped.comments.length > 0 ? [`comments ${skipped.comments.join(\", \")}`] : []),","author":"pinch","version":23},{"n":509,"text":"\t\t...(skipped.asks.length > 0 ? [`asks ${skipped.asks.join(\", \")}`] : []),","author":"pinch","version":23},{"n":510,"text":"\t];","author":"pinch","version":23},{"n":511,"text":"\treturn parts.length > 0 ? [`  not copied: ${parts.join(\"; \")} (open asks, and what --clean left out)`] : [];","author":"pinch","version":23},{"n":512,"text":"}","author":"pinch","version":23},{"n":513,"text":"","author":"pinch","version":23},{"n":514,"text":"/** --clean's file: cleaned texts by source id. The server checks each id against the issue it reads. */","author":"pinch","version":23},{"n":515,"text":"function readClean(path: string, given: string): Omit<CopyBody, \"from\" | \"issue\"> {","author":"pinch","version":23},{"n":516,"text":"\tlet raw: unknown;","author":"pinch","version":23},{"n":517,"text":"\ttry {","author":"pinch","version":23},{"n":518,"text":"\t\traw = JSON.parse(readFileSync(path, \"utf8\"));","author":"pinch","version":23},{"n":519,"text":"\t} catch (e) {","author":"pinch","version":23},{"n":520,"text":"\t\tthrow new UsageError(","author":"pinch","version":23},{"n":521,"text":"\t\t\t`--clean ${given}: ${(e as NodeJS.ErrnoException).code === \"ENOENT\" ? \"no such file\" : \"not JSON\"}`,","author":"pinch","version":23},{"n":522,"text":"\t\t);","author":"pinch","version":23},{"n":523,"text":"\t}","author":"pinch","version":23},{"n":524,"text":"\tif (typeof raw !== \"object\" || raw === null || Array.isArray(raw))","author":"pinch","version":23},{"n":525,"text":"\t\tthrow new UsageError(`--clean ${given}: a JSON object with title, description, comments or asks`);","author":"pinch","version":23},{"n":526,"text":"\tconst known = new Set([\"title\", \"description\", \"comments\", \"asks\"]);","author":"pinch","version":23},{"n":527,"text":"\tconst unknown = Object.keys(raw).filter((k) => !known.has(k));","author":"pinch","version":23},{"n":528,"text":"\tif (unknown.length > 0)","author":"pinch","version":23},{"n":529,"text":"\t\tthrow new UsageError(`--clean ${given}: ${unknown[0]} isn't one of title, description, comments, asks`);","author":"pinch","version":23},{"n":530,"text":"\treturn raw as Omit<CopyBody, \"from\" | \"issue\">;","author":"pinch","version":23},{"n":531,"text":"}","author":"pinch","version":23},{"n":532,"text":"","author":"pinch","version":23},{"n":533,"text":"export async function runIssue(args: Parsed, env: Env): Promise<Output> {","author":"init","version":0},{"n":534,"text":"\tconst [first, ...rest] = args.positionals;","author":"init","version":0},{"n":535,"text":"\tconst { root, api } = openIssues(env);","author":"pinch","version":29},{"n":536,"text":"\tconst saveTo = str(args, \"save-attachments\");","author":"pinch","version":29},{"n":537,"text":"\tif (saveTo !== undefined) {","author":"pinch","version":29},{"n":538,"text":"\t\tconst other = [...args.flags.keys()].filter((f) => f !== \"save-attachments\" && f !== \"json\");","author":"pinch","version":29},{"n":539,"text":"\t\tif (other.length > 0 || first === \"new\" || first === \"draft\")","author":"pinch","version":29},{"n":540,"text":"\t\t\tthrow new UsageError(","author":"pinch","version":29},{"n":541,"text":"\t\t\t\t`--save-attachments goes alone with an issue number: abso issue <N> --save-attachments <folder>${other.length > 0 ? `, not with --${other[0]}` : \"\"}`,","author":"pinch","version":29},{"n":542,"text":"\t\t\t);","author":"pinch","version":29},{"n":543,"text":"\t}","author":"pinch","version":29},{"n":544,"text":"\tif (first === \"draft\") return runDraft(api, args, rest);","author":"init","version":0},{"n":545,"text":"\tif (first === \"new\") {","author":"init","version":0},{"n":546,"text":"\t\tif (rest.length === 0)","author":"init","version":0},{"n":547,"text":"\t\t\tthrow new UsageError(","author":"init","version":0},{"n":548,"text":"\t\t\t\t'abso issue new \"<title>\" [--description \"...\"] [--parent <N>] [--lines <file>:<from>-<to>@<version>] [--agent <agent>] [--blocked-by <N,N>] [--notify <who,who>] [--label <l,l>]',","author":"review","version":16},{"n":549,"text":"\t\t\t);","author":"init","version":0},{"n":550,"text":"\t\tconst fields = { ...openFields(args, rest.join(\" \")), title: rest.join(\" \") };","author":"pinch","version":5},{"n":551,"text":"\t\tconst attachments = await uploadAttachments(api, env.cwd, str(args, \"attach\"));","author":"pinch","version":5},{"n":552,"text":"\t\tconst r = await api.issueOpen({ ...fields, ...(attachments.length > 0 ? { attachments } : {}) });","author":"pinch","version":5},{"n":553,"text":"\t\treturn {","author":"pinch","version":5},{"n":554,"text":"\t\t\ttext: `Opened issue ${r.id}${attachments.length > 0 ? ` with ${plural(attachments.length, \"attachment\")} (${attachments.join(\", \")})` : \"\"}. abso start \"...\" --issue ${r.id} starts on it.`,","author":"review","version":16},{"n":555,"text":"\t\t\tjson: { id: r.id, ...(attachments.length > 0 ? { attachments } : {}) },","author":"pinch","version":5},{"n":556,"text":"\t\t};","author":"pinch","version":5},{"n":557,"text":"\t}","author":"init","version":0},{"n":558,"text":"\tif (first === undefined || rest.length > 0)","author":"init","version":0},{"n":559,"text":"\t\tthrow new UsageError(","author":"init","version":0},{"n":560,"text":"\t\t\t'abso issue <N> [--comment \"...\" | --object \"...\" | --drop | --reopen | --done [--done-by <version>] | an edit], or abso issue new \"<title>\"',","author":"review","version":16},{"n":561,"text":"\t\t);","author":"init","version":0},{"n":562,"text":"\tconst id = issueNumber(first);","author":"init","version":0},{"n":563,"text":"\tconst copyTo = str(args, \"copy-to\");","author":"pinch","version":23},{"n":564,"text":"\tif (copyTo !== undefined) return runCopy(api, id, copyTo, args, env);","author":"pinch","version":23},{"n":565,"text":"\tif (str(args, \"clean\") !== undefined || bool(args, \"dry-run\"))","author":"pinch","version":23},{"n":566,"text":"\t\tthrow new UsageError(\"--clean and --dry-run go with --copy-to <project>\");","author":"pinch","version":23},{"n":567,"text":"\tconst comment = str(args, \"comment\");","author":"init","version":0},{"n":568,"text":"\tconst object = str(args, \"object\");","author":"init","version":0},{"n":569,"text":"\tconst doneBy = str(args, \"done-by\");","author":"init","version":0},{"n":570,"text":"\tconst markingDone = bool(args, \"done\") || doneBy !== undefined;","author":"init","version":0},{"n":571,"text":"\tconst edits = [\"title\", \"description\", \"parent\", \"agent\", \"blocked-by\", \"label\", \"unlabel\"].filter(","author":"init","version":0},{"n":572,"text":"\t\t(f) => str(args, f) !== undefined,","author":"init","version":0},{"n":573,"text":"\t);","author":"init","version":0},{"n":574,"text":"\tif (","author":"init","version":0},{"n":575,"text":"\t\t[","author":"init","version":0},{"n":576,"text":"\t\t\tcomment !== undefined,","author":"init","version":0},{"n":577,"text":"\t\t\tobject !== undefined,","author":"init","version":0},{"n":578,"text":"\t\t\tbool(args, \"drop\"),","author":"init","version":0},{"n":579,"text":"\t\t\tbool(args, \"reopen\"),","author":"init","version":0},{"n":580,"text":"\t\t\tmarkingDone,","author":"init","version":0},{"n":581,"text":"\t\t\tedits.length > 0,","author":"init","version":0},{"n":582,"text":"\t\t].filter(Boolean).length > 1","author":"init","version":0},{"n":583,"text":"\t)","author":"init","version":0},{"n":584,"text":"\t\tthrow new UsageError(\"one of --comment, --object, --drop, --reopen, --done or an edit at a time\");","author":"init","version":0},{"n":585,"text":"\tif (edits.length > 0) {","author":"init","version":0},{"n":586,"text":"\t\tconst parent = str(args, \"parent\");","author":"init","version":0},{"n":587,"text":"\t\tconst agent = str(args, \"agent\");","author":"init","version":0},{"n":588,"text":"\t\tconst blockedBy = str(args, \"blocked-by\");","author":"init","version":0},{"n":589,"text":"\t\tconst r = await api.issueEdit(id, {","author":"init","version":0},{"n":590,"text":"\t\t\t...(str(args, \"title\") !== undefined ? { title: str(args, \"title\")! } : {}),","author":"init","version":0},{"n":591,"text":"\t\t\t...(str(args, \"description\") !== undefined ? { description: str(args, \"description\")! } : {}),","author":"init","version":0},{"n":592,"text":"\t\t\t...(parent !== undefined ? { parent: parent === \"none\" ? null : issueNumber(parent, \"--parent\") } : {}),","author":"init","version":0},{"n":593,"text":"\t\t\t...(agent !== undefined ? { agent: agent === \"none\" ? null : agent } : {}),","author":"init","version":0},{"n":594,"text":"\t\t\t...(blockedBy !== undefined ? { blockedBy: listOf(blockedBy).map((b) => issueNumber(b, \"--blocked-by\")) } : {}),","author":"init","version":0},{"n":595,"text":"\t\t\t...(bool(args, \"quiet\") ? { notify: false } : {}),","author":"init","version":0},{"n":596,"text":"\t\t\t...(str(args, \"notify\") !== undefined ? { also: listOf(str(args, \"notify\")!) } : {}),","author":"init","version":0},{"n":597,"text":"\t\t\t...(str(args, \"label\") !== undefined ? { addLabels: labelList(str(args, \"label\")!) } : {}),","author":"init","version":0},{"n":598,"text":"\t\t\t...(str(args, \"unlabel\") !== undefined ? { removeLabels: labelList(str(args, \"unlabel\")!) } : {}),","author":"init","version":0},{"n":599,"text":"\t\t\t// A labels-only edit tells nobody unless --notify names people.","author":"init","version":0},{"n":600,"text":"\t\t\t...(edits.every((f) => f === \"label\" || f === \"unlabel\") && str(args, \"notify\") !== undefined","author":"init","version":0},{"n":601,"text":"\t\t\t\t? { notify: true }","author":"init","version":0},{"n":602,"text":"\t\t\t\t: {}),","author":"init","version":0},{"n":603,"text":"\t\t});","author":"init","version":0},{"n":604,"text":"\t\treturn {","author":"init","version":0},{"n":605,"text":"\t\t\ttext: `Edited issue ${id}. ${r.notified.length > 0 ? `Told ${r.notified.join(\", \")}.` : \"Told nobody.\"}`,","author":"init","version":0},{"n":606,"text":"\t\t\tjson: { issue: id, edit: r.edit, notified: r.notified },","author":"init","version":0},{"n":607,"text":"\t\t};","author":"init","version":0},{"n":608,"text":"\t}","author":"init","version":0},{"n":609,"text":"\tif (bool(args, \"quiet\") || str(args, \"notify\") !== undefined)","author":"init","version":0},{"n":610,"text":"\t\tthrow new UsageError(","author":"init","version":0},{"n":611,"text":"\t\t\t\"--quiet and --notify go with an edit (--title, --description, --parent, --agent, --blocked-by, --label or --unlabel)\",","author":"init","version":0},{"n":612,"text":"\t\t);","author":"init","version":0},{"n":613,"text":"\tif (str(args, \"attach\") !== undefined && comment === undefined && object === undefined)","author":"pinch","version":5},{"n":614,"text":"\t\tthrow new UsageError(\"--attach goes with abso issue new or --comment (or --object)\");","author":"review","version":16},{"n":615,"text":"\tif (comment !== undefined || object !== undefined) {","author":"init","version":0},{"n":616,"text":"\t\t// Refused before anything goes up: an objection is one comment, and a part of one would read as a whole.","author":"pinch","version":96},{"n":617,"text":"\t\tif (object !== undefined && object.length > COMMENT_MAX)","author":"pinch","version":96},{"n":618,"text":"\t\t\tthrow new UsageError(","author":"pinch","version":96},{"n":619,"text":"\t\t\t\t`an objection holds up to ${COMMENT_MAX} characters, and this one has ${object.length}: say it shorter, and put the rest in a --comment`,","author":"pinch","version":96},{"n":620,"text":"\t\t\t);","author":"pinch","version":96},{"n":621,"text":"\t\tconst parts = object !== undefined ? [object] : commentParts(comment!);","author":"pinch","version":96},{"n":622,"text":"\t\tconst attachments = await uploadAttachments(api, env.cwd, str(args, \"attach\"));","author":"pinch","version":5},{"n":623,"text":"\t\tconst ids: number[] = [];","author":"pinch","version":96},{"n":624,"text":"\t\tfor (const [i, part] of parts.entries()) {","author":"pinch","version":96},{"n":625,"text":"\t\t\t// The attachments go on the first part, which the rest follow.","author":"pinch","version":96},{"n":626,"text":"\t\t\tids.push((await api.issueComment(id, part, object !== undefined, i === 0 ? attachments : [])).id);","author":"pinch","version":96},{"n":627,"text":"\t\t}","author":"pinch","version":96},{"n":628,"text":"\t\tconst inParts = parts.length > 1 ? ` in ${parts.length} parts (comments ${ids.join(\", \")})` : \"\";","author":"pinch","version":96},{"n":629,"text":"\t\treturn {","author":"init","version":0},{"n":630,"text":"\t\t\ttext: `${object !== undefined ? \"Objected\" : \"Commented\"} on issue ${id}${inParts}${attachments.length > 0 ? ` with ${plural(attachments.length, \"attachment\")} (${attachments.join(\", \")})` : \"\"}. Its agents hear it.`,","author":"pinch","version":96},{"n":631,"text":"\t\t\tjson: {","author":"pinch","version":96},{"n":632,"text":"\t\t\t\tid: ids[0],","author":"pinch","version":96},{"n":633,"text":"\t\t\t\tissue: id,","author":"pinch","version":96},{"n":634,"text":"\t\t\t\t...(parts.length > 1 ? { parts: ids } : {}),","author":"pinch","version":96},{"n":635,"text":"\t\t\t\t...(attachments.length > 0 ? { attachments } : {}),","author":"pinch","version":96},{"n":636,"text":"\t\t\t},","author":"pinch","version":96},{"n":637,"text":"\t\t};","author":"init","version":0},{"n":638,"text":"\t}","author":"init","version":0},{"n":639,"text":"\tif (bool(args, \"drop\")) {","author":"init","version":0},{"n":640,"text":"\t\tawait api.issueDrop(id);","author":"init","version":0},{"n":641,"text":"\t\treturn { text: `Dropped issue ${id}.`, json: { issue: id, dropped: true } };","author":"init","version":0},{"n":642,"text":"\t}","author":"init","version":0},{"n":643,"text":"\tif (bool(args, \"reopen\")) {","author":"init","version":0},{"n":644,"text":"\t\tawait api.issueReopen(id);","author":"init","version":0},{"n":645,"text":"\t\treturn { text: `Reopened issue ${id}.`, json: { issue: id, reopened: true } };","author":"init","version":0},{"n":646,"text":"\t}","author":"init","version":0},{"n":647,"text":"\tif (markingDone) {","author":"init","version":0},{"n":648,"text":"\t\tlet version: number | null = null;","author":"init","version":0},{"n":649,"text":"\t\tif (doneBy !== undefined) {","author":"init","version":0},{"n":650,"text":"\t\t\tversion = issueNumber(doneBy, \"--done-by\");","author":"init","version":0},{"n":651,"text":"\t\t\tif (version < 1) throw new UsageError(\"--done-by is a pushed version, 1 or more\");","author":"rename","version":100},{"n":652,"text":"\t\t\ttry {","author":"init","version":0},{"n":653,"text":"\t\t\t\tawait api.show(version, { draft: null });","author":"init","version":0},{"n":654,"text":"\t\t\t} catch {","author":"init","version":0},{"n":655,"text":"\t\t\t\tthrow new UsageError(`no version ${version}`);","author":"init","version":0},{"n":656,"text":"\t\t\t}","author":"init","version":0},{"n":657,"text":"\t\t}","author":"init","version":0},{"n":658,"text":"\t\tawait api.issueDone(id, version);","author":"init","version":0},{"n":659,"text":"\t\treturn {","author":"init","version":0},{"n":660,"text":"\t\t\ttext: version === null ? `Marked issue ${id} done.` : `Marked issue ${id} done in version ${version}.`,","author":"init","version":0},{"n":661,"text":"\t\t\tjson: { issue: id, done: true, ...(version !== null ? { version } : {}) },","author":"init","version":0},{"n":662,"text":"\t\t};","author":"init","version":0},{"n":663,"text":"\t}","author":"init","version":0},{"n":664,"text":"\tconst page = await api.issue(id);","author":"init","version":0},{"n":665,"text":"\tif (saveTo !== undefined) return saveAttachments(api, root, env.cwd, saveTo, page);","author":"pinch","version":29},{"n":666,"text":"\treturn { text: issuePage(page, api).join(\"\\n\"), json: { ...page } };","author":"pinch","version":5},{"n":667,"text":"}","author":"init","version":0},{"n":668,"text":"","author":"init","version":0},{"n":669,"text":"export async function runAsk(args: Parsed, env: Env): Promise<Output> {","author":"init","version":0},{"n":670,"text":"\tconst withdraw = str(args, \"withdraw\");","author":"infra-split","version":14},{"n":671,"text":"\tif (withdraw !== undefined) return withdrawAsk(args, env, withdraw);","author":"infra-split","version":14},{"n":672,"text":"\tif (str(args, \"note\") !== undefined)","author":"infra-split","version":14},{"n":673,"text":"\t\tthrow new UsageError('--note goes with --withdraw: abso ask --withdraw <ask> --note \"why\"');","author":"review","version":16},{"n":674,"text":"\tconst [of, ...words] = args.positionals;","author":"init","version":0},{"n":675,"text":"\tif (of !== undefined && words.length === 0 && /^\\d+$/.test(of)) return showAsk(args, env, of);","author":"pinch","version":72},{"n":676,"text":"\tif (of === undefined || words.length === 0)","author":"init","version":0},{"n":677,"text":"\t\tthrow new UsageError(","author":"init","version":0},{"n":678,"text":"\t\t\t'abso ask <who> \"<question>\" [--issue <N>] [--review | --task] [--due <YYYY-MM-DD>] [--blocks <N,N>] [--options \"A|B|C\"]; who is an agent, or person:<id>',","author":"review","version":16},{"n":679,"text":"\t\t);","author":"init","version":0},{"n":680,"text":"\tconst { api } = openIssues(env);","author":"init","version":0},{"n":681,"text":"\tif (bool(args, \"review\") && bool(args, \"task\")) throw new UsageError(\"an ask is a review or a task, not both\");","author":"init","version":0},{"n":682,"text":"\tconst issue = str(args, \"issue\");","author":"init","version":0},{"n":683,"text":"\tconst blocks = str(args, \"blocks\");","author":"init","version":0},{"n":684,"text":"\tconst options = str(args, \"options\");","author":"init","version":0},{"n":685,"text":"\tconst attachments = await uploadAttachments(api, env.cwd, str(args, \"attach\"));","author":"pinch","version":35},{"n":686,"text":"\tconst r = await api.ask({","author":"init","version":0},{"n":687,"text":"\t\tof,","author":"init","version":0},{"n":688,"text":"\t\tquestion: words.join(\" \"),","author":"init","version":0},{"n":689,"text":"\t\t...(issue !== undefined ? { issue: issueNumber(issue, \"--issue\") } : {}),","author":"init","version":0},{"n":690,"text":"\t\t...(bool(args, \"review\") ? { review: true } : {}),","author":"init","version":0},{"n":691,"text":"\t\t...(bool(args, \"task\") ? { kind: \"task\" as const } : {}),","author":"init","version":0},{"n":692,"text":"\t\t...(str(args, \"due\") ? { due: str(args, \"due\")! } : {}),","author":"init","version":0},{"n":693,"text":"\t\t...(blocks !== undefined ? { blocks: blocks.split(\",\").map((b) => issueNumber(b.trim(), \"--blocks\")) } : {}),","author":"init","version":0},{"n":694,"text":"\t\t...(options !== undefined","author":"init","version":0},{"n":695,"text":"\t\t\t? {","author":"init","version":0},{"n":696,"text":"\t\t\t\t\toptions: options","author":"init","version":0},{"n":697,"text":"\t\t\t\t\t\t.split(\"|\")","author":"init","version":0},{"n":698,"text":"\t\t\t\t\t\t.map((o) => o.trim())","author":"init","version":0},{"n":699,"text":"\t\t\t\t\t\t.filter((o) => o !== \"\"),","author":"init","version":0},{"n":700,"text":"\t\t\t\t}","author":"init","version":0},{"n":701,"text":"\t\t\t: {}),","author":"init","version":0},{"n":702,"text":"\t\t...(attachments.length > 0 ? { attachments } : {}),","author":"pinch","version":35},{"n":703,"text":"\t});","author":"init","version":0},{"n":704,"text":"\tconst lost = notKept(attachments, r.attachments, `ask ${r.id}`);","author":"pinch","version":35},{"n":705,"text":"\treturn {","author":"pinch","version":35},{"n":706,"text":"\t\ttext: `Asked ${of} (ask ${r.id})${withFiles(attachments)}. They hear it; abso waiting shows what's open.${lost ? ` ${lost}` : \"\"}`,","author":"pinch","version":35},{"n":707,"text":"\t\tjson: { id: r.id, ...(attachments.length > 0 ? { attachments } : {}), ...(lost ? { notKept: lost } : {}) },","author":"pinch","version":35},{"n":708,"text":"\t};","author":"pinch","version":35},{"n":709,"text":"}","author":"init","version":0},{"n":710,"text":"","author":"init","version":0},{"n":711,"text":"/** abso ask <N>: one ask, open or closed, with its whole thread, its answer and whose turn it is. */","author":"pinch","version":72},{"n":712,"text":"async function showAsk(args: Parsed, env: Env, word: string): Promise<Output> {","author":"pinch","version":72},{"n":713,"text":"\tconst others = [\"issue\", \"due\", \"blocks\", \"options\", \"attach\"].filter((f) => str(args, f) !== undefined);","author":"pinch","version":72},{"n":714,"text":"\tif (others.length > 0 || bool(args, \"review\") || bool(args, \"task\"))","author":"pinch","version":72},{"n":715,"text":"\t\tthrow new UsageError('abso ask <N> shows ask N; to ask, say who and what: abso ask <who> \"<question>\"');","author":"pinch","version":72},{"n":716,"text":"\tconst id = issueNumber(word, \"the ask number\");","author":"pinch","version":72},{"n":717,"text":"\tconst { api, config } = openIssues(env);","author":"pinch","version":72},{"n":718,"text":"\tconst { ask } = await api.askThread(id);","author":"pinch","version":72},{"n":719,"text":"\tconst side = ask.of === config.agent || ask.by === config.agent;","author":"pinch","version":72},{"n":720,"text":"\tconst turn = ask.waitingOn === config.agent ? \"you\" : ask.waitingOn;","author":"pinch","version":72},{"n":721,"text":"\tconst steps = !side","author":"pinch","version":72},{"n":722,"text":"\t\t? \"\"","author":"pinch","version":72},{"n":723,"text":"\t\t: ask.answer","author":"pinch","version":72},{"n":724,"text":"\t\t\t? `abso reply ${id} \"...\" still adds to it.`","author":"pinch","version":72},{"n":725,"text":"\t\t\t: ask.of === config.agent","author":"pinch","version":72},{"n":726,"text":"\t\t\t\t? `abso reply ${id} \"...\" adds to it; abso answer ${id} \"...\" answers and closes it.`","author":"pinch","version":72},{"n":727,"text":"\t\t\t\t: `abso reply ${id} \"...\" adds to it.`;","author":"pinch","version":72},{"n":728,"text":"\tconst next = [!ask.answer && turn ? `It waits on ${turn}.` : \"\", steps].join(\" \");","author":"pinch","version":72},{"n":729,"text":"\treturn {","author":"pinch","version":72},{"n":730,"text":"\t\ttext: [askLine(ask, api, true), next.trim()].filter((l) => l !== \"\").join(\"\\n\"),","author":"pinch","version":72},{"n":731,"text":"\t\tjson: { ask },","author":"pinch","version":72},{"n":732,"text":"\t};","author":"pinch","version":72},{"n":733,"text":"}","author":"pinch","version":72},{"n":734,"text":"","author":"pinch","version":72},{"n":735,"text":"/** abso reply <ask> \"<words>\" [--question]: add to an ask's thread, as its asker or the one asked. */","author":"pinch","version":72},{"n":736,"text":"export async function runReply(args: Parsed, env: Env): Promise<Output> {","author":"pinch","version":72},{"n":737,"text":"\tconst [first, ...words] = args.positionals;","author":"pinch","version":72},{"n":738,"text":"\tconst id = issueNumber(first, \"the ask number\");","author":"pinch","version":72},{"n":739,"text":"\tif (words.length === 0)","author":"pinch","version":72},{"n":740,"text":"\t\tthrow new UsageError(","author":"pinch","version":72},{"n":741,"text":"\t\t\t`abso reply <ask> \"<words>\" [--question]: adds to an ask's thread, as its asker or the one asked`,","author":"pinch","version":72},{"n":742,"text":"\t\t);","author":"pinch","version":72},{"n":743,"text":"\tconst { api, config } = openIssues(env);","author":"pinch","version":72},{"n":744,"text":"\tconst question = bool(args, \"question\");","author":"pinch","version":72},{"n":745,"text":"\tconst r = await api.reply(id, { text: words.join(\" \"), ...(question ? { question: true } : {}) });","author":"pinch","version":72},{"n":746,"text":"\tconst other = r.ask.by === config.agent ? r.ask.of : r.ask.by;","author":"pinch","version":72},{"n":747,"text":"\tconst turn =","author":"pinch","version":72},{"n":748,"text":"\t\t!r.ask.answer && r.ask.waitingOn","author":"pinch","version":72},{"n":749,"text":"\t\t\t? ` It waits on ${r.ask.waitingOn === config.agent ? \"you\" : r.ask.waitingOn}.`","author":"pinch","version":72},{"n":750,"text":"\t\t\t: \"\";","author":"pinch","version":72},{"n":751,"text":"\treturn { text: `Replied on ask ${id}. ${other} hears it.${turn}`, json: { ask: r.ask } };","author":"pinch","version":72},{"n":752,"text":"}","author":"pinch","version":72},{"n":753,"text":"","author":"pinch","version":72},{"n":754,"text":"/** abso ask --withdraw <ask> [--note \"why\"]: the asker takes an ask back. It closes like an answer, and the one asked hears it. */","author":"review","version":16},{"n":755,"text":"async function withdrawAsk(args: Parsed, env: Env, word: string): Promise<Output> {","author":"infra-split","version":14},{"n":756,"text":"\tconst others = [\"issue\", \"due\", \"blocks\", \"options\", \"attach\"].filter((f) => str(args, f) !== undefined);","author":"pinch","version":35},{"n":757,"text":"\tif (args.positionals.length > 0 || others.length > 0 || bool(args, \"review\") || bool(args, \"task\"))","author":"infra-split","version":14},{"n":758,"text":"\t\tthrow new UsageError('abso ask --withdraw <ask> [--note \"why\"] takes nothing else: it takes back an ask you made');","author":"review","version":16},{"n":759,"text":"\tconst id = issueNumber(word, \"the ask number\");","author":"infra-split","version":14},{"n":760,"text":"\tconst { api } = openIssues(env);","author":"infra-split","version":14},{"n":761,"text":"\tconst note = str(args, \"note\");","author":"infra-split","version":14},{"n":762,"text":"\tconst r = await api.withdraw(id, note !== undefined ? { note } : {});","author":"infra-split","version":14},{"n":763,"text":"\treturn { text: `Withdrew ask ${id}. ${r.ask.of} hears it, and it no longer waits on them.`, json: { ask: r.ask } };","author":"infra-split","version":14},{"n":764,"text":"}","author":"devops","version":20},{"n":765,"text":"","author":"devops","version":20},{"n":766,"text":"/** One search hit as two lines: the issue, then where it matched and the words around it. */","author":"devops","version":20},{"n":767,"text":"export function searchLines(h: IssueSearchHit): string[] {","author":"devops","version":20},{"n":768,"text":"\tconst where = h.meaning ? \"by meaning\" : h.where === \"comment\" ? `in comment ${h.comment}` : `in the ${h.where}`;","author":"devops","version":20},{"n":769,"text":"\tconst words = h.snippet","author":"devops","version":20},{"n":770,"text":"\t\t.replace(/[\\u0001\\u0002]/g, \"\")","author":"devops","version":20},{"n":771,"text":"\t\t.replace(/\\s+/g, \" \")","author":"devops","version":20},{"n":772,"text":"\t\t.trim();","author":"devops","version":20},{"n":773,"text":"\treturn [","author":"devops","version":20},{"n":774,"text":"\t\t`  ${String(h.issue.id).padStart(3)}  ${h.issue.status.padEnd(11)}  ${q(h.issue.title)}`,","author":"devops","version":20},{"n":775,"text":"\t\t`       ${where}${words && words !== h.issue.title ? `: ${q(words)}` : \"\"}`,","author":"devops","version":20},{"n":776,"text":"\t];","author":"devops","version":20},{"n":777,"text":"}","author":"devops","version":20},{"n":778,"text":"","author":"devops","version":20},{"n":779,"text":"export async function runSearch(args: Parsed, env: Env): Promise<Output> {","author":"devops","version":20},{"n":780,"text":"\tconst words = args.positionals.join(\" \").trim();","author":"devops","version":20},{"n":781,"text":"\tif (words === \"\") throw new UsageError('search needs words: abso search \"<words>\" [--limit <N>]');","author":"devops","version":20},{"n":782,"text":"\tconst limitWord = str(args, \"limit\");","author":"devops","version":20},{"n":783,"text":"\tconst limit = limitWord === undefined ? undefined : Number(limitWord);","author":"devops","version":20},{"n":784,"text":"\tif (limit !== undefined && !(Number.isInteger(limit) && limit >= 1 && limit <= 50))","author":"devops","version":20},{"n":785,"text":"\t\tthrow new UsageError(\"--limit is a number from 1 to 50\");","author":"devops","version":20},{"n":786,"text":"\tconst { api } = openIssues(env);","author":"devops","version":20},{"n":787,"text":"\tconst { hits } = await api.issueSearch(words, limit);","author":"devops","version":20},{"n":788,"text":"\treturn {","author":"devops","version":20},{"n":789,"text":"\t\ttext:","author":"devops","version":20},{"n":790,"text":"\t\t\thits.length === 0","author":"devops","version":20},{"n":791,"text":"\t\t\t\t? `Nothing matches ${q(words)}.`","author":"devops","version":20},{"n":792,"text":"\t\t\t\t: [","author":"devops","version":20},{"n":793,"text":"\t\t\t\t\t\t`${plural(hits.length, \"issue\")} for ${q(words)}, best first:`,","author":"devops","version":20},{"n":794,"text":"\t\t\t\t\t\t...hits.flatMap(searchLines),","author":"devops","version":20},{"n":795,"text":"\t\t\t\t\t\t\"abso issue <N> shows one.\",","author":"devops","version":20},{"n":796,"text":"\t\t\t\t\t].join(\"\\n\"),","author":"devops","version":20},{"n":797,"text":"\t\tjson: { hits },","author":"devops","version":20},{"n":798,"text":"\t};","author":"devops","version":20},{"n":799,"text":"}","author":"infra-split","version":14},{"n":800,"text":"","author":"infra-split","version":14},{"n":801,"text":"export async function runWaiting(args: Parsed, env: Env): Promise<Output> {","author":"init","version":0},{"n":802,"text":"\tif (args.positionals.length > 0)","author":"init","version":0},{"n":803,"text":"\t\tthrow new UsageError(\"waiting takes no words: abso waiting [--of <agent or person:id>] [--mine] [--asked]\");","author":"pinch","version":72},{"n":804,"text":"\tif (bool(args, \"asked\")) return askedOf(args, env);","author":"pinch","version":72},{"n":805,"text":"\tconst { api, config } = openIssues(env);","author":"init","version":0},{"n":806,"text":"\tconst mine = bool(args, \"mine\") || str(args, \"of\") === config.agent;","author":"init","version":0},{"n":807,"text":"\tconst of = mine ? config.agent : str(args, \"of\");","author":"init","version":0},{"n":808,"text":"\t// With --mine, your own publishes still in the merge queue are open work too. A server without a queue,","author":"pinch","version":36},{"n":809,"text":"\t// or one that can't be read now, leaves them out rather than failing the asks.","author":"pinch","version":36},{"n":810,"text":"\tconst [{ asks }, queue] = await Promise.all([","author":"pinch","version":36},{"n":811,"text":"\t\tmine ? api.waitingMine() : api.waiting(of),","author":"pinch","version":36},{"n":812,"text":"\t\tmine ? api.queueState().catch(() => undefined) : undefined,","author":"pinch","version":36},{"n":813,"text":"\t]);","author":"pinch","version":36},{"n":814,"text":"\tconst queued = queuedLines(queue, config.agent);","author":"pinch","version":36},{"n":815,"text":"\tconst yours = (queue?.items ?? []).filter((q) => q.agent === config.agent);","author":"pinch","version":36},{"n":816,"text":"\treturn {","author":"init","version":0},{"n":817,"text":"\t\ttext: [","author":"pinch","version":36},{"n":818,"text":"\t\t\t...queued,","author":"pinch","version":36},{"n":819,"text":"\t\t\t...(asks.length === 0","author":"pinch","version":36},{"n":820,"text":"\t\t\t\t? [queued.length > 0 ? `No open asks of ${of}.` : `Nothing is waiting${of ? ` on ${of}` : \"\"}.`]","author":"pinch","version":36},{"n":821,"text":"\t\t\t\t: [","author":"init","version":0},{"n":822,"text":"\t\t\t\t\t\t`${plural(asks.length, \"open ask\")}${of ? ` of ${of}` : \"\"}, soonest due first:`,","author":"init","version":0},{"n":823,"text":"\t\t\t\t\t\t...asks.map((a) => askLine(a, api)),","author":"pinch","version":35},{"n":824,"text":"\t\t\t\t\t\t'abso ask <N> shows one with its thread; abso reply <N> \"...\" adds to it; abso answer <N> \"...\" answers one asked of you.',","author":"pinch","version":72},{"n":825,"text":"\t\t\t\t\t]),","author":"pinch","version":36},{"n":826,"text":"\t\t].join(\"\\n\"),","author":"pinch","version":36},{"n":827,"text":"\t\tjson: {","author":"pinch","version":36},{"n":828,"text":"\t\t\tasks,","author":"pinch","version":36},{"n":829,"text":"\t\t\t...(yours.length > 0","author":"pinch","version":36},{"n":830,"text":"\t\t\t\t? { queued: yours.map((q) => ({ id: q.id, message: q.message, standing: standing(queue!.items, q.id) })) }","author":"pinch","version":36},{"n":831,"text":"\t\t\t\t: {}),","author":"pinch","version":36},{"n":832,"text":"\t\t},","author":"pinch","version":36},{"n":833,"text":"\t};","author":"pinch","version":72},{"n":834,"text":"}","author":"pinch","version":72},{"n":835,"text":"","author":"pinch","version":72},{"n":836,"text":"/** abso waiting --asked: the asks you sent, open ones first, then the latest answered, each with its newest reply. */","author":"pinch","version":72},{"n":837,"text":"async function askedOf(args: Parsed, env: Env): Promise<Output> {","author":"pinch","version":72},{"n":838,"text":"\tif (bool(args, \"mine\") || str(args, \"of\") !== undefined)","author":"pinch","version":72},{"n":839,"text":"\t\tthrow new UsageError(\"--asked lists the asks you sent; it takes no --mine or --of\");","author":"pinch","version":72},{"n":840,"text":"\tconst { api, config } = openIssues(env);","author":"pinch","version":72},{"n":841,"text":"\tconst { asks } = await api.asked();","author":"pinch","version":72},{"n":842,"text":"\tconst open = asks.filter((a) => !a.answer);","author":"pinch","version":72},{"n":843,"text":"\tconst closed = asks.filter((a) => a.answer);","author":"pinch","version":72},{"n":844,"text":"\treturn {","author":"pinch","version":72},{"n":845,"text":"\t\ttext: [","author":"pinch","version":72},{"n":846,"text":"\t\t\t...(asks.length === 0","author":"pinch","version":72},{"n":847,"text":"\t\t\t\t? [`${config.agent} hasn't asked anything yet.`]","author":"pinch","version":72},{"n":848,"text":"\t\t\t\t: [","author":"pinch","version":72},{"n":849,"text":"\t\t\t\t\t\t...(open.length > 0","author":"pinch","version":72},{"n":850,"text":"\t\t\t\t\t\t\t? [`${plural(open.length, \"open ask\")} you sent:`, ...open.map((a) => askLine(a, api))]","author":"pinch","version":72},{"n":851,"text":"\t\t\t\t\t\t\t: []),","author":"pinch","version":72},{"n":852,"text":"\t\t\t\t\t\t...(closed.length > 0","author":"pinch","version":72},{"n":853,"text":"\t\t\t\t\t\t\t? [","author":"pinch","version":72},{"n":854,"text":"\t\t\t\t\t\t\t\t\t`${closed.length === 1 ? \"The latest answered\" : `The latest ${closed.length} answered`}:`,","author":"pinch","version":72},{"n":855,"text":"\t\t\t\t\t\t\t\t\t...closed.map((a) => askLine(a, api)),","author":"pinch","version":72},{"n":856,"text":"\t\t\t\t\t\t\t\t]","author":"pinch","version":72},{"n":857,"text":"\t\t\t\t\t\t\t: []),","author":"pinch","version":72},{"n":858,"text":"\t\t\t\t\t\t\"abso ask <N> shows one with its whole thread.\",","author":"pinch","version":72},{"n":859,"text":"\t\t\t\t\t]),","author":"pinch","version":72},{"n":860,"text":"\t\t].join(\"\\n\"),","author":"pinch","version":72},{"n":861,"text":"\t\tjson: { asks },","author":"pinch","version":72},{"n":862,"text":"\t};","author":"pinch","version":53},{"n":863,"text":"}","author":"pinch","version":53},{"n":864,"text":"","author":"pinch","version":53},{"n":865,"text":"/** abso ack <ask> [\"note\"]: tell the asker you have it, and answer later. The ask stays open until abso answer. */","author":"pinch","version":53},{"n":866,"text":"export async function runAck(args: Parsed, env: Env): Promise<Output> {","author":"pinch","version":53},{"n":867,"text":"\tconst [first, ...words] = args.positionals;","author":"pinch","version":53},{"n":868,"text":"\tconst id = issueNumber(first, \"the ask number\");","author":"pinch","version":53},{"n":869,"text":"\tconst { api } = openIssues(env);","author":"pinch","version":53},{"n":870,"text":"\tconst note = words.join(\" \");","author":"pinch","version":53},{"n":871,"text":"\tconst r = await api.ack(id, note !== \"\" ? { note } : {});","author":"pinch","version":53},{"n":872,"text":"\treturn {","author":"pinch","version":53},{"n":873,"text":"\t\ttext: `Acknowledged ask ${id}. ${r.ask.by} hears it; abso reply ${id} \"...\" adds more as you go, and the ask stays open until abso answer ${id} \"...\".`,","author":"pinch","version":72},{"n":874,"text":"\t\tjson: { ask: r.ask },","author":"pinch","version":53},{"n":875,"text":"\t};","author":"init","version":0},{"n":876,"text":"}","author":"init","version":0},{"n":877,"text":"","author":"init","version":0},{"n":878,"text":"export async function runAnswer(args: Parsed, env: Env): Promise<Output> {","author":"init","version":0},{"n":879,"text":"\tconst [first, ...words] = args.positionals;","author":"init","version":0},{"n":880,"text":"\tconst id = issueNumber(first, \"the ask number\");","author":"init","version":0},{"n":881,"text":"\tconst option = str(args, \"option\");","author":"init","version":0},{"n":882,"text":"\tconst done = bool(args, \"done\");","author":"init","version":0},{"n":883,"text":"\tif (words.length === 0 && option === undefined && !done)","author":"init","version":0},{"n":884,"text":"\t\tthrow new UsageError('abso answer <ask> \"<words>\" | --option <N> [--note \"...\"] | --done [--note \"...\"]');","author":"review","version":16},{"n":885,"text":"\tconst { api } = openIssues(env);","author":"init","version":0},{"n":886,"text":"\tconst note = str(args, \"note\");","author":"init","version":0},{"n":887,"text":"\tconst attachments = await uploadAttachments(api, env.cwd, str(args, \"attach\"));","author":"pinch","version":35},{"n":888,"text":"\tconst r = await api.answer(id, {","author":"init","version":0},{"n":889,"text":"\t\t...(words.length > 0 ? { words: words.join(\" \") } : {}),","author":"init","version":0},{"n":890,"text":"\t\t...(option !== undefined ? { option: /^\\d+$/.test(option) ? Number(option) - 1 : option } : {}),","author":"init","version":0},{"n":891,"text":"\t\t...(done ? { done: true } : {}),","author":"init","version":0},{"n":892,"text":"\t\t...(note !== undefined ? { note } : {}),","author":"init","version":0},{"n":893,"text":"\t\t...(attachments.length > 0 ? { attachments } : {}),","author":"pinch","version":35},{"n":894,"text":"\t});","author":"init","version":0},{"n":895,"text":"\tconst lost = notKept(","author":"pinch","version":35},{"n":896,"text":"\t\tattachments,","author":"pinch","version":35},{"n":897,"text":"\t\tr.ask.answer?.attachments?.map((a) => a.id),","author":"pinch","version":35},{"n":898,"text":"\t\t`your answer to ask ${id}`,","author":"pinch","version":35},{"n":899,"text":"\t);","author":"pinch","version":35},{"n":900,"text":"\treturn {","author":"pinch","version":35},{"n":901,"text":"\t\ttext: `Answered ask ${id}${withFiles(attachments)}. ${r.ask.by} hears it.${lost ? ` ${lost}` : \"\"}`,","author":"pinch","version":35},{"n":902,"text":"\t\tjson: { ask: r.ask, ...(lost ? { notKept: lost } : {}) },","author":"pinch","version":35},{"n":903,"text":"\t};","author":"pinch","version":35},{"n":904,"text":"}","author":"pinch","version":96},{"n":905,"text":"","author":"pinch","version":96},{"n":906,"text":"/** What the Issues Worker takes in one comment (its LIMITS.text). */","author":"pinch","version":96},{"n":907,"text":"export const COMMENT_MAX = 4000;","author":"pinch","version":96},{"n":908,"text":"","author":"pinch","version":96},{"n":909,"text":"/** Room a part keeps for its \"(i/n)\" line and blank line, and for closing a code block it ends inside. */","author":"pinch","version":96},{"n":910,"text":"const PART_MARK = 12;","author":"pinch","version":96},{"n":911,"text":"const FENCE_CLOSE = 5;","author":"pinch","version":96},{"n":912,"text":"","author":"pinch","version":96},{"n":913,"text":"/**","author":"pinch","version":96},{"n":914,"text":" * A comment too long for one, as parts that each fit, each starting with \"(i/n)\". A part ends at the last","author":"pinch","version":96},{"n":915,"text":" * paragraph break that fits, else the last line break, else the last space, else at the limit. A part that","author":"pinch","version":96},{"n":916,"text":" * would end inside a fenced code block closes it, and the next part opens it again with the same fence line.","author":"pinch","version":96},{"n":917,"text":" */","author":"pinch","version":96},{"n":918,"text":"export function commentParts(text: string, max = COMMENT_MAX): string[] {","author":"pinch","version":96},{"n":919,"text":"\tif (text.length <= max) return [text];","author":"pinch","version":96},{"n":920,"text":"\tconst bodies: string[] = [];","author":"pinch","version":96},{"n":921,"text":"\tlet rest = text;","author":"pinch","version":96},{"n":922,"text":"\tlet reopen = \"\";","author":"pinch","version":96},{"n":923,"text":"\twhile (rest !== \"\") {","author":"pinch","version":96},{"n":924,"text":"\t\tconst room = max - PART_MARK - FENCE_CLOSE - reopen.length;","author":"pinch","version":96},{"n":925,"text":"\t\tlet body: string;","author":"pinch","version":96},{"n":926,"text":"\t\tif (reopen.length + rest.length <= max - PART_MARK) {","author":"pinch","version":96},{"n":927,"text":"\t\t\tbody = rest;","author":"pinch","version":96},{"n":928,"text":"\t\t\trest = \"\";","author":"pinch","version":96},{"n":929,"text":"\t\t} else {","author":"pinch","version":96},{"n":930,"text":"\t\t\tconst cut = cutAt(rest, room);","author":"pinch","version":96},{"n":931,"text":"\t\t\tbody = rest.slice(0, cut).trimEnd();","author":"pinch","version":96},{"n":932,"text":"\t\t\t// A space cut at goes with neither part; the line breaks between paragraphs go too.","author":"pinch","version":96},{"n":933,"text":"\t\t\trest = rest.slice(rest[cut] === \" \" ? cut + 1 : cut).replace(/^\\n+/, \"\");","author":"pinch","version":96},{"n":934,"text":"\t\t\tif (rest.trim() === \"\") rest = \"\";","author":"pinch","version":96},{"n":935,"text":"\t\t}","author":"pinch","version":96},{"n":936,"text":"\t\tlet part = reopen + body;","author":"pinch","version":96},{"n":937,"text":"\t\tconst fence = openFence(part);","author":"pinch","version":96},{"n":938,"text":"\t\tif (fence && rest !== \"\") {","author":"pinch","version":96},{"n":939,"text":"\t\t\tpart += `\\n${fence.marker}`;","author":"pinch","version":96},{"n":940,"text":"\t\t\treopen = `${fence.line}\\n`;","author":"pinch","version":96},{"n":941,"text":"\t\t} else reopen = \"\";","author":"pinch","version":96},{"n":942,"text":"\t\tbodies.push(part);","author":"pinch","version":96},{"n":943,"text":"\t}","author":"pinch","version":96},{"n":944,"text":"\treturn bodies.map((b, i) => `(${i + 1}/${bodies.length})\\n\\n${b}`);","author":"pinch","version":96},{"n":945,"text":"}","author":"pinch","version":96},{"n":946,"text":"","author":"pinch","version":96},{"n":947,"text":"/** Where to end a part of at most `room` characters of `text`: a paragraph break, a line break, a space, or the limit. */","author":"pinch","version":96},{"n":948,"text":"function cutAt(text: string, room: number): number {","author":"pinch","version":96},{"n":949,"text":"\tconst head = text.slice(0, room);","author":"pinch","version":96},{"n":950,"text":"\tconst floor = room / 4;","author":"pinch","version":96},{"n":951,"text":"\tfor (const at of [head.lastIndexOf(\"\\n\\n\"), head.lastIndexOf(\"\\n\"), head.lastIndexOf(\" \")]) if (at > floor) return at;","author":"pinch","version":96},{"n":952,"text":"\t// Not between the two halves of a character outside the Basic Multilingual Plane.","author":"pinch","version":96},{"n":953,"text":"\tconst code = text.charCodeAt(room - 1);","author":"pinch","version":96},{"n":954,"text":"\treturn code >= 0xd800 && code <= 0xdbff ? room - 1 : room;","author":"pinch","version":96},{"n":955,"text":"}","author":"pinch","version":96},{"n":956,"text":"","author":"pinch","version":96},{"n":957,"text":"/** The fence line of a code block still open at the end of `text`, and the marker that closes it, or undefined. */","author":"pinch","version":96},{"n":958,"text":"function openFence(text: string): { line: string; marker: string } | undefined {","author":"pinch","version":96},{"n":959,"text":"\tlet open: { line: string; marker: string } | undefined;","author":"pinch","version":96},{"n":960,"text":"\tfor (const line of text.split(\"\\n\")) {","author":"pinch","version":96},{"n":961,"text":"\t\tconst m = /^\\s*(`{3,}|~{3,})/.exec(line);","author":"pinch","version":96},{"n":962,"text":"\t\tif (!m) continue;","author":"pinch","version":96},{"n":963,"text":"\t\tif (!open) open = { line, marker: m[1]! };","author":"pinch","version":96},{"n":964,"text":"\t\telse if (m[1]!.startsWith(open.marker) && line.trim() === m[1]) open = undefined;","author":"pinch","version":96},{"n":965,"text":"\t}","author":"pinch","version":96},{"n":966,"text":"\treturn open;","author":"pinch","version":96},{"n":967,"text":"}","author":"init","version":0}],"authors":[{"agent":"pinch","lines":491},{"agent":"init","lines":388},{"agent":"devops","lines":35},{"agent":"review","lines":27},{"agent":"infra-split","lines":18},{"agent":"speed","lines":4},{"agent":"trials","lines":2},{"agent":"groups","lines":1},{"agent":"rename","lines":1}],"older":null,"followed":null,"life":{"versions":22,"last":{"version":294,"agent":"pinch","time":1792121598859,"timeIso":"2026-10-16T03:33:18.859Z","message":"Local projects: issues, asks and news. The open server's issues code runs in the client's process as the project's does, over issues.sqlite beside project.sqlite in the store; every call, issues ones too, holds the project file's lock, so local writers take one lock in one order. abso issue, issues, ask, answer, waiting, news and start --issue work with the network off. Attachments and news --stream don't yet."},"made":{"version":0,"agent":"init","time":1791506895507,"timeIso":"2026-10-09T00:48:15.507Z","message":"Start the project"},"removed":null,"next":null},"since":null,"paths":[".absoignore",".gitignore","LICENSE","README.md","abso.json","biome.json","client/.claude-plugin/plugin.json","client/README.md","client/abso.ts","client/avcs.ts","client/hooks/hooks.json","client/hooks/register.test.ts","client/hooks/register.ts","client/hooks/stamp.ts","client/install-mod.ts","client/install-view.ts","client/launch.mjs","client/scripts/import-git.ts","client/skills/abso/SKILL.md","client/src/announce.ts","client/src/api-answers.ts","client/src/api-error.ts","client/src/api.ts","client/src/args.ts","client/src/at.ts","client/src/autosettle-commands.ts","client/src/blobs.ts","client/src/body-files.ts","client/src/box-commands.ts","client/src/box-run.ts","client/src/box.ts","client/src/changes.ts","client/src/check-ignore.ts","client/src/ci-answers.ts","client/src/ci.ts","client/src/clean-files.ts","client/src/client-version.ts","client/src/collision-text.ts","client/src/command-env.ts","client/src/commands.ts","client/src/config.ts","client/src/core.ts","client/src/diff.ts","client/src/doctor.ts","client/src/drafts.ts","client/src/durable-object-stand-in.ts","client/src/env-names.ts","client/src/export.ts","client/src/fetch.ts","client/src/flag-commands.ts","client/src/folder.ts","client/src/git-origin.ts","client/src/group-commands.ts","client/src/history-answers.ts","client/src/history.ts","client/src/hook.ts","client/src/install.ts","client/src/issues-wire.ts","client/src/issues.ts","client/src/join-commands.ts","client/src/key-admin.ts","client/src/local-server.d.mts","client/src/local-server.mjs","client/src/local-store.ts","client/src/lock.ts","client/src/main.ts","client/src/mcp.ts","client/src/modes.ts","client/src/news-stream.ts","client/src/open-browser.ts","client/src/orgs.ts","client/src/pipeline-commands.ts","client/src/project-file.ts","client/src/publish-commands.ts","client/src/queue.ts","client/src/record-batches.ts","client/src/review.ts","client/src/safety.ts","client/src/serve-commands.ts","client/src/server-choice.ts","client/src/settle.ts","client/src/skill.ts","client/src/state-dir.ts","client/src/status-commands.ts","client/src/tar.ts","client/src/terminal-text.ts","client/src/times.ts","client/src/versions.ts","client/src/visibility-commands.ts","client/src/visitor.ts","client/src/web-session.ts","client/src/without.ts","client/test-mods.ts","client/test/api-request-id.test.ts","client/test/attach.test.ts","client/test/autosettle-command.test.ts","client/test/body-files.test.ts","client/test/box.test.ts","client/test/caller.test.ts","client/test/ci-runs.test.ts","client/test/client-version.test.ts","client/test/client.test.ts","client/test/comment-parts.test.ts","client/test/diff.test.ts","client/test/doctor.test.ts","client/test/env-names.test.ts","client/test/error-sentence.test.ts","client/test/failed-start.test.ts","client/test/fake-server.ts","client/test/flag-command.test.ts","client/test/group-commands.test.ts","client/test/held-push.test.ts","client/test/help.test.ts","client/test/ignore.test.ts","client/test/imported-history.test.ts","client/test/init-credential.test.ts","client/test/install.test.ts","client/test/issues.test.ts","client/test/join-empty.test.ts","client/test/join-signed-out.test.ts","client/test/key-admin.test.ts","client/test/key.test.ts","client/test/launch.test.ts","client/test/local.test.ts","client/test/lost-pull.test.ts","client/test/new-folder-dir.test.ts","client/test/news-stream.test.ts","client/test/open-browser.test.ts","client/test/orgs.test.ts","client/test/pipeline-commands.test.ts","client/test/push-ci-where.test.ts","client/test/queue-waiting.test.ts","client/test/record-batches.test.ts","client/test/run-key.test.ts","client/test/server-flag.test.ts","client/test/setup.ts","client/test/skill.test.ts","client/test/terminal-text.test.ts","client/test/times.test.ts","client/test/token-file.test.ts","client/test/visitor.test.ts","client/test/web-session.test.ts","client/test/why-trail.test.ts","client/view/.claude-plugin/plugin.json","client/view/hooks/hooks.json","client/view/hooks/register.test.ts","client/view/hooks/register.tsx","client/view/hooks/stamp.ts","client/view/types/index.d.ts","docs/readme/abso-core-on-abso.png","docs/readme/open-in-abso.svg","package-lock.json","package.json","scripts/autosettle/STORIES.md","scripts/autosettle/clef.ts","scripts/autosettle/extract.ts","scripts/autosettle/jev.ts","scripts/autosettle/replay.ts","scripts/autosettle/rules.ts","scripts/autosettle/score.ts","scripts/autosettle/settle-one.ts","scripts/autosettle/workers-ai.ts","scripts/autosettle/workers-ai/index.ts","scripts/autosettle/workers-ai/wrangler.jsonc","scripts/build-client.mjs","scripts/check-changed.mjs","scripts/check-changed.test.ts","scripts/local-measure.ts","scripts/local-writers.ts","scripts/pack-npm.mjs","server/README.md","server/STORAGE-FORMATS.md","server/package-lock.json","server/package.json","server/scale/README.md","server/scale/results/scale-mv6vy4y3-10x5.json","server/scale/results/scale-mv6vzxzj-100x10.json","server/scale/results/scale-mv6vzxzj-10x5.json","server/scale/results/scale-mv6vzxzj-1x1.json","server/scale/results/scale-mv6vzxzj-200x20.json","server/scale/results/scale-mv6vzxzj-50x10.json","server/scale/results/scale-mv6vzxzj-ramp.json","server/scale/scale.mjs","server/scripts/capacity-git-bounded-fifo.mjs","server/scripts/capacity-install-git-runtime.mjs","server/scripts/capacity-patch-git-fetch.mjs","server/scripts/capacity-patch-git-progress.mjs","server/scripts/capacity-patch-git-pump.mjs","server/scripts/capacity-patch-git-push.mjs","server/scripts/capacity-patch-git-sideband.mjs","server/src/autosettle.ts","server/src/blobs.ts","server/src/decoded-frames.ts","server/src/disk-first-runtime.ts","server/src/engine-project.ts","server/src/env.ts","server/src/git-blob-text.ts","server/src/git-delta-stream.ts","server/src/git-disk-intake.ts","server/src/git-file-contents.ts","server/src/git-http.ts","server/src/git-intake-limit.ts","server/src/git-intake-trees.ts","server/src/git-object-bytes.ts","server/src/git-pack-decode.ts","server/src/git-pack-resolver.ts","server/src/git-pack-spool.ts","server/src/history-host.ts","server/src/history-state.ts","server/src/index.ts","server/src/ingest.ts","server/src/issues-entry.ts","server/src/issues/index.ts","server/src/issues/routes.ts","server/src/issues/seats.ts","server/src/issues/serve.ts","server/src/issues/store.ts","server/src/json-chunk-cursor.ts","server/src/json-events.ts","server/src/keys.ts","server/src/memory-fs.ts","server/src/project-object.ts","server/src/projection-store.ts","server/src/push-snapshot.ts","server/src/push.ts","server/src/request-identity-digest.ts","server/src/router.ts","server/src/small-frame-json.ts","server/src/stored-json-view.ts","server/src/stored-json.ts","server/src/writer-host.ts","server/test/atom-list-history.test.ts","server/test/blobs.test.ts","server/test/canonical-frame-numbers.test.ts","server/test/decoded-adoption-bounds.test.ts","server/test/decoded-entry-adoption.test.ts","server/test/decoded-frames-small.test.ts","server/test/decoded-frames.test.ts","server/test/definition-scratch-runtime.test.ts","server/test/disk-first-runtime.test.ts","server/test/e2e-transcript.md","server/test/engine-project.test.ts","server/test/frame-chunks.test.ts","server/test/git-blob-text.test.ts","server/test/git-budget-recovery.test.ts","server/test/git-delta-stream.test.ts","server/test/git-disk-clone.test.ts","server/test/git-export-http.test.ts","server/test/git-file-contents.test.ts","server/test/git-intake-trees.test.ts","server/test/git-object-bytes.test.ts","server/test/git-pack-decode.test.ts","server/test/git-pack-resolver.test.ts","server/test/git-pack-spool.test.ts","server/test/helpers.ts","server/test/history-host.test.ts","server/test/history-recovery.test.ts","server/test/history-state.test.ts","server/test/issues/ask-threads.test.ts","server/test/issues/changes.test.ts","server/test/issues/issues.test.ts","server/test/issues/news.test.ts","server/test/issues/serve.test.ts","server/test/json-chunk-cursor.test.ts","server/test/json-events.test.ts","server/test/long-text-history.test.ts","server/test/project-object-disk-first.test.ts","server/test/projected-compare.test.ts","server/test/projected-diff.test.ts","server/test/projected-move-sync.test.ts","server/test/projected-move.test.ts","server/test/projected-path-history.test.ts","server/test/projected-queue.test.ts","server/test/projected-restore.test.ts","server/test/projected-sync.test.ts","server/test/push-snapshot-batch.test.ts","server/test/push-snapshot.test.ts","server/test/push.test.ts","server/test/request-identity-digest.test.ts","server/test/router.test.ts","server/test/small-frame-integrity.test.ts","server/test/small-frame-json.test.ts","server/test/stored-json-view.test.ts","server/test/stored-json.test.ts","server/test/streamed-history-host.test.ts","server/test/streamed-large-frame.test.ts","server/test/streamed-large-history.test.ts","server/test/streamed-log-append.test.ts","server/test/streamed-log-transaction.test.ts","server/test/streamed-writer-adoption.test.ts","server/test/writer-host.test.ts","server/test/writer-long-atom.test.ts","server/tsconfig.json","server/wrangler.jsonc","src/caller.ts","src/engine/build.ts","src/engine/child-counts.ts","src/engine/conflicts.ts","src/engine/experimental/projection-atom-adoption.ts","src/engine/experimental/projection-atom-index.ts","src/engine/experimental/projection-locator.ts","src/engine/experimental/projection-marker.ts","src/engine/experimental/projection-move-adoption.ts","src/engine/experimental/projection-move-resolution.ts","src/engine/experimental/projection-overlay-storage.ts","src/engine/experimental/projection-priority.ts","src/engine/experimental/projection-read-scope.ts","src/engine/experimental/projection-reader.ts","src/engine/experimental/projection-records.ts","src/engine/experimental/projection-root.ts","src/engine/experimental/projection-sequence.ts","src/engine/experimental/projection-snapshots.ts","src/engine/graph.ts","src/engine/index.ts","src/engine/json-value-chunks.ts","src/engine/keys.ts","src/engine/labels.ts","src/engine/ordered-index.ts","src/engine/projection-scratch.ts","src/engine/relocation-scratch.ts","src/engine/sets.ts","src/engine/state-source.ts","src/engine/stored-text.ts","src/engine/test/attribute-projection.test.ts","src/engine/test/build-lazy-lines.test.ts","src/engine/test/build.test.ts","src/engine/test/child-counts.test.ts","src/engine/test/concurrent.test.ts","src/engine/test/conflicts.test.ts","src/engine/test/gen.ts","src/engine/test/graph-atom-list-integrity.test.ts","src/engine/test/graph-atom-list-pages.test.ts","src/engine/test/graph-atom-list-rollback.test.ts","src/engine/test/graph-atom-lists.test.ts","src/engine/test/graph-deletion-pages.test.ts","src/engine/test/graph-deletion-rollback.test.ts","src/engine/test/graph-index-dedup.test.ts","src/engine/test/graph-insertion-integrity.test.ts","src/engine/test/graph-insertion-runs.test.ts","src/engine/test/graph-insertion-storage.test.ts","src/engine/test/graph-line-chunks.test.ts","src/engine/test/graph-long-text.test.ts","src/engine/test/graph-metadata-indexed.test.ts","src/engine/test/graph-move-write-membership.test.ts","src/engine/test/graph-replacement-membership.test.ts","src/engine/test/graph-validation-scratch.test.ts","src/engine/test/graph.test.ts","src/engine/test/helpers.ts","src/engine/test/json-string-chunks.test.ts","src/engine/test/json-value-chunks.test.ts","src/engine/test/lamport-pages.test.ts","src/engine/test/moves.test.ts","src/engine/test/ordered-index.test.ts","src/engine/test/packed-files.test.ts","src/engine/test/projection-atom-adoption.test.ts","src/engine/test/projection-atom-index.test.ts","src/engine/test/projection-locator.test.ts","src/engine/test/projection-marker-cycle.test.ts","src/engine/test/projection-marker-move-failures.test.ts","src/engine/test/projection-marker.test.ts","src/engine/test/projection-membership-iterator.test.ts","src/engine/test/projection-move-resolution.test.ts","src/engine/test/projection-overlay-storage.test.ts","src/engine/test/projection-priority.test.ts","src/engine/test/projection-read-scope.test.ts","src/engine/test/projection-reader-integrity.test.ts","src/engine/test/projection-reader.test.ts","src/engine/test/projection-records.test.ts","src/engine/test/projection-root.test.ts","src/engine/test/projection-scratch.test.ts","src/engine/test/projection-sequence.test.ts","src/engine/test/projection-snapshots.test.ts","src/engine/test/properties.test.ts","src/engine/test/reachability-scratch.test.ts","src/engine/test/reasons-to.test.ts","src/engine/test/record-query-contract.test.ts","src/engine/test/relocation-scratch.test.ts","src/engine/test/scenarios.test.ts","src/engine/test/sets.test.ts","src/engine/test/stable-set-algebra.test.ts","src/engine/test/state-cache.test.ts","src/engine/test/state-source.test.ts","src/engine/test/storage-helper.ts","src/engine/test/stored-list-array.test.ts","src/engine/test/stored-list-integrity.test.ts","src/engine/test/stored-text.test.ts","src/engine/test/streamed-diff.test.ts","src/engine/test/text.test.ts","src/engine/test/view.test.ts","src/engine/test/visible-neighbours.test.ts","src/engine/text.ts","src/engine/types.ts","src/engine/view.ts","src/gitview/errors.ts","src/gitview/index.ts","src/gitview/ingest.ts","src/gitview/plain.ts","src/gitview/test/helpers.ts","src/gitview/test/ingest.test.ts","src/gitview/test/random.test.ts","src/gitview/test/view.test.ts","src/gitview/trailers.ts","src/gitview/tree.ts","src/gitview/view.ts","src/pipeline/pipeline.ts","src/pipeline/plan.ts","src/pipeline/test/pipeline.test.ts","src/pipeline/test/plan.test.ts","tsconfig.json","worker/project/add-draft.ts","worker/project/amend.ts","worker/project/announce.ts","worker/project/apply-entry.ts","worker/project/autosettle.ts","worker/project/blame.ts","worker/project/change-records.ts","worker/project/changes-since.ts","worker/project/check-clash.ts","worker/project/collisions.ts","worker/project/definition-code.ts","worker/project/definition-rule.ts","worker/project/definitions.ts","worker/project/draft-collisions.ts","worker/project/draft-diff.ts","worker/project/draft-state.ts","worker/project/drop.ts","worker/project/edit.ts","worker/project/express-moves.ts","worker/project/feed.ts","worker/project/globs.ts","worker/project/history.ts","worker/project/http.ts","worker/project/ingest.ts","worker/project/init.ts","worker/project/kept-parts.ts","worker/project/label.ts","worker/project/land.ts","worker/project/lifecycle-permit-contract.ts","worker/project/markers.ts","worker/project/memory-store.ts","worker/project/merge-identical.ts","worker/project/move-line-text.ts","worker/project/move.ts","worker/project/names.ts","worker/project/news.ts","worker/project/notes.ts","worker/project/operation-protocol.ts","worker/project/overlaps.ts","worker/project/path-rules.ts","worker/project/pathindex.ts","worker/project/pathkey.ts","worker/project/pluck.ts","worker/project/project-api.ts","worker/project/project-error.ts","worker/project/project-helpers.ts","worker/project/project-status.ts","worker/project/project-types.ts","worker/project/project.ts","worker/project/projection-provider.ts","worker/project/publish-of.ts","worker/project/publish.ts","worker/project/queue-driver.ts","worker/project/queue.ts","worker/project/record-file.ts","worker/project/record.ts","worker/project/refuse.ts","worker/project/restore.ts","worker/project/spaces.ts","worker/project/spelling.ts","worker/project/start.ts","worker/project/switch-to.ts","worker/project/sync.ts","worker/project/test/after-read.test.ts","worker/project/test/agent-views-shared.test.ts","worker/project/test/announce-person.test.ts","worker/project/test/appends.test.ts","worker/project/test/attributes.test.ts","worker/project/test/author-totals.test.ts","worker/project/test/authors-stored.test.ts","worker/project/test/autosettle.test.ts","worker/project/test/bench.ts","worker/project/test/blobs-stored.test.ts","worker/project/test/blobs.test.ts","worker/project/test/changed-definition.test.ts","worker/project/test/changes.test.ts","worker/project/test/collision-streaming.test.ts","worker/project/test/collisions-kept-views.test.ts","worker/project/test/compare-summary.test.ts","worker/project/test/definition-code.test.ts","worker/project/test/definitions.test.ts","worker/project/test/draft-files-kept.test.ts","worker/project/test/draft-reads-stored.test.ts","worker/project/test/drop.test.ts","worker/project/test/express-moves-early.test.ts","worker/project/test/file-exact-at.test.ts","worker/project/test/files-reads.test.ts","worker/project/test/history.test.ts","worker/project/test/ingest.test.ts","worker/project/test/issues.test.ts","worker/project/test/kept-parts.test.ts","worker/project/test/known-paths.test.ts","worker/project/test/labels.test.ts","worker/project/test/land-streaming.test.ts","worker/project/test/lifecycle-permit-contract.test.ts","worker/project/test/markers.test.ts","worker/project/test/membership-cache.test.ts","worker/project/test/membership-pages.test.ts","worker/project/test/merge.test.ts","worker/project/test/move-line-text.test.ts","worker/project/test/move-reconstruction.test.ts","worker/project/test/moves.test.ts","worker/project/test/named-drafts.test.ts","worker/project/test/news-cap.test.ts","worker/project/test/news-lazy.test.ts","worker/project/test/news-lines.test.ts","worker/project/test/news-times.test.ts","worker/project/test/news-written.test.ts","worker/project/test/notes.test.ts","worker/project/test/operation-protocol.test.ts","worker/project/test/order.test.ts","worker/project/test/owed-definition-news.test.ts","worker/project/test/packed-crossings.test.ts","worker/project/test/paths.test.ts","worker/project/test/pluck.test.ts","worker/project/test/project-file.test.ts","worker/project/test/project-writer-storage.test.ts","worker/project/test/project.test.ts","worker/project/test/projection-integration.test.ts","worker/project/test/queue-driver.test.ts","worker/project/test/queue.test.ts","worker/project/test/queued-moves.test.ts","worker/project/test/record-idempotence.test.ts","worker/project/test/record-stream.test.ts","worker/project/test/review-fixes.test.ts","worker/project/test/reviewers.test.ts","worker/project/test/same-line.test.ts","worker/project/test/seat-notice.test.ts","worker/project/test/shared-additions.test.ts","worker/project/test/spelling-clash.test.ts","worker/project/test/spelling.test.ts","worker/project/test/starting.test.ts","worker/project/test/stored-closure.test.ts","worker/project/test/stored-membership.test.ts","worker/project/test/tells.test.ts","worker/project/test/told-buckets.test.ts","worker/project/test/touched-beyond.test.ts","worker/project/test/trail.test.ts","worker/project/test/unseen.test.ts","worker/project/test/version-files.test.ts","worker/project/test/view-cache.test.ts","worker/project/test/where-many-agents.test.ts","worker/project/test/whole.test.ts","worker/project/test/without.test.ts","worker/project/test/writer-adoption.test.ts","worker/project/trail.ts","worker/project/tree.ts","worker/project/unseen.ts","worker/project/version-files.ts","worker/project/version-log.ts","worker/project/version-meta.ts","worker/project/view-changes.ts","worker/project/views.ts","worker/project/where.ts","worker/project/whole-files.ts","worker/project/without.ts","worker/project/writer-agents.ts"],"working":{"version":318,"agents":[]},"agentChanges":[],"overlaps":{"version":318,"agents":["codex-capacity-chair","codex-capacity-policy","review"],"collisions":[]}}