@clickminded/coauthor-cli 0.0.63 → 0.0.65

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
@@ -2303,6 +2303,8 @@ function seoPlanShowMessage(data, kind) {
2303
2303
  const code = planString(plan, 'error_code');
2304
2304
  lines.push(`The last plan run failed${code ? ` (${code})` : ''}: ${planString(plan, 'error_message') ?? 'unknown error'}. Try again with \`coauthor seo-plan generate --wait\`.${firstPlanFree ? ' Your first plan is free, so the retry uses no credits.' : ''}`);
2305
2305
  }
2306
+ if (plan.is_preview === true)
2307
+ lines.push(`This is a free preview of the plan (the first posts and a few pages to improve). \`coauthor seo-plan generate --wait\` finishes it into the full plan${firstPlanFree ? ', which is free (your first plan)' : ''}.`);
2306
2308
  if (view.stale === true)
2307
2309
  lines.push('The profile\'s website or market changed since this plan was made. `coauthor seo-plan generate` updates it.');
2308
2310
  const monthly = view.monthly_check === null || view.monthly_check === undefined ? null : planRecord(view.monthly_check);
@@ -2454,6 +2456,21 @@ function seoPlanWaitFailure(status) {
2454
2456
  };
2455
2457
  }
2456
2458
  // Polls the plan's status (capped under the 10-minute agent shell limit) until it stops queued/running.
2459
+ /**
2460
+ * "#3 in line, starts in about 16 min" for a plan that has not started yet, from the status route's queue
2461
+ * fields; "#3 in line, starts when free plans resume" while its queue is paused (`queue_paused`, no ETA).
2462
+ */
2463
+ function seoPlanQueueNote(status) {
2464
+ const position = status.queue_position;
2465
+ const eta = status.queue_eta_minutes;
2466
+ if (status.status !== 'queued' || typeof position !== 'number')
2467
+ return null;
2468
+ if (status.queue_paused === true)
2469
+ return `#${position} in line, starts when free plans resume`;
2470
+ if (typeof eta !== 'number')
2471
+ return null;
2472
+ return `#${position} in line, starts in about ${eta} min`;
2473
+ }
2457
2474
  async function waitForSeoPlan(client, profileId, started) {
2458
2475
  const statusPath = `profiles/${encodeURIComponent(profileId)}/seo-plan/status`;
2459
2476
  const resume = `coauthor seo-plan generate --profile ${profileId} --wait`;
@@ -2465,7 +2482,7 @@ async function waitForSeoPlan(client, profileId, started) {
2465
2482
  status = planRecord(await client.request({ path: statusPath }));
2466
2483
  }
2467
2484
  if (status.done !== true) {
2468
- const step = planString(planRecord(status.progress), 'step') ?? planString(planRecord(status.progress), 'label');
2485
+ const step = seoPlanQueueNote(status) ?? planString(planRecord(status.progress), 'step') ?? planString(planRecord(status.progress), 'label');
2469
2486
  return {
2470
2487
  ok: false,
2471
2488
  status: 'still_running',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@clickminded/coauthor-cli",
3
- "version": "0.0.63",
3
+ "version": "0.0.65",
4
4
  "type": "module",
5
5
  "bin": {
6
6
  "coauthor": "dist/index.js",
@@ -33,6 +33,8 @@ coauthor seo-plan results [--profile <id>] --json
33
33
 
34
34
  - Without `--profile` the default profile is used. Run `coauthor profile list --json` first when the user has several profiles and the request names a site or brand.
35
35
  - `generate` returns at once with `data.plan_id`, `data.free` and `data.estimate_credits`. With `--wait` it polls until the plan is ready. After 9 minutes it exits with code 2 and `still_running`; run the same `generate ... --wait` command again to keep waiting (it joins the running plan; it does not start a second one).
36
+ - Many plans can be made at once, so a new plan may wait its turn. While `status` is `queued`, the status data carries `queue_position` (1 = next), `queue_eta_minutes` (a rough estimate) and `queue_paused`; the position and estimate are `null` once the plan is running or before the position is known. When `queue_paused` is `true` the plan is waiting for free plans to resume and has no estimate. Tell the user their place in line and keep waiting; the plan starts by itself.
37
+ - A plan can still be the free **preview** a person got from the website (`data.plan.is_preview` is `true`): it holds only the first 10 posts and a few pages to improve, with no monthly check. Running `generate` finishes it into the full plan, which counts as the user's free first plan (`first_plan_free` ignores previews). Say so when the user asks why a plan is short.
36
38
  - `--adjust` is a short steer for this run, for example `--adjust "focus on B2B buyers, skip anything about hiring"`. Use it when the user wants a different emphasis. Competitors are found automatically; the user corrects them in the web app.
37
39
  - `show` returns `data.plan` (`strategy_line`, `competitors_line`, `status`), `data.do_next` (the five best next moves), `data.counts_by_kind`, and `data.items` for one `--kind` (default `post`). Items are sorted as the web app shows them.
38
40
  - A plan run that fails says why in `data.error_code` and `data.error_message` (see `references/troubleshooting.md`). Credits for a failed run are only charged for work that finished.
@@ -619,6 +619,8 @@ coauthor seo-plan results [--profile <id>] --json
619
619
 
620
620
  - Without `--profile` the default profile is used. Run `coauthor profile list --json` first when the user has several profiles and the request names a site or brand.
621
621
  - `generate` returns at once with `data.plan_id`, `data.free` and `data.estimate_credits`. With `--wait` it polls until the plan is ready. After 9 minutes it exits with code 2 and `still_running`; run the same `generate ... --wait` command again to keep waiting (it joins the running plan; it does not start a second one).
622
+ - Many plans can be made at once, so a new plan may wait its turn. While `status` is `queued`, the status data carries `queue_position` (1 = next), `queue_eta_minutes` (a rough estimate) and `queue_paused`; the position and estimate are `null` once the plan is running or before the position is known. When `queue_paused` is `true` the plan is waiting for free plans to resume and has no estimate. Tell the user their place in line and keep waiting; the plan starts by itself.
623
+ - A plan can still be the free **preview** a person got from the website (`data.plan.is_preview` is `true`): it holds only the first 10 posts and a few pages to improve, with no monthly check. Running `generate` finishes it into the full plan, which counts as the user's free first plan (`first_plan_free` ignores previews). Say so when the user asks why a plan is short.
622
624
  - `--adjust` is a short steer for this run, for example `--adjust "focus on B2B buyers, skip anything about hiring"`. Use it when the user wants a different emphasis. Competitors are found automatically; the user corrects them in the web app.
623
625
  - `show` returns `data.plan` (`strategy_line`, `competitors_line`, `status`), `data.do_next` (the five best next moves), `data.counts_by_kind`, and `data.items` for one `--kind` (default `post`). Items are sorted as the web app shows them.
624
626
  - A plan run that fails says why in `data.error_code` and `data.error_message` (see `references/troubleshooting.md`). Credits for a failed run are only charged for work that finished.