@clickminded/coauthor-cli 0.0.30 → 0.0.31
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/dist/commands.js
CHANGED
|
@@ -595,10 +595,16 @@ async function runDraftReviseCommand(projectId, input, context) {
|
|
|
595
595
|
const applied = await applyRevision(context.client, projectId, revisionId, input);
|
|
596
596
|
return { ok: true, message: `Applied revision ${revisionId}.`, data: { revision, applied } };
|
|
597
597
|
}
|
|
598
|
+
// The user's editor is blocked while the revision waits, so CoAuthor
|
|
599
|
+
// discards an unreviewed agent revision after a deadline.
|
|
600
|
+
const expiresIn = getResponseValue(revision, 'expires_in_seconds');
|
|
601
|
+
const deadline = typeof expiresIn === 'number'
|
|
602
|
+
? ` It is discarded automatically if not applied within ${Math.max(1, Math.ceil(expiresIn / 60))} minutes.`
|
|
603
|
+
: '';
|
|
598
604
|
return {
|
|
599
605
|
ok: true,
|
|
600
606
|
status: 'awaiting_review',
|
|
601
|
-
message: `Revision ${revisionId} is ready to review. Apply with: coauthor draft revision apply ${projectId} ${revisionId} (or --accept/--reject <group ids>), or discard it
|
|
607
|
+
message: `Revision ${revisionId} is ready to review. Apply with: coauthor draft revision apply ${projectId} ${revisionId} (or --accept/--reject <group ids>), or discard it.${deadline}`,
|
|
602
608
|
data: revision,
|
|
603
609
|
};
|
|
604
610
|
}
|
package/package.json
CHANGED
|
@@ -14,7 +14,7 @@ coauthor draft revise <id> --instruction "Cut the intro to two sentences and lea
|
|
|
14
14
|
- Apply all groups: `coauthor draft revision apply <id> <revision-id> --json`. Keep only some with `--accept <group id>,<group id>`, or all but some with `--reject <group id>`, copying the ids (`review_…`) from `data.groups[].id`. Groups not named in `--accept` are dropped. Drop the whole revision with `coauthor draft revision discard <id> <revision-id> --json`.
|
|
15
15
|
- `status: "no_changes"` usually means CoAuthor asked a question instead of guessing. Read `data.assistant_message`, then run `draft revise` again with a clearer instruction.
|
|
16
16
|
- Name the place precisely ("the paragraph after the 'Write the first line' heading") and give numbers for cuts ("under 60 words"). Vague targets get a clarifying question back, and a vague "tighten" changes little.
|
|
17
|
-
- One revision can be open on a draft at a time, and an open one blocks the user's saves in the browser. Always apply or discard it. `revision_pending` means one is already open.
|
|
17
|
+
- One revision can be open on a draft at a time, and an open one blocks the user's saves in the browser. Always apply or discard it. `revision_pending` means one is already open. A revision you leave waiting for review is discarded automatically after 30 minutes (`expires_at` in `draft revision show`), so review it promptly; after that, start a new one.
|
|
18
18
|
- If `--wait` returns `still_running`, check again with `coauthor draft revision show <id> <revision-id> --json`.
|
|
19
19
|
- `revise_unavailable` means this account cannot revise by instruction yet; use a direct edit.
|
|
20
20
|
|
|
@@ -24,7 +24,7 @@ Every failure prints JSON on stderr with `ok: false`, `error` (a readable messag
|
|
|
24
24
|
| `stale_draft` | The draft changed after you read it. | Re-read with `draft get`, reapply your edit, save. |
|
|
25
25
|
| `user_recently_editing` | The user saved in the browser in the last 90 seconds. | Wait, or ask them. `--force` only with their OK. |
|
|
26
26
|
| `review_pending`, `document_locked` | An AI review or edit is in progress in the editor. | Wait, or apply or discard it. |
|
|
27
|
-
| `revision_pending` | Another draft revision is open. | Apply or discard it (`details.revision_id`). |
|
|
27
|
+
| `revision_pending` | Another draft revision is open. | Apply or discard it (`details.revision_id`). An agent revision left in review is discarded automatically at `details.expires_at`. |
|
|
28
28
|
| `revise_unavailable` | Revise by instruction isn't available on this account. | Use a direct edit (`references/editing-drafts.md`). |
|
|
29
29
|
| `invalid_document` | `draft save` content isn't an editor document. | Send the edited `data.content` from `draft get --format json`, never markdown. |
|
|
30
30
|
| `workflow_token_mismatch`, `conflict` | The project moved on since you read it (for example someone used the web app). | Re-read the state with `coauthor workflow status <id> --json` and continue from there. |
|
|
@@ -281,7 +281,7 @@ coauthor draft revise <id> --instruction "Cut the intro to two sentences and lea
|
|
|
281
281
|
- Apply all groups: `coauthor draft revision apply <id> <revision-id> --json`. Keep only some with `--accept <group id>,<group id>`, or all but some with `--reject <group id>`, copying the ids (`review_…`) from `data.groups[].id`. Groups not named in `--accept` are dropped. Drop the whole revision with `coauthor draft revision discard <id> <revision-id> --json`.
|
|
282
282
|
- `status: "no_changes"` usually means CoAuthor asked a question instead of guessing. Read `data.assistant_message`, then run `draft revise` again with a clearer instruction.
|
|
283
283
|
- Name the place precisely ("the paragraph after the 'Write the first line' heading") and give numbers for cuts ("under 60 words"). Vague targets get a clarifying question back, and a vague "tighten" changes little.
|
|
284
|
-
- One revision can be open on a draft at a time, and an open one blocks the user's saves in the browser. Always apply or discard it. `revision_pending` means one is already open.
|
|
284
|
+
- One revision can be open on a draft at a time, and an open one blocks the user's saves in the browser. Always apply or discard it. `revision_pending` means one is already open. A revision you leave waiting for review is discarded automatically after 30 minutes (`expires_at` in `draft revision show`), so review it promptly; after that, start a new one.
|
|
285
285
|
- If `--wait` returns `still_running`, check again with `coauthor draft revision show <id> <revision-id> --json`.
|
|
286
286
|
- `revise_unavailable` means this account cannot revise by instruction yet; use a direct edit.
|
|
287
287
|
|
|
@@ -492,7 +492,7 @@ Every failure prints JSON on stderr with `ok: false`, `error` (a readable messag
|
|
|
492
492
|
| `stale_draft` | The draft changed after you read it. | Re-read with `draft get`, reapply your edit, save. |
|
|
493
493
|
| `user_recently_editing` | The user saved in the browser in the last 90 seconds. | Wait, or ask them. `--force` only with their OK. |
|
|
494
494
|
| `review_pending`, `document_locked` | An AI review or edit is in progress in the editor. | Wait, or apply or discard it. |
|
|
495
|
-
| `revision_pending` | Another draft revision is open. | Apply or discard it (`details.revision_id`). |
|
|
495
|
+
| `revision_pending` | Another draft revision is open. | Apply or discard it (`details.revision_id`). An agent revision left in review is discarded automatically at `details.expires_at`. |
|
|
496
496
|
| `revise_unavailable` | Revise by instruction isn't available on this account. | Use a direct edit (`references/editing-drafts.md`). |
|
|
497
497
|
| `invalid_document` | `draft save` content isn't an editor document. | Send the edited `data.content` from `draft get --format json`, never markdown. |
|
|
498
498
|
| `workflow_token_mismatch`, `conflict` | The project moved on since you read it (for example someone used the web app). | Re-read the state with `coauthor workflow status <id> --json` and continue from there. |
|