@workover/cli 0.7.0 → 0.8.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.
package/README.md CHANGED
@@ -47,6 +47,7 @@ workover projects # find the project id
47
47
  workover doc list --project 11 # documents in it, with their ids
48
48
  workover doc read 1234 # the current text
49
49
  workover doc read 1234 --json # ...for a script
50
+ workover doc activity 1234 # who changed it, and how
50
51
 
51
52
  workover doc create --project 11 --title "Billing" --file billing.md
52
53
  cat billing.md | workover doc propose 1234 --note "tightened the intro"
@@ -107,7 +108,17 @@ how many are being left out, so a document never looks quieter than it is.
107
108
  **Reply before you resolve.** A thread that closes with no answer tells the person who raised it
108
109
  nothing except that their objection is gone, and reopening is the only way back. `resolve` and
109
110
  `reopen` are the same act in both directions, and both are recorded in the document's activity log
110
- with your name against them.
111
+ with your name against them — which you can read:
112
+
113
+ ```sh
114
+ workover doc activity 1234 # who changed this document, and how
115
+ ```
116
+
117
+ That command exists because the claim needed to be checkable. The CLI used to say a resolve was in
118
+ the activity log while the route that shows it was refused to the token in your hand, which reads as
119
+ verified and was not. It lists the last changes newest first, naming the person AND the agent that
120
+ acted for them — an agent works with somebody's token, so `Alex Panagis · via Claude Code` is the
121
+ honest attribution and either half alone is misleading.
111
122
 
112
123
  Reading, commenting and resolving all work with a normal `workover login` — no extra scope. Deleting
113
124
  a comment does not: it is deliberately not reachable from a token at all. An edit or a resolve leaves
package/bin/workover.mjs CHANGED
@@ -737,6 +737,7 @@ const DOC_USAGE = [
737
737
  ' [--file <path> | piped stdin] [--json] [--tab <tabId>]',
738
738
  ' needs `workover login --write`; use it only when asked to',
739
739
  ' search "<query>" [--limit N] [--json] find documents by title/content',
740
+ ' activity <docId> [--limit N] [--json] who changed this document, and how',
740
741
  '',
741
742
  ' `workover projects` lists the project ids.',
742
743
  '',
@@ -756,9 +757,17 @@ async function docCommand() {
756
757
  // Usage before sign-in: someone who typed the command wrong is asking what the commands are, and
757
758
  // answering "not signed in" sends them to fix the wrong thing.
758
759
  if (
759
- !['list', 'read', 'create', 'propose', 'write', 'search', 'tabs', 'tab-new'].includes(
760
- sub,
761
- )
760
+ ![
761
+ 'list',
762
+ 'read',
763
+ 'create',
764
+ 'propose',
765
+ 'write',
766
+ 'search',
767
+ 'tabs',
768
+ 'tab-new',
769
+ 'activity',
770
+ ].includes(sub)
762
771
  ) {
763
772
  console.log(DOC_USAGE);
764
773
  process.exit(sub ? 1 : 0);
@@ -1017,6 +1026,31 @@ async function docCommand() {
1017
1026
  return;
1018
1027
  }
1019
1028
 
1029
+ if (sub === 'activity') {
1030
+ const docId = docIdArg(positionals, 'workover doc activity <docId>');
1031
+ const limit = rowId(flags.limit) ?? 20;
1032
+ const rows = (await authedCall(cfg, `/project/doc/${docId}/activity`)) || [];
1033
+ const shown = rows.slice(0, limit);
1034
+ if (asJson) return console.log(JSON.stringify(shown, null, 2));
1035
+ if (!shown.length) {
1036
+ return console.log(`\n Nothing recorded against document #${docId} yet.\n`);
1037
+ }
1038
+ console.log('');
1039
+ for (const r of shown) {
1040
+ // Person AND agent, never one or the other: an agent acts with somebody's token, so crediting
1041
+ // only the agent hides who authorised it and only the person hides that a machine wrote it.
1042
+ const who = r.actorName || (r.actorId ? `user ${r.actorId}` : 'someone');
1043
+ const via = r.agentName ? ` · via ${r.agentName}` : '';
1044
+ const when = String(r.createdAt || '').slice(0, 16).replace('T', ' ');
1045
+ console.log(` ${when} ${String(r.action || '').padEnd(20)} ${who}${via}`);
1046
+ if (r.detail) console.log(` ${stripHtml(r.detail)}`);
1047
+ }
1048
+ console.log(
1049
+ `\n ${shown.length} most recent${rows.length > shown.length ? ` of ${rows.length}` : ''}, newest first.\n`,
1050
+ );
1051
+ return;
1052
+ }
1053
+
1020
1054
  if (sub === 'search') {
1021
1055
  const query = positionals.join(' ').trim();
1022
1056
  if (!query) {
@@ -1120,10 +1154,15 @@ async function commentsCommand() {
1120
1154
  console.log(
1121
1155
  `\n \x1b[32m✓\x1b[0m ${resolved ? 'Resolved' : 'Reopened'} comment #${commentId}.`,
1122
1156
  );
1123
- // Named because it is recoverable and the person who raised the thread cannot see who closed
1124
- // it from the terminal. Both facts are the reason this is allowed to happen unattended at all.
1157
+ // Both facts named because they are why this is allowed to happen unattended: the act is
1158
+ // attributable, and it is reversible.
1159
+ //
1160
+ // The activity line used to be printed WITHOUT `doc activity` existing, so the CLI asserted the
1161
+ // act was in the log while the only route that could show it was refused to the token in the
1162
+ // caller's hand. Either the claim is checkable or it should not be made; this prints the command
1163
+ // that checks it.
1125
1164
  console.log(
1126
- ` It is in the document's activity log as ${resolved ? 'resolved' : 'reopened'}, and`,
1165
+ ` Recorded as ${resolved ? 'resolved' : 'reopened'} in the document's activity log.`,
1127
1166
  );
1128
1167
  console.log(
1129
1168
  ` \`workover comments ${resolved ? 'reopen' : 'resolve'} ${commentId}\` undoes it.\n`,
@@ -1246,6 +1285,7 @@ else {
1246
1285
  console.log(' --rules also allow changing the style guide');
1247
1286
  console.log(' --client "<name>" what to call this token in your history');
1248
1287
  console.log(' doc Work on documents: list, read, create, propose, write, search');
1288
+ console.log(' plus activity, to see who changed one and how');
1249
1289
  console.log(' plus tabs and tab-new for documents with several bodies');
1250
1290
  console.log(' workover doc create --project 11 --title "Billing" --file b.md');
1251
1291
  console.log(' workover doc read 123 · workover doc propose 123 --file new.md');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@workover/cli",
3
- "version": "0.7.0",
3
+ "version": "0.8.0",
4
4
  "description": "Workover command line — sign in and cowork on your documents from the terminal.",
5
5
  "license": "UNLICENSED",
6
6
  "author": "ScaleMath",