@clickminded/coauthor-cli 0.0.29 → 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/client.d.ts CHANGED
@@ -23,6 +23,11 @@ export declare class AgentClient {
23
23
  private readonly fetchImpl;
24
24
  constructor(options: AgentClientOptions);
25
25
  request(options: RequestOptions): Promise<JsonValue>;
26
+ /**
27
+ * Fetches a public file (for example a rendered MP4 on the CDN) as bytes.
28
+ * Sends no Authorization header: the URL is not an agent API endpoint.
29
+ */
30
+ download(url: string): Promise<Uint8Array>;
26
31
  }
27
32
  export declare function isLiveAction(method: string): boolean;
28
33
  export declare function normalizeBaseUrl(baseUrl: string): string;
package/dist/client.js CHANGED
@@ -57,6 +57,16 @@ export class AgentClient {
57
57
  }
58
58
  return parsedBody;
59
59
  }
60
+ /**
61
+ * Fetches a public file (for example a rendered MP4 on the CDN) as bytes.
62
+ * Sends no Authorization header: the URL is not an agent API endpoint.
63
+ */
64
+ async download(url) {
65
+ const response = await this.fetchImpl(url, { method: 'GET' });
66
+ if (!response.ok)
67
+ throw new Error(`Download failed with HTTP ${response.status} for ${url}`);
68
+ return new Uint8Array(await response.arrayBuffer());
69
+ }
60
70
  }
61
71
  export function isLiveAction(method) {
62
72
  return !['GET', 'HEAD', 'OPTIONS'].includes(method.toUpperCase());
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
  }
@@ -1501,17 +1507,30 @@ async function runRepurposeCommand(action, input, client) {
1501
1507
  }
1502
1508
  if (action === 'generate') {
1503
1509
  if (!format)
1504
- throw new Error(`Usage: coauthor repurpose generate <project-id> --format <${REPURPOSE_GENERATABLE.join('|')}|all> [--writing-model <id>]`);
1510
+ throw new Error(`Usage: coauthor repurpose generate <project-id> --format <${[...REPURPOSE_GENERATABLE, 'video'].join('|')}|all> [--writing-model <id>] [--cta save,follow]`);
1505
1511
  const formats = format === 'all' ? REPURPOSE_GENERATABLE : [format];
1506
1512
  const writingModel = getString(input.values, 'writing-model');
1513
+ const cta = getString(input.values, 'cta');
1514
+ if (cta !== undefined && format !== 'video')
1515
+ throw new Error('--cta only applies to --format video.');
1507
1516
  const results = {};
1508
1517
  for (const entry of formats) {
1509
1518
  results[entry] = await client.request({
1510
1519
  method: 'POST',
1511
1520
  path: `${base}/${encodeURIComponent(entry)}/generate`,
1512
- body: writingModel ? { writingModel } : {},
1521
+ body: {
1522
+ ...(writingModel ? { writingModel } : {}),
1523
+ ...(entry === 'video' && cta !== undefined ? { cta_variants: parseCtaList(cta) } : {}),
1524
+ },
1513
1525
  });
1514
1526
  }
1527
+ if (format === 'video') {
1528
+ return {
1529
+ ok: true,
1530
+ message: `Generated the video deck. Slide images are generating (usually 1-3 minutes). Next: coauthor repurpose render ${projectId} --format video --wait, then coauthor repurpose download ${projectId} --format video`,
1531
+ data: results.video,
1532
+ };
1533
+ }
1515
1534
  return {
1516
1535
  ok: true,
1517
1536
  message: `Generated ${formats.join(', ')}. Review with: coauthor repurpose show ${projectId} --format <format> --json, or save files with: coauthor repurpose download ${projectId} --format ${format}`,
@@ -1527,11 +1546,137 @@ async function runRepurposeCommand(action, input, client) {
1527
1546
  data: await client.request({ method: 'POST', path: `${base}/${encodeURIComponent(format)}/save`, body: parseJsonOption(input.values) }),
1528
1547
  };
1529
1548
  }
1549
+ if (action === 'status') {
1550
+ if (format !== 'video')
1551
+ throw new Error('Usage: coauthor repurpose status <project-id> --format video [--wait]');
1552
+ return videoStatus(client, base, getBoolean(input.values, 'wait'));
1553
+ }
1554
+ if (action === 'render') {
1555
+ if (format !== 'video')
1556
+ throw new Error('Usage: coauthor repurpose render <project-id> --format video [--variant <id>] [--wait]');
1557
+ return videoRender(client, projectId, base, getString(input.values, 'variant'), getBoolean(input.values, 'wait'));
1558
+ }
1530
1559
  if (action === 'download')
1531
- return downloadRepurposed(projectId, format ?? 'all', getString(input.values, 'out'), client);
1532
- throw new Error('Usage: coauthor repurpose <list|show|generate|save|download> <project-id> --format <format>');
1560
+ return downloadRepurposed(projectId, format ?? 'all', getString(input.values, 'out'), client, getString(input.values, 'variant'));
1561
+ throw new Error('Usage: coauthor repurpose <list|show|generate|save|download|status|render> <project-id> --format <format>');
1562
+ }
1563
+ /** "save,follow,custom:Reply with a question" -> ["save","follow","custom:Reply with a question"]. */
1564
+ function parseCtaList(value) {
1565
+ const items = value.split(',').map((item) => item.trim()).filter(Boolean);
1566
+ if (items.length === 0)
1567
+ throw new Error('--cta needs at least one intent, for example --cta save,follow (save, follow, comment, share, read_more, custom:<text>).');
1568
+ return items;
1569
+ }
1570
+ const VIDEO_ACTIVE_RENDER_STATUSES = ['pending', 'rendering', 'encoding', 'uploading'];
1571
+ function asVideoStatus(data) {
1572
+ return data;
1573
+ }
1574
+ function describeVideoStatus(status) {
1575
+ if (!status.exists)
1576
+ return 'No video yet. Generate one with: coauthor repurpose generate <project-id> --format video';
1577
+ const panels = status.panels;
1578
+ const lines = [panels ? `Panels: ${panels.done}/${panels.total} done, ${panels.generating} generating, ${panels.failed} failed.` : 'Panels: none.'];
1579
+ for (const render of status.renders) {
1580
+ lines.push(`Render ${render.variant_id}: ${render.status}${VIDEO_ACTIVE_RENDER_STATUSES.includes(render.status) ? ` (${render.progress}%)` : ''}${render.video_url ? ` ${render.video_url}` : ''}${render.error_message ? ` - ${render.error_message}` : ''}`);
1581
+ }
1582
+ return lines.join('\n');
1583
+ }
1584
+ // Polls until `settled(status)` or the deadline (9 minutes by default: the
1585
+ // shell limit for agents). Returns the last status and whether it settled.
1586
+ async function pollVideoStatus(client, base, settled, deadline) {
1587
+ const pollMs = Math.min(waitPollMs(), 15_000);
1588
+ for (;;) {
1589
+ const data = await client.request({ path: `${base}/video/status` });
1590
+ const status = asVideoStatus(data);
1591
+ if (settled(status))
1592
+ return { status, data, settled: true };
1593
+ if (Date.now() >= deadline)
1594
+ return { status, data, settled: false };
1595
+ await sleep(pollMs);
1596
+ }
1597
+ }
1598
+ const panelsSettled = (status) => !status.exists || !status.panels || status.panels.generating === 0;
1599
+ const noActiveRender = (status) => !status.renders.some((render) => VIDEO_ACTIVE_RENDER_STATUSES.includes(render.status));
1600
+ async function videoStatus(client, base, wait) {
1601
+ const deadline = Date.now() + waitTimeoutMs(9 * 60_000);
1602
+ const polled = await pollVideoStatus(client, base, (status) => !wait || (panelsSettled(status) && noActiveRender(status)), deadline);
1603
+ const data = polled.data;
1604
+ const stillRunning = wait && !polled.settled;
1605
+ return {
1606
+ ok: true,
1607
+ status: stillRunning ? 'still_running' : undefined,
1608
+ exitCode: stillRunning ? 2 : undefined,
1609
+ message: `${describeVideoStatus(polled.status)}${stillRunning ? '\nStill running. Check again with: coauthor repurpose status <project-id> --format video --wait' : ''}`,
1610
+ data,
1611
+ };
1612
+ }
1613
+ async function videoRender(client, projectId, base, variant, wait) {
1614
+ const deadline = Date.now() + waitTimeoutMs(9 * 60_000);
1615
+ if (wait) {
1616
+ // Slide images usually finish before the render is asked for; wait for stragglers.
1617
+ const panels = await pollVideoStatus(client, base, panelsSettled, deadline);
1618
+ if (!panels.settled) {
1619
+ return { ok: true, status: 'still_running', exitCode: 2, message: `Slide images are still generating.\n${describeVideoStatus(panels.status)}\nCheck again with: coauthor repurpose render ${projectId} --format video --wait`, data: panels.data };
1620
+ }
1621
+ }
1622
+ const started = await client.request({
1623
+ method: 'POST',
1624
+ path: `${base}/video/render`,
1625
+ body: variant ? { variant } : {},
1626
+ });
1627
+ const render = getResponseValue(started, 'render');
1628
+ const renderId = render ? getResponseString(render, 'id') : undefined;
1629
+ if (!wait) {
1630
+ return {
1631
+ ok: true,
1632
+ message: `Render started (usually about 3 minutes). Check with: coauthor repurpose status ${projectId} --format video --wait, then download with: coauthor repurpose download ${projectId} --format video`,
1633
+ data: started,
1634
+ };
1635
+ }
1636
+ const finished = await pollVideoStatus(client, base, (status) => {
1637
+ const row = status.renders.find((entry) => entry.id === renderId);
1638
+ return !row || row.status === 'done' || row.status === 'failed';
1639
+ }, deadline);
1640
+ const row = finished.status.renders.find((entry) => entry.id === renderId);
1641
+ if (!finished.settled) {
1642
+ return {
1643
+ ok: true,
1644
+ status: 'still_running',
1645
+ exitCode: 2,
1646
+ message: `Render still running (${row?.status ?? 'pending'}, ${row?.progress ?? 0}%). Check again with: coauthor repurpose status ${projectId} --format video --wait`,
1647
+ data: finished.data,
1648
+ };
1649
+ }
1650
+ if (row && row.status === 'failed') {
1651
+ return { ok: false, message: `Render failed: ${row.error_message ?? 'unknown error'}. Try again with: coauthor repurpose render ${projectId} --format video`, data: finished.data };
1652
+ }
1653
+ return {
1654
+ ok: true,
1655
+ message: `Render done${row?.video_url ? `: ${row.video_url}` : ''}. Download it with: coauthor repurpose download ${projectId} --format video`,
1656
+ data: finished.data,
1657
+ };
1658
+ }
1659
+ // Downloads each finished render's MP4 from its public URL (no agent auth) to
1660
+ // <out>/video-<variant>.mp4.
1661
+ async function downloadVideoRenders(client, shown, outDir, variant) {
1662
+ const renders = getResponseValue(shown, 'renders') ?? [];
1663
+ const files = [];
1664
+ const pending = [];
1665
+ for (const render of renders) {
1666
+ const variantId = render.variant_id ?? '';
1667
+ if (variant && variantId !== variant)
1668
+ continue;
1669
+ if (render.status !== 'done' || !render.video_url) {
1670
+ pending.push(variantId);
1671
+ continue;
1672
+ }
1673
+ const name = `video-${variantId.replace(/[^A-Za-z0-9_-]+/g, '_') || render.id || 'render'}.mp4`;
1674
+ await writeFile(join(outDir, name), await client.download(render.video_url));
1675
+ files.push(name);
1676
+ }
1677
+ return { files, pending };
1533
1678
  }
1534
- async function downloadRepurposed(projectId, format, outOption, client) {
1679
+ async function downloadRepurposed(projectId, format, outOption, client, variant) {
1535
1680
  const outDir = resolve(outOption ?? `coauthor-${projectId.slice(0, 8)}`);
1536
1681
  await mkdir(outDir, { recursive: true });
1537
1682
  const written = [];
@@ -1552,10 +1697,29 @@ async function downloadRepurposed(projectId, format, outOption, client) {
1552
1697
  const formats = format === 'all' ? REPURPOSE_FORMATS : format === 'article' ? [] : [format];
1553
1698
  const manifest = {};
1554
1699
  const missingLink = [];
1700
+ let noVideoFile = false;
1555
1701
  for (const entry of formats) {
1556
1702
  const shown = await client.request({ path: `projects/${encodeURIComponent(projectId)}/repurpose/${encodeURIComponent(entry)}` });
1557
1703
  const artifact = getResponseValue(shown, 'artifact');
1558
1704
  const copy = getResponseValue(shown, 'copy');
1705
+ if (entry === 'video') {
1706
+ if (!artifact) {
1707
+ skipped.push(entry);
1708
+ continue;
1709
+ }
1710
+ const videos = await downloadVideoRenders(client, shown, outDir, variant);
1711
+ written.push(...videos.files);
1712
+ await write('video.json', JSON.stringify(artifact, null, 2));
1713
+ manifest.video = {
1714
+ stale: Boolean(getResponseValue(artifact, 'stale_at')),
1715
+ updated_at: getResponseValue(artifact, 'updated_at') ?? null,
1716
+ files: videos.files,
1717
+ unfinished_variants: videos.pending,
1718
+ };
1719
+ if (videos.files.length === 0)
1720
+ noVideoFile = true;
1721
+ continue;
1722
+ }
1559
1723
  if (!artifact || !copy) {
1560
1724
  skipped.push(entry);
1561
1725
  continue;
@@ -1576,7 +1740,8 @@ async function downloadRepurposed(projectId, format, outOption, client) {
1576
1740
  ok: true,
1577
1741
  message: [
1578
1742
  `Wrote ${written.length} files to ${outDir}`,
1579
- skipped.length > 0 ? `Not generated yet: ${skipped.join(', ')} (coauthor repurpose generate ${projectId} --format <format>; slideshow and video are made in the web app).` : '',
1743
+ skipped.length > 0 ? `Not generated yet: ${skipped.join(', ')} (coauthor repurpose generate ${projectId} --format <format>; slideshows are made in the web app).` : '',
1744
+ noVideoFile ? `The video has no finished render yet: coauthor repurpose render ${projectId} --format video --wait, then download again.` : '',
1580
1745
  staleNote.length > 0 ? `Stale (the draft changed since they were made): ${staleNote.join(', ')}. Regenerate them before posting.` : '',
1581
1746
  missingLink.length > 0
1582
1747
  ? `No article link yet: ${missingLink.join(', ')} still contain {{POST_URL}}. Set it with coauthor repurpose save ${projectId} --format <format> --data '{"destination_url":"https://..."}' and download again, or replace it when posting.`
@@ -1855,7 +2020,7 @@ export function helpResult(command = []) {
1855
2020
  ' contract show|save|approve',
1856
2021
  ' outline show|generate|revise|save|approve',
1857
2022
  ' research-plan show|generate|revise|save|approve',
1858
- ' repurpose list|generate|show|save|download',
2023
+ ' repurpose list|generate|show|save|download|status|render',
1859
2024
  ' brief review|answer',
1860
2025
  ' profile list|show',
1861
2026
  ' source list|add|remove',
@@ -1968,11 +2133,16 @@ function commandHelp(command) {
1968
2133
  ' coauthor repurpose generate <project-id> --format <x-thread|x-post|linkedin|facebook|email|all> [--writing-model <id>] [--json]',
1969
2134
  ' coauthor repurpose show <project-id> --format <format> [--json]',
1970
2135
  ' coauthor repurpose save <project-id> --format <format> --data @edits.json [--json]',
1971
- ' coauthor repurpose download <project-id> [--format <format|article|all>] [--out <dir>]',
2136
+ ' coauthor repurpose download <project-id> [--format <format|article|all>] [--out <dir>] [--variant <id>]',
2137
+ ' coauthor repurpose generate <project-id> --format video [--cta save,follow] [--writing-model <id>] [--json]',
2138
+ ' coauthor repurpose status <project-id> --format video [--wait] [--json]',
2139
+ ' coauthor repurpose render <project-id> --format video [--variant <id>] [--wait] [--json]',
1972
2140
  '',
1973
2141
  'Turns the finished draft into social posts and an email newsletter. generate takes about 20-90 seconds per format and replaces the previous version.',
1974
2142
  'show returns data.copy (copy-ready text with the destination link filled in). download writes article.md, <format>.md, <format>.json, and manifest.json.',
1975
- 'Slideshows and videos are generated in the web app; download includes them only as JSON once they exist. Publish an X thread with coauthor publish thread.',
2143
+ 'Video: generate writes a short vertical deck and starts its slide images (1-3 minutes); --cta picks the ending call to action (comma-separated: save, follow, comment, share, read_more, custom:<text>; default save).',
2144
+ 'status shows panels done/failed/generating and each render; render makes the MP4 (about 3 minutes, one render at a time per account; --wait polls up to 9 minutes, exit code 2 if still running); download saves finished MP4s as <out>/video-<variant>.mp4.',
2145
+ 'Slideshows are generated in the web app; download includes them only as JSON once they exist. Publish an X thread with coauthor publish thread.',
1976
2146
  ].join('\n'),
1977
2147
  brief: [
1978
2148
  'Usage: coauthor brief review <project-id> [--json]',
package/dist/parser.js CHANGED
@@ -69,6 +69,8 @@ const OPTIONS = {
69
69
  feedback: { type: 'string' },
70
70
  profile: { type: 'string' },
71
71
  out: { type: 'string' },
72
+ cta: { type: 'string' },
73
+ variant: { type: 'string' },
72
74
  all: { type: 'boolean', default: false },
73
75
  kind: { type: 'string' },
74
76
  apply: { type: 'boolean', default: false },
@@ -166,7 +168,7 @@ function commandLength(positionals) {
166
168
  if (first === 'workflow')
167
169
  return second ? 2 : 1;
168
170
  if (first === 'repurpose')
169
- return second && ['list', 'show', 'generate', 'save', 'download'].includes(second) ? 2 : 1;
171
+ return second && ['list', 'show', 'generate', 'save', 'download', 'status', 'render'].includes(second) ? 2 : 1;
170
172
  if (first === 'draft' && second === 'revision')
171
173
  return positionals[2] && ['show', 'apply', 'discard'].includes(positionals[2]) ? 3 : 2;
172
174
  if (first === 'credits')
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@clickminded/coauthor-cli",
3
- "version": "0.0.29",
3
+ "version": "0.0.31",
4
4
  "type": "module",
5
5
  "bin": {
6
6
  "coauthor": "dist/index.js",
@@ -66,4 +66,4 @@ Everything else, including auth problems: `references/troubleshooting.md`. Credi
66
66
 
67
67
  ## Not in the CLI yet
68
68
 
69
- Creating or editing writer profiles, PDFs over about 3.3 MB, adding more images than CoAuthor planned, slideshows, and video. Point the user to the CoAuthor web app at https://tools.clickminded.com/coauthor for these instead of improvising.
69
+ Creating or editing writer profiles, PDFs over about 3.3 MB, adding more images than CoAuthor planned, and slideshows. Point the user to the CoAuthor web app at https://tools.clickminded.com/coauthor for these instead of improvising.
@@ -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
 
@@ -10,7 +10,7 @@ Once the draft is final, CoAuthor turns it into distribution copy in the project
10
10
  | Facebook post | `facebook` | Variations with alternate hooks |
11
11
  | Email newsletter | `email` | Variations with subject line, preheader, and body |
12
12
 
13
- Slideshows (carousels) and short videos are generated in the CoAuthor web app (open the project, then Promote). `repurpose download` includes them as JSON once they exist.
13
+ Slideshows (carousels) are generated in the CoAuthor web app (open the project, then Promote); `repurpose download` includes them as JSON once they exist. Short vertical videos can be made from the CLI (see below).
14
14
 
15
15
  ## Generate
16
16
 
@@ -44,6 +44,15 @@ coauthor repurpose save <id> --format x-thread --data '{"posts":[...]}' --json
44
44
 
45
45
  Add `"destination_url": "https://..."` to point the posts at the published article. Keep the `{{POST_URL}}` placeholder in stored text; it is replaced with the destination URL on copy.
46
46
 
47
+ ## Video
48
+
49
+ A short vertical video (1080x1920) of the article's key points, with illustrated panels and a closing call to action.
50
+
51
+ 1. `coauthor repurpose generate <id> --format video [--cta save,follow] --json` writes the video script and starts its panel images. CTA intents: `save`, `follow`, `comment`, `share`, `read_more`, `custom:<text>`; the default is `save`. Panel images cost image credits, which is why video is not part of `--format all`.
52
+ 2. `coauthor repurpose status <id> --format video --wait --json` waits until the panels are done (`ready_to_render`).
53
+ 3. `coauthor repurpose render <id> --format video [--variant <id>] --wait --json` renders the MP4. It takes about 3 minutes for a typical video and runs on a shared queue, so only one render per account at a time: `render_in_progress` (429) means wait for the current one. `panels_not_ready` (409) means the panel images aren't finished yet.
54
+ 4. `coauthor repurpose download <id> --format video --out <dir>` saves `video-<variant>.mp4`.
55
+
47
56
  ## Deliver
48
57
 
49
58
  `coauthor repurpose download <id> --out <dir>` writes:
@@ -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. |
@@ -68,7 +68,7 @@ Everything else, including auth problems: `references/troubleshooting.md`. Credi
68
68
 
69
69
  ## Not in the CLI yet
70
70
 
71
- Creating or editing writer profiles, PDFs over about 3.3 MB, adding more images than CoAuthor planned, slideshows, and video. Point the user to the CoAuthor web app at https://tools.clickminded.com/coauthor for these instead of improvising.
71
+ Creating or editing writer profiles, PDFs over about 3.3 MB, adding more images than CoAuthor planned, and slideshows. Point the user to the CoAuthor web app at https://tools.clickminded.com/coauthor for these instead of improvising.
72
72
 
73
73
  # Reference sections
74
74
 
@@ -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
 
@@ -410,7 +410,7 @@ Once the draft is final, CoAuthor turns it into distribution copy in the project
410
410
  | Facebook post | `facebook` | Variations with alternate hooks |
411
411
  | Email newsletter | `email` | Variations with subject line, preheader, and body |
412
412
 
413
- Slideshows (carousels) and short videos are generated in the CoAuthor web app (open the project, then Promote). `repurpose download` includes them as JSON once they exist.
413
+ Slideshows (carousels) are generated in the CoAuthor web app (open the project, then Promote); `repurpose download` includes them as JSON once they exist. Short vertical videos can be made from the CLI (see below).
414
414
 
415
415
  ### Generate
416
416
 
@@ -444,6 +444,15 @@ coauthor repurpose save <id> --format x-thread --data '{"posts":[...]}' --json
444
444
 
445
445
  Add `"destination_url": "https://..."` to point the posts at the published article. Keep the `{{POST_URL}}` placeholder in stored text; it is replaced with the destination URL on copy.
446
446
 
447
+ ### Video
448
+
449
+ A short vertical video (1080x1920) of the article's key points, with illustrated panels and a closing call to action.
450
+
451
+ 1. `coauthor repurpose generate <id> --format video [--cta save,follow] --json` writes the video script and starts its panel images. CTA intents: `save`, `follow`, `comment`, `share`, `read_more`, `custom:<text>`; the default is `save`. Panel images cost image credits, which is why video is not part of `--format all`.
452
+ 2. `coauthor repurpose status <id> --format video --wait --json` waits until the panels are done (`ready_to_render`).
453
+ 3. `coauthor repurpose render <id> --format video [--variant <id>] --wait --json` renders the MP4. It takes about 3 minutes for a typical video and runs on a shared queue, so only one render per account at a time: `render_in_progress` (429) means wait for the current one. `panels_not_ready` (409) means the panel images aren't finished yet.
454
+ 4. `coauthor repurpose download <id> --format video --out <dir>` saves `video-<variant>.mp4`.
455
+
447
456
  ### Deliver
448
457
 
449
458
  `coauthor repurpose download <id> --out <dir>` writes:
@@ -483,7 +492,7 @@ Every failure prints JSON on stderr with `ok: false`, `error` (a readable messag
483
492
  | `stale_draft` | The draft changed after you read it. | Re-read with `draft get`, reapply your edit, save. |
484
493
  | `user_recently_editing` | The user saved in the browser in the last 90 seconds. | Wait, or ask them. `--force` only with their OK. |
485
494
  | `review_pending`, `document_locked` | An AI review or edit is in progress in the editor. | Wait, or apply or discard it. |
486
- | `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`. |
487
496
  | `revise_unavailable` | Revise by instruction isn't available on this account. | Use a direct edit (`references/editing-drafts.md`). |
488
497
  | `invalid_document` | `draft save` content isn't an editor document. | Send the edited `data.content` from `draft get --format json`, never markdown. |
489
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. |