@clickminded/coauthor-cli 0.0.34 → 0.0.35

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
@@ -69,7 +69,7 @@ Images, social, and export:
69
69
 
70
70
  ```sh
71
71
  coauthor image list <id> --json
72
- coauthor image generate <id> --placeholder-id <id or placeholder_id> --json
72
+ coauthor image generate <id> --placeholder-id <id or placeholder_id> [--prompt "what it should show"] --json
73
73
  coauthor image status <id> --json
74
74
  coauthor repurpose generate <id> --format all --json # X thread and post, LinkedIn, Facebook, email newsletter
75
75
  coauthor repurpose download <id> --out ./social # copy-ready files plus the article
package/dist/commands.js CHANGED
@@ -779,6 +779,9 @@ async function runResourceCommand(resource, action, input, client) {
779
779
  return liveOperationRequest(client, input, `${basePath}/${resolvedAction}`, exportRequestBody(resolvedAction, input));
780
780
  }
781
781
  if (resource === 'images' && resolvedAction === 'generate' && getBoolean(input.values, 'all')) {
782
+ if (getString(input.values, 'prompt') !== undefined) {
783
+ throw new Error('--prompt steers one image: use it with --placeholder-id <id>, not --all.');
784
+ }
782
785
  return generateAllImages(client, projectId, getBoolean(input.values, 'wait'));
783
786
  }
784
787
  if (resource === 'images' && resolvedAction === 'metadata') {
@@ -804,11 +807,12 @@ async function runResourceCommand(resource, action, input, client) {
804
807
  });
805
808
  return { ok: true, data };
806
809
  }
807
- if (getString(input.values, 'prompt') !== undefined) {
808
- // No resource endpoint reads a free-form prompt (images are built from the
809
- // placeholder's planned brief), so --prompt used to be silently dropped.
810
+ const imagePrompt = resource === 'images' && resolvedAction === 'generate';
811
+ if (getString(input.values, 'prompt') !== undefined && !imagePrompt) {
812
+ // Only image generate reads a free-form prompt (it becomes the image's
813
+ // scene); anywhere else it used to be silently dropped.
810
814
  throw new Error(resource === 'images'
811
- ? `image ${resolvedAction} does not take --prompt. Generate the image first, then direct changes with \`coauthor image edit <project-id> --placeholder-id <id> --edit-prompt "..."\`.`
815
+ ? `image ${resolvedAction} does not take --prompt. To change an existing image, use --edit-prompt "...".`
812
816
  : `${name} ${resolvedAction} does not take --prompt.`);
813
817
  }
814
818
  const body = withNamedOptions(parseJsonOption(input.values), input.values, [
@@ -822,6 +826,7 @@ async function runResourceCommand(resource, action, input, client) {
822
826
  'grounding-mode',
823
827
  'image-generation-model',
824
828
  ...(resource === 'threads' && resolvedAction === 'generate' ? ['writing-model'] : []),
829
+ ...(imagePrompt ? ['prompt'] : []),
825
830
  'edit-prompt',
826
831
  ]);
827
832
  const path = resolvedAction === 'create' && resource !== 'threads' ? basePath : `${basePath}/${resolvedAction}`;
@@ -2594,10 +2599,11 @@ function commandHelp(command) {
2594
2599
  'show: status and the proposed groups. apply: keep every group, or only --accept / all but --reject. discard: drop the revision (cancels it if still running).',
2595
2600
  ].join('\n'),
2596
2601
  'image generate': [
2597
- 'Usage: coauthor image generate <project-id> --placeholder-id <id> [--grounding-mode <mode>] [--image-generation-model <id>] [--json]',
2602
+ 'Usage: coauthor image generate <project-id> --placeholder-id <id> [--prompt "..."] [--grounding-mode <mode>] [--image-generation-model <id>] [--json]',
2598
2603
  '',
2599
2604
  'Pass the placeholder `id` (UUID) or its `placeholder_id` from coauthor image list. Draft generation creates placeholders.',
2600
- 'Images are drawn from the planned brief; to steer one, generate it and then use coauthor image edit --edit-prompt.',
2605
+ 'Images are drawn from the planned brief. --prompt replaces the brief\'s scene (what the image shows) and is saved, so later regenerations keep it;',
2606
+ 'the profile\'s visual style still applies. Comparison and technical-diagram images have no scene to replace: generate them, then use image edit --edit-prompt.',
2601
2607
  'Generation is asynchronous: poll coauthor image status <project-id> --json until it is done.',
2602
2608
  ].join('\n'),
2603
2609
  'image edit': [
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@clickminded/coauthor-cli",
3
- "version": "0.0.34",
3
+ "version": "0.0.35",
4
4
  "type": "module",
5
5
  "bin": {
6
6
  "coauthor": "dist/index.js",
@@ -7,6 +7,7 @@ Draft generation plans image placeholders, including a featured image (`is_featu
7
7
  1. `coauthor image list <id> --json` returns `data.placeholders`. Each has an `id` (UUID), a `purpose`, an `image_type`, and the planned brief.
8
8
  2. Generate them all and wait: `coauthor image generate <id> --all --wait --json`. It skips images that are already done, and reports `done`, `failed`, and `still_running` (check again with `coauthor image status <id> --json`). Each image takes about 20 seconds.
9
9
  3. To generate one: `coauthor image generate <id> --placeholder-id <id UUID> --json` (the `id` UUID or the descriptive `placeholder_id`; optional `--grounding-mode <mode>`, `--image-generation-model <id>`), then poll `coauthor image status <id> --json`.
10
+ - To steer what it shows, add `--prompt "..."`: it replaces the planned scene (describe the subject and composition; the writer profile's visual style is still applied, so don't name an art style). It is saved, so later regenerations keep it. Use it when the planned brief is off-topic or wrong, not for small tweaks to a finished image (that's `image edit`). Comparison and technical-diagram images refuse it (`structured_brief`); generate those, then edit.
10
11
  4. Check every finished image (the URLs are in `image status` and in `draft get --format markdown`):
11
12
  - Charts and tables must match the article's numbers, and must not state figures the article deliberately leaves open.
12
13
  - Screens of real products (for example a Google or Meta interface) must not be presented as genuine.
@@ -30,6 +30,7 @@ Every failure prints JSON on stderr with `ok: false`, `error` (a readable messag
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. |
31
31
  | `insufficient_scope` | The token can't publish. | `coauthor auth login --with-publish`. |
32
32
  | `wordpress_connection_required` | Several WordPress sites are connected. | Ask which one from `details.connections`, add `--connection-id`. |
33
+ | `structured_brief` | `image generate --prompt` on a comparison or technical-diagram image, which is built from structured fields. | Generate without `--prompt`, then `image edit --edit-prompt "..."`. |
33
34
  | `usage_error` | The command or its flags are wrong; nothing was sent. | Check `coauthor help <command>` and fix the command. |
34
35
  | `request_timeout`, `network_error` | No answer from CoAuthor in time, or the connection failed. | For reads, retry. For exports and publishes, check `coauthor operation status <idempotency_key>` before retrying. |
35
36
 
@@ -336,6 +336,7 @@ Draft generation plans image placeholders, including a featured image (`is_featu
336
336
  1. `coauthor image list <id> --json` returns `data.placeholders`. Each has an `id` (UUID), a `purpose`, an `image_type`, and the planned brief.
337
337
  2. Generate them all and wait: `coauthor image generate <id> --all --wait --json`. It skips images that are already done, and reports `done`, `failed`, and `still_running` (check again with `coauthor image status <id> --json`). Each image takes about 20 seconds.
338
338
  3. To generate one: `coauthor image generate <id> --placeholder-id <id UUID> --json` (the `id` UUID or the descriptive `placeholder_id`; optional `--grounding-mode <mode>`, `--image-generation-model <id>`), then poll `coauthor image status <id> --json`.
339
+ - To steer what it shows, add `--prompt "..."`: it replaces the planned scene (describe the subject and composition; the writer profile's visual style is still applied, so don't name an art style). It is saved, so later regenerations keep it. Use it when the planned brief is off-topic or wrong, not for small tweaks to a finished image (that's `image edit`). Comparison and technical-diagram images refuse it (`structured_brief`); generate those, then edit.
339
340
  4. Check every finished image (the URLs are in `image status` and in `draft get --format markdown`):
340
341
  - Charts and tables must match the article's numbers, and must not state figures the article deliberately leaves open.
341
342
  - Screens of real products (for example a Google or Meta interface) must not be presented as genuine.
@@ -508,6 +509,7 @@ Every failure prints JSON on stderr with `ok: false`, `error` (a readable messag
508
509
  | `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. |
509
510
  | `insufficient_scope` | The token can't publish. | `coauthor auth login --with-publish`. |
510
511
  | `wordpress_connection_required` | Several WordPress sites are connected. | Ask which one from `details.connections`, add `--connection-id`. |
512
+ | `structured_brief` | `image generate --prompt` on a comparison or technical-diagram image, which is built from structured fields. | Generate without `--prompt`, then `image edit --edit-prompt "..."`. |
511
513
  | `usage_error` | The command or its flags are wrong; nothing was sent. | Check `coauthor help <command>` and fix the command. |
512
514
  | `request_timeout`, `network_error` | No answer from CoAuthor in time, or the connection failed. | For reads, retry. For exports and publishes, check `coauthor operation status <idempotency_key>` before retrying. |
513
515