@clickminded/coauthor-cli 0.0.63 → 0.0.64
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
|
@@ -2454,6 +2454,21 @@ function seoPlanWaitFailure(status) {
|
|
|
2454
2454
|
};
|
|
2455
2455
|
}
|
|
2456
2456
|
// Polls the plan's status (capped under the 10-minute agent shell limit) until it stops queued/running.
|
|
2457
|
+
/**
|
|
2458
|
+
* "#3 in line, starts in about 16 min" for a plan that has not started yet, from the status route's queue
|
|
2459
|
+
* fields; "#3 in line, starts when free plans resume" while its queue is paused (`queue_paused`, no ETA).
|
|
2460
|
+
*/
|
|
2461
|
+
function seoPlanQueueNote(status) {
|
|
2462
|
+
const position = status.queue_position;
|
|
2463
|
+
const eta = status.queue_eta_minutes;
|
|
2464
|
+
if (status.status !== 'queued' || typeof position !== 'number')
|
|
2465
|
+
return null;
|
|
2466
|
+
if (status.queue_paused === true)
|
|
2467
|
+
return `#${position} in line, starts when free plans resume`;
|
|
2468
|
+
if (typeof eta !== 'number')
|
|
2469
|
+
return null;
|
|
2470
|
+
return `#${position} in line, starts in about ${eta} min`;
|
|
2471
|
+
}
|
|
2457
2472
|
async function waitForSeoPlan(client, profileId, started) {
|
|
2458
2473
|
const statusPath = `profiles/${encodeURIComponent(profileId)}/seo-plan/status`;
|
|
2459
2474
|
const resume = `coauthor seo-plan generate --profile ${profileId} --wait`;
|
|
@@ -2465,7 +2480,7 @@ async function waitForSeoPlan(client, profileId, started) {
|
|
|
2465
2480
|
status = planRecord(await client.request({ path: statusPath }));
|
|
2466
2481
|
}
|
|
2467
2482
|
if (status.done !== true) {
|
|
2468
|
-
const step = planString(planRecord(status.progress), 'step') ?? planString(planRecord(status.progress), 'label');
|
|
2483
|
+
const step = seoPlanQueueNote(status) ?? planString(planRecord(status.progress), 'step') ?? planString(planRecord(status.progress), 'label');
|
|
2469
2484
|
return {
|
|
2470
2485
|
ok: false,
|
|
2471
2486
|
status: 'still_running',
|
package/package.json
CHANGED
|
@@ -33,6 +33,7 @@ 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.
|
|
36
37
|
- `--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
38
|
- `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
39
|
- 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,7 @@ 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.
|
|
622
623
|
- `--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
624
|
- `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
625
|
- 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.
|