@erdoai/cli 0.72.0 → 0.74.0
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/index.js +35 -3
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -2289,15 +2289,30 @@ wsCmd.command("phase-add <slug>").description("Append a new phase to a workstrea
|
|
|
2289
2289
|
}
|
|
2290
2290
|
}
|
|
2291
2291
|
);
|
|
2292
|
-
wsCmd.command("set-state <slug>").description("Update a workstream's status / title / description").option("--status <status>", "active, awaiting_user, blocked, completed").option("--title <title>", "retitle").option("--description <text>", "describe current state / surface a blocker").option("--summary <text>", "one-line audit-log summary of this update").
|
|
2292
|
+
wsCmd.command("set-state <slug>").description("Update a workstream's status / title / description / phase statuses").option("--status <status>", "active, awaiting_user, blocked, completed").option("--title <title>", "retitle").option("--description <text>", "describe current state / surface a blocker").option("--summary <text>", "one-line audit-log summary of this update").option(
|
|
2293
|
+
"--phase <slug=status>",
|
|
2294
|
+
"set one phase's status (repeatable), e.g. --phase brand-brief=completed --phase landing-pages=running; statuses: pending, running, awaiting_user, blocked, completed, skipped, failed",
|
|
2295
|
+
collect,
|
|
2296
|
+
[]
|
|
2297
|
+
).action(
|
|
2293
2298
|
async (slug, opts) => {
|
|
2294
2299
|
try {
|
|
2300
|
+
const phaseUpdates = opts.phase.map((raw) => {
|
|
2301
|
+
const eq = raw.indexOf("=");
|
|
2302
|
+
const phaseSlug = eq < 0 ? raw : raw.slice(0, eq);
|
|
2303
|
+
const status = eq < 0 ? "" : raw.slice(eq + 1);
|
|
2304
|
+
if (!phaseSlug || !status) {
|
|
2305
|
+
throw new Error(`--phase expects <slug>=<status>, got "${raw}"`);
|
|
2306
|
+
}
|
|
2307
|
+
return { slug: phaseSlug, status };
|
|
2308
|
+
});
|
|
2295
2309
|
print(
|
|
2296
2310
|
await new ErdoClient().updateWorkState(slug, {
|
|
2297
2311
|
status: opts.status,
|
|
2298
2312
|
title: opts.title,
|
|
2299
2313
|
description: opts.description,
|
|
2300
|
-
summary: opts.summary
|
|
2314
|
+
summary: opts.summary,
|
|
2315
|
+
phase_updates: phaseUpdates.length > 0 ? phaseUpdates : void 0
|
|
2301
2316
|
})
|
|
2302
2317
|
);
|
|
2303
2318
|
} catch (e) {
|
|
@@ -3535,8 +3550,9 @@ approvalsCmd.command("list").description("List approval requests, optionally fil
|
|
|
3535
3550
|
}
|
|
3536
3551
|
for (const r of res.requests) {
|
|
3537
3552
|
const occ = r.occurrence_count && r.occurrence_count > 1 ? ` \xD7${r.occurrence_count}` : "";
|
|
3553
|
+
const verdict = r.execution ? `${r.status}/${executionVerdict(r.execution)}` : r.status;
|
|
3538
3554
|
console.log(
|
|
3539
|
-
`${r.id} ${
|
|
3555
|
+
`${r.id} ${verdict} ${r.action_key} ${r.action_display} ${r.created_at}${occ}`
|
|
3540
3556
|
);
|
|
3541
3557
|
}
|
|
3542
3558
|
} catch (e) {
|
|
@@ -3544,6 +3560,18 @@ approvalsCmd.command("list").description("List approval requests, optionally fil
|
|
|
3544
3560
|
}
|
|
3545
3561
|
}
|
|
3546
3562
|
);
|
|
3563
|
+
function executionVerdict(execution) {
|
|
3564
|
+
switch (execution.state) {
|
|
3565
|
+
case "succeeded":
|
|
3566
|
+
return "landed";
|
|
3567
|
+
case "failed":
|
|
3568
|
+
return execution.total_count > 1 ? `${execution.failed_count} of ${execution.total_count} did not land` : "did not land";
|
|
3569
|
+
case "started":
|
|
3570
|
+
return "in flight";
|
|
3571
|
+
default:
|
|
3572
|
+
return "outcome unconfirmed";
|
|
3573
|
+
}
|
|
3574
|
+
}
|
|
3547
3575
|
function renderApproval(r) {
|
|
3548
3576
|
console.log(r.action_headline || r.action_display);
|
|
3549
3577
|
const facts = [["status", r.status]];
|
|
@@ -3562,6 +3590,10 @@ function renderApproval(r) {
|
|
|
3562
3590
|
facts.push(["created", r.created_at]);
|
|
3563
3591
|
if (r.decided_at) facts.push(["decided", r.decided_at]);
|
|
3564
3592
|
if (r.expires_at) facts.push(["expires", r.expires_at]);
|
|
3593
|
+
if (r.execution) {
|
|
3594
|
+
const reason = r.execution.summary ? ` \u2014 ${r.execution.summary}` : "";
|
|
3595
|
+
facts.push(["outcome", `${executionVerdict(r.execution)}${reason}`]);
|
|
3596
|
+
}
|
|
3565
3597
|
for (const [label, value] of facts) {
|
|
3566
3598
|
console.log(` ${label.padEnd(9)} ${value}`);
|
|
3567
3599
|
}
|