@erdoai/cli 0.73.0 → 0.75.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 +49 -15
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -2246,20 +2246,27 @@ wsCmd.command("get <slug>").description("Show a workstream \u2014 status, phases
|
|
|
2246
2246
|
fail(e);
|
|
2247
2247
|
}
|
|
2248
2248
|
});
|
|
2249
|
-
wsCmd.command("create").description("Create a workstream in a project").requiredOption("--project <slug>", "project slug").requiredOption("--slug <slug>", "workstream slug (unique per org)").requiredOption("--title <title>", "human-readable title").option("--description <text>", "free-form description").
|
|
2250
|
-
|
|
2251
|
-
|
|
2252
|
-
|
|
2253
|
-
|
|
2254
|
-
|
|
2255
|
-
|
|
2256
|
-
|
|
2257
|
-
|
|
2258
|
-
|
|
2259
|
-
|
|
2260
|
-
|
|
2249
|
+
wsCmd.command("create").description("Create a workstream in a project").requiredOption("--project <slug>", "project slug").requiredOption("--slug <slug>", "workstream slug (unique per org)").requiredOption("--title <title>", "human-readable title").option("--description <text>", "free-form description").option(
|
|
2250
|
+
"--token-budget <millicents>",
|
|
2251
|
+
"spend ceiling in millicents \u2014 100,000 per dollar, so 10000000 = $100 and 25000000 = $250; omit for unlimited",
|
|
2252
|
+
(v) => parseInt(v, 10)
|
|
2253
|
+
).action(
|
|
2254
|
+
async (opts) => {
|
|
2255
|
+
try {
|
|
2256
|
+
print(
|
|
2257
|
+
await new ErdoClient().createWorkstream({
|
|
2258
|
+
project_slug: opts.project,
|
|
2259
|
+
slug: opts.slug,
|
|
2260
|
+
title: opts.title,
|
|
2261
|
+
description: opts.description,
|
|
2262
|
+
token_budget_millicents: opts.tokenBudget
|
|
2263
|
+
})
|
|
2264
|
+
);
|
|
2265
|
+
} catch (e) {
|
|
2266
|
+
fail(e);
|
|
2267
|
+
}
|
|
2261
2268
|
}
|
|
2262
|
-
|
|
2269
|
+
);
|
|
2263
2270
|
wsCmd.command("log <slug> <body...>").description("Append a line to the workstream's event log").action(async (slug, body) => {
|
|
2264
2271
|
try {
|
|
2265
2272
|
print(await new ErdoClient().appendWorkstreamEvent(slug, body.join(" ")));
|
|
@@ -2290,6 +2297,10 @@ wsCmd.command("phase-add <slug>").description("Append a new phase to a workstrea
|
|
|
2290
2297
|
}
|
|
2291
2298
|
);
|
|
2292
2299
|
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(
|
|
2300
|
+
"--token-budget <millicents>",
|
|
2301
|
+
"spend ceiling in millicents \u2014 100,000 per dollar, so 25000000 = $250; this is how you raise a ceiling a loop has spent through",
|
|
2302
|
+
(v) => parseInt(v, 10)
|
|
2303
|
+
).option("--escalation-budget <n>", "max urgent attention items per rolling 24h", (v) => parseInt(v, 10)).option(
|
|
2293
2304
|
"--phase <slug=status>",
|
|
2294
2305
|
"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
2306
|
collect,
|
|
@@ -2312,6 +2323,8 @@ wsCmd.command("set-state <slug>").description("Update a workstream's status / ti
|
|
|
2312
2323
|
title: opts.title,
|
|
2313
2324
|
description: opts.description,
|
|
2314
2325
|
summary: opts.summary,
|
|
2326
|
+
token_budget_millicents: opts.tokenBudget,
|
|
2327
|
+
escalation_budget_per_day: opts.escalationBudget,
|
|
2315
2328
|
phase_updates: phaseUpdates.length > 0 ? phaseUpdates : void 0
|
|
2316
2329
|
})
|
|
2317
2330
|
);
|
|
@@ -2320,7 +2333,11 @@ wsCmd.command("set-state <slug>").description("Update a workstream's status / ti
|
|
|
2320
2333
|
}
|
|
2321
2334
|
}
|
|
2322
2335
|
);
|
|
2323
|
-
wsCmd.command("arm <slug>").description("Arm the recurring reconciliation loop (allocator pass) for a workstream").option("--interval <minutes>", "how often the loop runs", (v) => parseInt(v, 10)).option("--model <id>", "model the loop runs on").option("--timezone <tz>", "timezone for scheduling").option(
|
|
2336
|
+
wsCmd.command("arm <slug>").description("Arm the recurring reconciliation loop (allocator pass) for a workstream").option("--interval <minutes>", "how often the loop runs", (v) => parseInt(v, 10)).option("--model <id>", "model the loop runs on").option("--timezone <tz>", "timezone for scheduling").option(
|
|
2337
|
+
"--token-budget <millicents>",
|
|
2338
|
+
"total spend ceiling in millicents \u2014 100,000 per dollar, so 25000000 = $250; also how you raise a ceiling a loop has spent through",
|
|
2339
|
+
(v) => parseInt(v, 10)
|
|
2340
|
+
).option("--escalation-budget <n>", "max escalations to a human per day", (v) => parseInt(v, 10)).action(
|
|
2324
2341
|
async (slug, opts) => {
|
|
2325
2342
|
try {
|
|
2326
2343
|
const client = new ErdoClient();
|
|
@@ -3550,8 +3567,9 @@ approvalsCmd.command("list").description("List approval requests, optionally fil
|
|
|
3550
3567
|
}
|
|
3551
3568
|
for (const r of res.requests) {
|
|
3552
3569
|
const occ = r.occurrence_count && r.occurrence_count > 1 ? ` \xD7${r.occurrence_count}` : "";
|
|
3570
|
+
const verdict = r.execution ? `${r.status}/${executionVerdict(r.execution)}` : r.status;
|
|
3553
3571
|
console.log(
|
|
3554
|
-
`${r.id} ${
|
|
3572
|
+
`${r.id} ${verdict} ${r.action_key} ${r.action_display} ${r.created_at}${occ}`
|
|
3555
3573
|
);
|
|
3556
3574
|
}
|
|
3557
3575
|
} catch (e) {
|
|
@@ -3559,6 +3577,18 @@ approvalsCmd.command("list").description("List approval requests, optionally fil
|
|
|
3559
3577
|
}
|
|
3560
3578
|
}
|
|
3561
3579
|
);
|
|
3580
|
+
function executionVerdict(execution) {
|
|
3581
|
+
switch (execution.state) {
|
|
3582
|
+
case "succeeded":
|
|
3583
|
+
return "landed";
|
|
3584
|
+
case "failed":
|
|
3585
|
+
return execution.total_count > 1 ? `${execution.failed_count} of ${execution.total_count} did not land` : "did not land";
|
|
3586
|
+
case "started":
|
|
3587
|
+
return "in flight";
|
|
3588
|
+
default:
|
|
3589
|
+
return "outcome unconfirmed";
|
|
3590
|
+
}
|
|
3591
|
+
}
|
|
3562
3592
|
function renderApproval(r) {
|
|
3563
3593
|
console.log(r.action_headline || r.action_display);
|
|
3564
3594
|
const facts = [["status", r.status]];
|
|
@@ -3577,6 +3607,10 @@ function renderApproval(r) {
|
|
|
3577
3607
|
facts.push(["created", r.created_at]);
|
|
3578
3608
|
if (r.decided_at) facts.push(["decided", r.decided_at]);
|
|
3579
3609
|
if (r.expires_at) facts.push(["expires", r.expires_at]);
|
|
3610
|
+
if (r.execution) {
|
|
3611
|
+
const reason = r.execution.summary ? ` \u2014 ${r.execution.summary}` : "";
|
|
3612
|
+
facts.push(["outcome", `${executionVerdict(r.execution)}${reason}`]);
|
|
3613
|
+
}
|
|
3580
3614
|
for (const [label, value] of facts) {
|
|
3581
3615
|
console.log(` ${label.padEnd(9)} ${value}`);
|
|
3582
3616
|
}
|