@workover/cli 0.7.0 → 0.8.1

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);
@@ -937,7 +946,9 @@ async function docCommand() {
937
946
  console.log(`\n \x1b[32m✓\x1b[0m Created "${title}" as document #${doc.id}.`);
938
947
  console.log(' The content is in the document — nothing to accept.');
939
948
  if (doc.documentUrl) console.log(` ${doc.documentUrl}`);
940
- console.log('\n Changes to it from here go through `workover doc propose`.\n');
949
+ console.log('\n Changes to it from here go through `workover doc propose`.');
950
+ printStyleFeedback(doc.style);
951
+ console.log('');
941
952
  return;
942
953
  }
943
954
 
@@ -955,6 +966,7 @@ async function docCommand() {
955
966
  console.log(" This Workover can't write a new document's content directly, so the body");
956
967
  console.log(' is waiting as suggestions. Open it and accept them:');
957
968
  if (proposal?.documentUrl) console.log(` ${proposal.documentUrl}`);
969
+ printStyleFeedback(proposal?.style);
958
970
  console.log('');
959
971
  return;
960
972
  }
@@ -1017,6 +1029,31 @@ async function docCommand() {
1017
1029
  return;
1018
1030
  }
1019
1031
 
1032
+ if (sub === 'activity') {
1033
+ const docId = docIdArg(positionals, 'workover doc activity <docId>');
1034
+ const limit = rowId(flags.limit) ?? 20;
1035
+ const rows = (await authedCall(cfg, `/project/doc/${docId}/activity`)) || [];
1036
+ const shown = rows.slice(0, limit);
1037
+ if (asJson) return console.log(JSON.stringify(shown, null, 2));
1038
+ if (!shown.length) {
1039
+ return console.log(`\n Nothing recorded against document #${docId} yet.\n`);
1040
+ }
1041
+ console.log('');
1042
+ for (const r of shown) {
1043
+ // Person AND agent, never one or the other: an agent acts with somebody's token, so crediting
1044
+ // only the agent hides who authorised it and only the person hides that a machine wrote it.
1045
+ const who = r.actorName || (r.actorId ? `user ${r.actorId}` : 'someone');
1046
+ const via = r.agentName ? ` · via ${r.agentName}` : '';
1047
+ const when = String(r.createdAt || '').slice(0, 16).replace('T', ' ');
1048
+ console.log(` ${when} ${String(r.action || '').padEnd(20)} ${who}${via}`);
1049
+ if (r.detail) console.log(` ${stripHtml(r.detail)}`);
1050
+ }
1051
+ console.log(
1052
+ `\n ${shown.length} most recent${rows.length > shown.length ? ` of ${rows.length}` : ''}, newest first.\n`,
1053
+ );
1054
+ return;
1055
+ }
1056
+
1020
1057
  if (sub === 'search') {
1021
1058
  const query = positionals.join(' ').trim();
1022
1059
  if (!query) {
@@ -1120,10 +1157,15 @@ async function commentsCommand() {
1120
1157
  console.log(
1121
1158
  `\n \x1b[32m✓\x1b[0m ${resolved ? 'Resolved' : 'Reopened'} comment #${commentId}.`,
1122
1159
  );
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.
1160
+ // Both facts named because they are why this is allowed to happen unattended: the act is
1161
+ // attributable, and it is reversible.
1162
+ //
1163
+ // The activity line used to be printed WITHOUT `doc activity` existing, so the CLI asserted the
1164
+ // act was in the log while the only route that could show it was refused to the token in the
1165
+ // caller's hand. Either the claim is checkable or it should not be made; this prints the command
1166
+ // that checks it.
1125
1167
  console.log(
1126
- ` It is in the document's activity log as ${resolved ? 'resolved' : 'reopened'}, and`,
1168
+ ` Recorded as ${resolved ? 'resolved' : 'reopened'} in the document's activity log.`,
1127
1169
  );
1128
1170
  console.log(
1129
1171
  ` \`workover comments ${resolved ? 'reopen' : 'resolve'} ${commentId}\` undoes it.\n`,
@@ -1246,6 +1288,7 @@ else {
1246
1288
  console.log(' --rules also allow changing the style guide');
1247
1289
  console.log(' --client "<name>" what to call this token in your history');
1248
1290
  console.log(' doc Work on documents: list, read, create, propose, write, search');
1291
+ console.log(' plus activity, to see who changed one and how');
1249
1292
  console.log(' plus tabs and tab-new for documents with several bodies');
1250
1293
  console.log(' workover doc create --project 11 --title "Billing" --file b.md');
1251
1294
  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.1",
4
4
  "description": "Workover command line — sign in and cowork on your documents from the terminal.",
5
5
  "license": "UNLICENSED",
6
6
  "author": "ScaleMath",