{"draft":null,"from":13,"to":14,"files":[{"path":"client/src/issues.ts","added":22,"removed":2,"diff":"--- a/client/src/issues.ts\n+++ b/client/src/issues.ts\n@@ -59,7 +59,9 @@\n \tconst where = a.issue === null ? \"\" : ` on issue ${a.issue}${a.title ? ` (${q(a.title)})` : \"\"}`;\n \tconst extra = [\n \t\t// Who answered, and when, on the ask's own line, so a handled ask can't pass for an open one.\n-\t\ta.answer ? `answered by ${a.answer.by}, ${shortWhen(a.answer.at)}` : \"\",\n+\t\ta.answer\n+\t\t\t? `${a.outcome === \"withdrawn\" ? \"withdrawn\" : \"answered\"} by ${a.answer.by}, ${shortWhen(a.answer.at)}`\n+\t\t\t: \"\",\n \t\t!a.answer && a.seen !== undefined ? seenText(a.seen) : \"\",\n \t\ta.due ? `due ${a.due}` : \"\",\n \t\ta.blocks.length > 0 ? `blocks ${a.blocks.join(\", \")}` : \"\",\n@@ -68,7 +70,9 @@\n \tconst lines = [head];\n \tif (a.options.length > 0) lines.push(`    options: ${a.options.map((o, i) => `${i + 1}. ${q(o)}`).join(\", \")}`);\n \tif (a.recommendation) lines.push(`    ${a.recommendation.by} recommends: ${q(a.recommendation.text)}`);\n-\tif (a.answer) lines.push(`    answer: ${q(a.answer.words)}`);\n+\tif (a.answer && a.outcome === \"withdrawn\") {\n+\t\tif (a.answer.words !== \"\") lines.push(`    why: ${q(a.answer.words)}`);\n+\t} else if (a.answer) lines.push(`    answer: ${q(a.answer.words)}`);\n \treturn lines.join(\"\\n\");\n }\n \n@@ -429,6 +433,10 @@\n }\n \n export async function runAsk(args: Parsed, env: Env): Promise<Output> {\n+\tconst withdraw = str(args, \"withdraw\");\n+\tif (withdraw !== undefined) return withdrawAsk(args, env, withdraw);\n+\tif (str(args, \"note\") !== undefined)\n+\t\tthrow new UsageError('--note goes with --withdraw: avcs ask --withdraw <ask> --note \"why\"');\n \tconst [of, ...words] = args.positionals;\n \tif (of === undefined || words.length === 0)\n \t\tthrow new UsageError(\n@@ -459,6 +467,18 @@\n \treturn { text: `Asked ${of} (ask ${r.id}). They hear it; avcs waiting shows what's open.`, json: { id: r.id } };\n }\n \n+/** avcs ask --withdraw <ask> [--note \"why\"]: the asker takes an ask back. It closes like an answer, and the one asked hears it. */\n+async function withdrawAsk(args: Parsed, env: Env, word: string): Promise<Output> {\n+\tconst others = [\"issue\", \"due\", \"blocks\", \"options\"].filter((f) => str(args, f) !== undefined);\n+\tif (args.positionals.length > 0 || others.length > 0 || bool(args, \"review\") || bool(args, \"task\"))\n+\t\tthrow new UsageError('avcs ask --withdraw <ask> [--note \"why\"] takes nothing else: it takes back an ask you made');\n+\tconst id = issueNumber(word, \"the ask number\");\n+\tconst { api } = openIssues(env);\n+\tconst note = str(args, \"note\");\n+\tconst r = await api.withdraw(id, note !== undefined ? { note } : {});\n+\treturn { text: `Withdrew ask ${id}. ${r.ask.of} hears it, and it no longer waits on them.`, json: { ask: r.ask } };\n+}\n+\n export async function runWaiting(args: Parsed, env: Env): Promise<Output> {\n \tif (args.positionals.length > 0)\n \t\tthrow new UsageError(\"waiting takes no words: avcs waiting [--of <agent or person:id>] [--mine]\");"}],"unmatched":[]}