@rfany/rf 0.20.7 → 0.21.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/rf.mjs +39 -51
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rfany/rf",
3
- "version": "0.20.7",
3
+ "version": "0.21.0",
4
4
  "description": "rollforward's command line for people: what its page does, from a shell or a desktop agent, as you",
5
5
  "license": "MIT",
6
6
  "repository": { "type": "git", "url": "git+https://github.com/spoj/rollforward.git", "directory": "cli" },
package/rf.mjs CHANGED
@@ -50,10 +50,9 @@ rf approve PATH cN [TEXT] [--wake] records content approval of proposal cN, no
50
50
  rf reject PATH cN [TEXT] [--wake] rejects the agent's proposal cN, with feedback on missing information or changes;
51
51
  revised work takes a new proposal
52
52
  rf react PATH [cN] up|down|none your thumbs up or down on comment cN, or on the instance, or none; quiet, open or closed
53
- rf close PATH [--as-series NAME] the series owner makes it the record and an example,
53
+ rf close PATH [--as-series NAME] the series owner freezes it as the record and an example,
54
54
  approving nothing; a task closes as a one-off, or as the first instance of the series NAME it
55
55
  becomes
56
- rf abandon PATH the series owner leaves it as it is, neither an example nor a starting point
57
56
  rf delete PATH [--yes] its workspace's owners and admins delete an instance, in any status, once they confirm, or
58
57
  with --yes: a run for it is cut, and all the server holds of it goes but its label and place,
59
58
  shown as deleted, by whom and when; it can't be undone, and copies outside the server stay
@@ -63,7 +62,7 @@ rf series owner SERIES [EMAIL] [--json] the whole series' owner; EMAIL transfe
63
62
  rf series credentials SERIES [--set OFFER,...|--clear] [--autonomous true|false] [--json]
64
63
  credentials for every instance; only the owner saves consent, explicitly including [] with
65
64
  --clear; saving requires --autonomous true|false; no credentials transfer (schedules pause until opted in)
66
- rf rename PATH NAME an instance, a series or a workspace, by its path
65
+ rf rename PATH NAME an open instance, a series or a workspace, by its path
67
66
  rf new task WORKSPACE [LABEL] [--creds OFFER,...|--clear] [--autonomous true|false] [--comment TEXT [--wake]] a one-off task, Untitled until LABEL or its
68
67
  first comment names it; --wake starts its run on the comment; without --creds or --clear,
69
68
  no execution consent is granted; --clear explicitly permits work with no credentials
@@ -105,8 +104,8 @@ rf site ask NAME WORKSPACE REASON to use your login to NAME in WORKSPACE's runs,
105
104
  rf grants [WORKSPACE] [--json] the grants to use websites, yours and those of the workspaces you own, with their states
106
105
  rf grant approve|deny ID [TEXT] a request to use a website in a workspace you own, with TEXT for its asker
107
106
  rf grant revoke ID a grant pending or approved, yours or in a workspace you own; its runs' browsers close
108
- rf correct PATH TEXT [--item ID] [--ref REF] [--superseded] [--see LABEL] a closed instance, or its item ID at REF, is
109
- wrong, or superseded, as LABEL, another instance of its series, shows; it can't be withdrawn
107
+ rf outcome PATH TEXT [--item ID] [--ref REF] [--see LABEL] records a free-text outcome on a closed instance, or its item ID
108
+ at REF, optionally linking LABEL, another instance of its series; it can't be withdrawn
110
109
  rf wake PATH AT [TEXT] [--label LABEL] [--days DAYS] [--check PATH [--deadline ISO] [--max-stale MIN] [--backstop-hours H]] | rf wake --cancel ID
111
110
  AT now, +<n>m|h|d or a date; PATH an open instance, or a series with LABEL; TEXT a short
112
111
  message for the run; the owner's now starts under current consent without autonomous opt-in;
@@ -136,8 +135,8 @@ rf runs [PATH] [--since DATE] [--failed] [--running] [--long MIN] [-d SECONDS] [
136
135
  rf costs [PATH] [--since DATE] [--by workspace|series|person|day|outcome] [--daily] [--json] totals, runs and cost per run,
137
136
  plus server calls and OpenRouter key usage for admins; --daily lists each day by workspace,
138
137
  person, run and server; runs leave out those that were cut, as the next run carries each on
139
- rf activity [PATH] [--since DATE] [--json] per instance, what people and the agent said, what people uploaded, closed and
140
- deleted, and each run that failed
138
+ rf activity [PATH] [--since DATE] [--json] per instance, what people and the agent said, what people uploaded, closed,
139
+ recorded outcomes on and deleted, and each run that failed
141
140
  rf wakes [PATH] [--json] each series' pending wakes and requests to start an instance, and when a wake of it last
142
141
  fired, and each instance's pending wakes
143
142
  rf people WORKSPACE [--set FILE|-] [-n] [--force] its owners and admins: its people as lines of owner|member EMAIL-OR-GROUP,
@@ -185,7 +184,7 @@ What there is
185
184
  - A workspace holds series, and its people. A series is one recurring job; an instance is one period of it, labelled such as
186
185
  2026-08-23. A task is a one-off: a series of one instance, named by its label, until someone makes it a series. PATH is workspace/series/label, as rf ls prints it; for rf pull it may go deeper, into an instance's files.
187
186
  - An instance's screen is its items: inputs, outputs and steps, each pointing at a file, with what it's made from. Only the series
188
- owner starts new instances, uploads or attaches files, posts comments, reacts, closes or abandons inside an instance. Their acts
187
+ owner starts new instances, uploads or attaches files, posts comments, reacts or closes inside an instance. Their acts
189
188
  and answers or decisions by whom the agent's ask named (--ask --to / --propose --to) start runs under current consent. Runs use the
190
189
  owner's selected credentials, across every instance. Without consent, nothing runs; selecting none permits work with no
191
190
  credentials. Scheduled and autonomous runs need a separate opt-in. Other collaborators leave notes, files and requests at the
@@ -201,7 +200,7 @@ What there is
201
200
  proposal missing information should be rejected with feedback, so the agent can revise and propose again. Generic comments
202
201
  are not proposal decisions. rf ls says how many asks wait in each instance. Reactions, thumbs up or down, are
203
202
  quiet signals kept for later. Only the series owner or the person a proposal names (--to) may approve or reject it; approval commits the instance's folder to its
204
- history, .git in it, as it is then, as closing does. Whose approval counts, and for what, is the series' call.
203
+ history, .git in it, as it is then, as closing does.
205
204
 
206
205
  What rf pull copies, the folders as the agent sees them
207
206
  AGENTS.md the company's conventions; <workspace>/AGENTS.md the workspace's
@@ -210,7 +209,7 @@ What rf pull copies, the folders as the agent sees them
210
209
  log.jsonl every event, by seq: by is a person's email, "server" or "agent"; op is upload, comment (thread, item,
211
210
  ref, parent, text, files, ask, question or proposal, to), signoff (an approval of the proposal it names, on,
212
211
  with its commit), reject, withdraw (the agent's, of its question or proposal on), react,
213
- commit, point and item (the screen changing), run, done (its cost, or error), close, and the rest
212
+ commit, point and item (the screen changing), run, done (its cost, or error), close, outcome, and the rest
214
213
  upload/ what people uploaded, their comments' attachments in upload/attachments/
215
214
  working/ what the agent made, its scripts, and process.md, how it does this series
216
215
  session/ each run's transcript: every message and tool call
@@ -227,7 +226,7 @@ Usual work
227
226
  - What waits on me: rf waiting, then rf show PATH, which names each comment that waits by its id. Note notices are FYI.
228
227
  - Answer a question: rf comment PATH --in cN --wait TEXT, which prints what the agent says back. Decide a proposal:
229
228
  rf approve PATH cN [TEXT] --wake, for the agent to go ahead, or rf reject PATH cN [TEXT] --wake. Close an
230
- instance once it's the record: rf close PATH.
229
+ instance once it's the record: rf close PATH. Record a post-close outcome: rf outcome PATH TEXT.
231
230
  - Transfer a whole series, as its current owner or workspace manager: rf series owner SERIES EMAIL. The incoming owner
232
231
  selects credentials with rf series credentials SERIES --set OFFER,... --autonomous false, or --clear for none.
233
232
  Every instance may use that selection: this is not an instance setting. No self-takeover right for collaborators.
@@ -272,6 +271,8 @@ const replacement = new Map([
272
271
  ['ask', 'rf comment TARGET --ask TEXT'],
273
272
  ['propose', 'rf comment TARGET --propose TEXT'],
274
273
  ['withdraw', 'rf settle TARGET#cN withdrawn TEXT'],
274
+ ['correct', 'rf outcome PATH TEXT [--item ID] [--ref REF] [--see LABEL]'],
275
+ ['abandon', 'rf close PATH (and optionally rf outcome PATH TEXT)'],
275
276
  ]).get(cmd === 'help' ? argv[0] : cmd);
276
277
  if (replacement) throw new Error(`use ${replacement}`);
277
278
 
@@ -287,7 +288,7 @@ if (cmd === 'comment' || cmd === 'settle') {
287
288
  } else for (let i = 0; i < argv.length; i++) {
288
289
  const flag = argv[i] === '-n' ? 'dry-run' : argv[i] === '-d' ? 'delay' : argv[i].match(/^--(.+)$/)?.[1];
289
290
  if (!flag) args.push(argv[i]);
290
- else if (['wait', 'wake', 'output', 'delete', 'dry-run', 'force', 'json', 'failed', 'running', 'clear', 'follow', 'superseded', 'undo', 'by-amount', 'yes', 'mine', 'daily', 'all', 'az', 'dismiss-settled'].includes(flag)) flags[flag] = true;
291
+ else if (['wait', 'wake', 'output', 'delete', 'dry-run', 'force', 'json', 'failed', 'running', 'clear', 'follow', 'undo', 'by-amount', 'yes', 'mine', 'daily', 'all', 'az', 'dismiss-settled'].includes(flag)) flags[flag] = true;
291
292
  else if (argv[i + 1] === undefined) throw new Error(`--${flag} takes a value`);
292
293
  else if (flag === 'exclude') excludes.push(argv[++i]);
293
294
  else flags[flag] = argv[++i];
@@ -297,11 +298,12 @@ if (cmd === '--version') {
297
298
  console.log(JSON.parse(readFileSync(new URL(import.meta.url.endsWith('.ts') ? '../cli/package.json' : 'package.json', import.meta.url), 'utf8')).version);
298
299
  process.exit();
299
300
  }
300
- if ((!cmd || cmd === 'help') && !existsSync(config)) {
301
- console.log(!cmd ? usage() : args[0] ? usage(args[0]) : GUIDE);
301
+ const isHelp = !cmd || cmd === 'help' || cmd === '--help' || cmd === '-h';
302
+ if (isHelp && !existsSync(config)) {
303
+ console.log(!cmd || cmd === '--help' || cmd === '-h' ? usage() : args[0] ? usage(args[0]) : GUIDE);
302
304
  process.exit();
303
305
  }
304
- if (cmd !== 'login' && !existsSync(config)) throw new Error('sign in first: rf login URL');
306
+ if (cmd !== 'login' && !isHelp && !existsSync(config)) throw new Error('sign in first: rf login URL');
305
307
  let { url, token, auth, resource } = cmd === 'login'
306
308
  ? { url: args[0]?.replace(/\/$/, ''), token: args[1], auth: flags.az ? 'az' : (typeof flags.auth === 'string' ? flags.auth : undefined), resource: typeof flags.resource === 'string' ? flags.resource : undefined }
307
309
  : JSON.parse(readFileSync(config, 'utf8'));
@@ -371,13 +373,13 @@ async function api(path , init = {}, accept = [])
371
373
  const get = async (path ) => (await api(path)).json();
372
374
  const post = (path , body , method = 'POST') => api(path, { method, body: JSON.stringify(body) });
373
375
 
374
- if (!cmd || cmd === 'help') {
376
+ if (isHelp) {
375
377
  const me = await get('/me'), vpn = me.can.includes('vpn'), admin = me.role === 'admin';
376
378
  const guide = GUIDE + (vpn ? `\n\nClient VPNs
377
379
  ${usage('vpns', vpn, admin)}
378
380
  ${admin ? `${usage('vpn', vpn, admin)}\n` : ''}rf site set NAME --via VPN uses your connection to that client VPN for this website; --via '' clears it.
379
381
  Sign in to a VPN on the page. VPN access needs an explicit grant, even for admins.` : '');
380
- console.log(!cmd || args[0] ? usage(args[0], vpn, admin) : guide);
382
+ console.log(!cmd || cmd === '--help' || cmd === '-h' || args[0] ? usage(args[0], vpn, admin) : guide);
381
383
  process.exit();
382
384
  }
383
385
 
@@ -666,35 +668,12 @@ if (cmd === 'login' && url) {
666
668
  if (r.wakeCheck) console.log(` Wake check stopped: ${clip(r.wakeCheck.message.replace(/[\x00-\x1f\x7f-\x9f]/g, ' '), TEXT_COLS)}`);
667
669
  for (const k of r.wakes) console.log(` wake ${k.id} ${k.at}${k.label ? ` starts ${k.label}` : ''}${k.days ? `, then each ${k.days.join(', ')}` : ''}${k.text ? `: ${k.text}` : ''}${k.check ? `; check ${k.check}${k.deadline ? ` until ${k.deadline}` : ''}${k.maxStaleMin ? `, max-stale ${k.maxStaleMin}m` : ''}${k.backstopHours ? `, backstop ${k.backstopHours}h` : ''}` : ''}`);
668
670
  }
671
+ } else if (cmd === 'waiting' && flags['dismiss-settled'] && !args.length) {
672
+ const res = await (await post('/api/messages', { dismissAll: 'settled' })).json();
673
+ console.log(flags.json ? JSON.stringify(res, null, 1) : `dismissed ${res.dismissed} settled note notice${res.dismissed === 1 ? '' : 's'}`);
669
674
  } else if (cmd === 'waiting' && !args.length) {
670
- if (flags['dismiss-settled']) {
671
- const res = await (await post('/api/messages', { dismissAll: 'settled' })).json();
672
- console.log(flags.json ? JSON.stringify(res, null, 1) : `dismissed ${res.dismissed} settled note notice${res.dismissed === 1 ? '' : 's'}`);
673
- } else {
674
675
  const [me, s, all] = await Promise.all([get('/me'), get('/api/status'), get('/api')]), mine = (who ) => (who ?? me.email) === me.email;
675
676
  const series = all.flatMap(w => w.series.map(x => ({ ...x, path: `${w.name}/${x.name}` })));
676
- const refusedByHost = new Map ();
677
- for (const w of all) if (!w.archived) for (const x of w.series) if (!x.archived) for (const i of x.instances) for (const r of i.refused ?? []) for (const h of r.hosts ?? []) {
678
- const key = `${r.login}\0${r.site}\0${h}`, c = r.counts?.[h] ?? r.count ?? 1, hostAt = r.ats?.[h] ?? r.at ?? '', t = Date.parse(hostAt) || 0, rev = r.revs?.[h] ?? r.siteRev;
679
- const prev = refusedByHost.get(key);
680
- if (!prev) refusedByHost.set(key, { path: `${w.name}/${x.name}/${i.label}`, since: hostAt, t, run: r.run, site: r.site, ...(rev && { rev }), person: r.login, host: h, why: r.why?.[h] ?? '', count: c });
681
- else {
682
- prev.count += c;
683
- if (t > prev.t || (t === prev.t && (r.run ?? 0) >= prev.run)) Object.assign(prev, { path: `${w.name}/${x.name}/${i.label}`, since: hostAt, t, run: r.run, ...(rev && { rev }), why: r.why?.[h] || prev.why });
684
- }
685
- }
686
- const refusedRows = new Map ();
687
- for (const h of refusedByHost.values()) {
688
- const rowKey = `${h.person}\0${h.site}\0${h.path}\0${h.run}`;
689
- let row = refusedRows.get(rowKey);
690
- if (!row) refusedRows.set(rowKey, row = { path: h.path, since: h.since, t: h.t, run: h.run, site: h.site, person: h.person, hosts: [], why: {}, counts: {}, ats: {}, revs: {} });
691
- else if (h.t > row.t) { row.since = h.since; row.t = h.t; }
692
- row.hosts.push(h.host);
693
- if (h.why) row.why[h.host] = h.why;
694
- row.counts[h.host] = h.count;
695
- if (h.since) row.ats[h.host] = h.since;
696
- if (h.rev) row.revs[h.host] = h.rev;
697
- }
698
677
  const rows = [
699
678
  ...s.ownership.map(s => ({ kind: 'owner', path: s.path, text: s.text })),
700
679
  ...s.asks.filter(a => a.who === me.email && !a.legacyNotice).map(a => ({ kind: a.note ? 'note' : 'ask', path: a.path, since: a.since, text: a.text })),
@@ -702,15 +681,18 @@ if (cmd === 'login' && url) {
702
681
  ...series.flatMap(x => x.requests.filter(r => mine(r.who)).map(r => ({ kind: 'request', path: x.path, since: r.at, id: r.id, text: `${r.from} asks to ${r.target ? 'wake' : 'start'} ${r.label}${r.text ? `: ${r.text}` : ''}` }))),
703
682
  ...all.filter(w => w.manage && w.proposal?.into === w.id).map(({ proposal: p }) => ({ kind: 'proposal', path: p.to, since: p.at, text: `${p.by} proposes to ${p.kind === 'merge' ? `merge ${p.from} into it` : `move ${p.from}/${p.series} to it`}` })),
704
683
  ...s.expired.filter(e => e.who === me.email).map(e => ({ kind: 'expired', login: e.login, holding: e.holding, text: `your ${e.login} login expired` })),
705
- ...[...refusedRows.values()].map(r => ({ kind: 'refused', path: r.path, since: r.since, site: r.site, hosts: r.hosts, person: r.person, why: r.why, counts: r.counts, ats: r.ats, ...(Object.keys(r.revs).length && { revs: r.revs }), text: `run ${r.run}'s browser on ${r.person}'s ${r.site} was refused ${r.hosts.map(h => { const c = r.counts[h]; const meta = [c > 1 ? `${c}×` : '', r.why[h] ?? ''].filter(Boolean).join(', '); return meta ? `${h} (${meta})` : h; }).join(', ')}` })),
706
- ...all.filter(w => !w.archived).flatMap(w => w.series.filter(x => !x.archived).flatMap(x => x.instances.filter(i => i.wrong && i.owner === me.email).map(i => ({ kind: 'correction', path: `${w.name}/${x.name}/${i.label}`, since: i.active, count: i.wrong, text: `${i.wrong} correction${i.wrong === 1 ? '' : 's'} say${i.wrong === 1 ? 's' : ''} it's wrong` })))),
684
+ ...(s.refused ?? []).map(r => {
685
+ const meta = [r.count > 1 ? `${r.count}×` : '', r.why].filter(Boolean).join(', ');
686
+ return { kind: 'refused', path: r.path, since: r.at, site: r.site, host: r.host, person: r.login, why: r.why, count: r.count, ...(r.rev && { rev: r.rev }),
687
+ text: `run ${r.run}'s browser on ${r.login}'s ${r.site} was refused ${meta ? `${r.host} (${meta})` : r.host}` };
688
+ }),
689
+ ...all.filter(w => !w.archived).flatMap(w => w.series.filter(x => !x.archived).flatMap(x => x.instances.filter(i => i.recentOutcomes && i.owner === me.email).map(i => ({ kind: 'outcome', path: `${w.name}/${x.name}/${i.label}`, since: i.active, count: i.recentOutcomes, text: `${i.recentOutcomes} outcome${i.recentOutcomes === 1 ? '' : 's'} recorded` })))),
707
690
  ...all.filter(w => w.manage).flatMap(w => w.grants.filter(g => g.state === 'pending').map(g => ({ kind: 'grant', path: w.name, since: g.at, id: g.id, text: grantText(g) }))),
708
691
  ];
709
692
  if (flags.json) console.log(JSON.stringify(rows, null, 1));
710
693
  else console.log(rows.map(r => r.kind === 'open' || r.kind === 'settled'
711
694
  ? `note ${r.kind} ${r.path}#${r.id} by ${r.by} at ${when(r.at)}: ${gist(r.text, 120)}`
712
695
  : `${r.kind} ${r.path ?? r.login}${r.since ? ` since ${when(r.since)}` : ''}${r.id ? `, ${r.kind === 'grant' ? 'grant' : 'request'} ${r.id}` : ''}: ${r.kind === 'grant' ? r.text : r.text.split('\n')[0].slice(0, 120)}`).join('\n') || 'Nothing waits on you.');
713
- }
714
696
  } else if (cmd === 'show' && args.length === 1) {
715
697
  const { inst, at } = await instanceAt(args[0]), { doc, log, run, queued, owner, waiting: w } = await get(at);
716
698
  const waiting = w.map(({ who, seq }) => {
@@ -828,11 +810,11 @@ else if (cmd === 'comment' && args.length < 2) {
828
810
  const { inst } = await instanceAt(args[0]);
829
811
  await post('/api/messages', { instance: inst.id, id: args[1], how: cmd, text: args[2], quiet: !flags.wake });
830
812
  console.log(`${cmd === 'approve' ? 'approved' : 'rejected'} ${args[1]}`);
831
- } else if (['close', 'abandon', 'interrupt'].includes(cmd) && args.length === 1) {
813
+ } else if (['close', 'interrupt'].includes(cmd) && args.length === 1) {
832
814
  const { series, at } = await instanceAt(args[0]);
833
815
  await post(`${at}/${cmd}`, { quiet: !flags.wake });
834
816
  if (cmd === 'close' && typeof flags['as-series'] === 'string') await post(`/api/series/${series.id}/promote`, { name: flags['as-series'] });
835
- console.log(`${cmd === 'close' ? 'closed' : `${cmd}ed`} ${args[0]}`);
817
+ console.log(`${cmd === 'close' ? 'closed' : 'interrupted'} ${args[0]}`);
836
818
  } else if (cmd === 'delete' && args.length === 1) {
837
819
  // One confirm, which says it can't be undone and what stays outside the server.
838
820
  const { at } = await instanceAt(args[0]);
@@ -1004,10 +986,12 @@ else if (cmd === 'comment' && args.length < 2) {
1004
986
  } else if (cmd === 'logins' && args[0] === 'signout' && args.length === 2) {
1005
987
  await api(`/logins/${encodeURIComponent(args[1])}`, { method: 'DELETE' });
1006
988
  console.log(`signed out of ${args[1]}`);
1007
- } else if (cmd === 'correct' && args.length === 2) {
989
+ } else if (cmd === 'outcome' && args.length >= 2) {
990
+ const text = args.slice(1).join(' ');
991
+ if (!text.trim()) throw new Error('an outcome needs text');
1008
992
  const { series, at } = await instanceAt(args[0]), see = flags.see === undefined ? undefined : series.instances.find(i => i.label === flags.see);
1009
993
  if (flags.see !== undefined && !see) throw new Error(`no instance ${flags.see} in its series`);
1010
- console.log(await (await post(`${at}/correct`, { kind: flags.superseded ? 'superseded' : 'wrong', text: args[1], item: flags.item, ref: flags.ref, see: see?.id })).text());
994
+ console.log(await (await post(`${at}/outcome`, { text, item: flags.item, ref: flags.ref, see: see?.id })).text());
1011
995
  } else if (cmd === 'upload' && args.length === 2) {
1012
996
  const q = new URLSearchParams({ name: basename(args[1]), pane: flags.output ? 'out' : 'in', ...(typeof flags.onto === 'string' && { onto: flags.onto }), ...(!flags.wake && { quiet: '1' }) });
1013
997
  await api(`${(await instanceAt(args[0])).at}/upload?${q}`, { method: 'POST', body: readFileSync(args[1]) });
@@ -1239,7 +1223,11 @@ else if (cmd === 'kill' && args.length === 1 && /^\d+$/.test(args[0])) {
1239
1223
  else for (const b of blocks) {
1240
1224
  console.log(b.path);
1241
1225
  for (const e of b.entries) console.log(` ${when(e.at)} ${e.op === 'done' ? `run ${e.run} failed: ${e.error}`
1242
- : `${e.by} ${e.op === 'comment' ? `says: ${e.text.split('\n')[0].slice(0, 200)}` : e.op === 'upload' ? `uploads ${e.file}` : `${{ close: 'closes', abandon: 'abandons', delete: 'deletes' }[e.op]} it`}`}`);
1226
+ : `${e.by} ${e.op === 'comment' ? `says: ${e.text.split('\n')[0].slice(0, 200)}`
1227
+ : e.op === 'upload' ? `uploads ${e.file}`
1228
+ : e.op === 'outcome' ? `records outcome: ${String(e.text ?? '').split('\n')[0].slice(0, 200)}`
1229
+ : e.op === 'correction' ? `marks ${e.kind ?? 'outcome'}: ${String(e.text ?? '').split('\n')[0].slice(0, 200)}`
1230
+ : `${{ close: 'closes', abandon: 'abandons', delete: 'deletes' }[e.op] ?? e.op} it`}`}`);
1243
1231
  }
1244
1232
  } else if (cmd === 'egress' && (!args.length || (args.length === 2 && ['add', 'remove'].includes(args[0])))) {
1245
1233
  let hosts = await (await api('/egress')).json();