benignswarm 0.12.10 → 0.12.12
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/args.js +1 -1
- package/dist/commands/wu.js +26 -2
- package/dist/help.js +3 -0
- package/dist/version.js +1 -1
- package/package.json +1 -1
package/dist/args.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { parseArgs } from "node:util";
|
|
2
2
|
import { CliError } from "./errors.js";
|
|
3
|
-
export const STRING_FLAGS = ["as", "admin", "key", "url", "label", "model", "since", "limit", "after", "topic", "goal", "task", "state", "blocked-on", "tags", "custom", "vendor", "role", "description", "permissions", "cardinality", "machine", "dir", "confirm", "type", "name", "out", "token", "prefix", "uses", "expires-hours", "skill-dir", "harness", "reply-to", "event", "project", "projects", "post", "title", "body", "body-file", "handoff-to", "evidence", "agent", "parent", "parent-item", "channel", "statuses", "assign", "if-status", "status", "exec", "interval", "requeue-after", "category", "command", "follow-delay", "env", "scope", "pr", "note", "add", "remove", "merged", "tag", "activity", "max-unanswered", "to", "replay-of", "branch", "effort", "by", "target", "milestone", "file"];
|
|
3
|
+
export const STRING_FLAGS = ["as", "admin", "key", "url", "label", "model", "since", "limit", "after", "topic", "goal", "task", "state", "blocked-on", "tags", "custom", "vendor", "role", "description", "permissions", "cardinality", "machine", "dir", "confirm", "type", "name", "out", "token", "prefix", "uses", "expires-hours", "skill-dir", "harness", "reply-to", "event", "project", "projects", "post", "title", "body", "body-file", "handoff-to", "evidence", "agent", "parent", "parent-item", "channel", "statuses", "assign", "if-status", "status", "exec", "interval", "requeue-after", "category", "command", "follow-delay", "env", "scope", "pr", "note", "add", "remove", "merged", "tag", "activity", "max-unanswered", "to", "replay-of", "branch", "effort", "by", "target", "milestone", "file", "exit", "depends-on", "source"];
|
|
4
4
|
export const BOOL_FLAGS = ["json", "follow", "account", "help", "version", "broadcast", "create-channels", "read-account-status", "replace-key", "mentions-me", "no-skill", "replace", "unread", "force", "no-hooks", "yes", "open", "bind-here", "peek", "once", "launchd", "full", "no-bind", "all", "here", "keep-worktree", "prune", "abandon"];
|
|
5
5
|
export function parse(argv) {
|
|
6
6
|
const options = {};
|
package/dist/commands/wu.js
CHANGED
|
@@ -380,11 +380,35 @@ export async function milestone(p, out) {
|
|
|
380
380
|
const key = p.positionals[2];
|
|
381
381
|
if (!key)
|
|
382
382
|
throw new CliError("usage", 'milestone show <key> | milestone close <key> --note "how the exit criterion was met" [--evidence id,id] [--abandon] | milestone reopen <key>');
|
|
383
|
+
if (sub === "add" || sub === "edit") {
|
|
384
|
+
// One slice in, the rest untouched: fetch the list, add or amend the entry, set it back.
|
|
385
|
+
const cur = (await client.call("GET", `/projects/${project}/milestones`)).milestones;
|
|
386
|
+
const existing = cur.find((m) => m.key === key);
|
|
387
|
+
if (sub === "add" && existing)
|
|
388
|
+
throw new CliError("exists", `milestone ${key} already exists; use milestone edit ${key}`);
|
|
389
|
+
if (sub === "edit" && !existing)
|
|
390
|
+
throw new CliError("not_found", `no milestone ${key}; use milestone add ${key} --title "..."`);
|
|
391
|
+
const title = str(p.flags, "title") ?? existing?.title;
|
|
392
|
+
if (!title)
|
|
393
|
+
throw new CliError("usage", 'milestone add <key> --title "..." [--exit "what done means"] [--source "docs/plan.md#section"] [--depends-on a,b] (no exit and no dependencies = a container for ongoing work)');
|
|
394
|
+
const deps = str(p.flags, "depends-on") !== undefined ? (str(p.flags, "depends-on") ?? "").split(",").map((s) => s.trim()).filter(Boolean) : existing?.depends_on ?? [];
|
|
395
|
+
const exit = str(p.flags, "exit") ?? existing?.exit ?? "";
|
|
396
|
+
const source = str(p.flags, "source") ?? existing?.source ?? "";
|
|
397
|
+
const next = cur.map((m) => ({ key: m.key, title: m.title, exit: m.exit, source: m.source ?? "", depends_on: m.depends_on }));
|
|
398
|
+
if (existing)
|
|
399
|
+
Object.assign(next.find((m) => m.key === key), { title, exit, source, depends_on: deps });
|
|
400
|
+
else
|
|
401
|
+
next.push({ key, title, exit, source, depends_on: deps });
|
|
402
|
+
const r = await client.call("PUT", `/projects/${project}/milestones`, { milestones: next });
|
|
403
|
+
const m = r.milestones.find((x) => x.key === key);
|
|
404
|
+
out.print(`${sub === "add" ? "Added" : "Updated"} milestone ${m.key}: ${m.title} [${m.ready ? "ready" : `waits on ${m.waiting_on.join(", ")}`}]${!m.exit && !m.depends_on.length ? " (container: never chased)" : ""}`, r);
|
|
405
|
+
return;
|
|
406
|
+
}
|
|
383
407
|
if (sub === "show") {
|
|
384
408
|
const m = (await client.call("GET", `/projects/${project}/milestones`)).milestones.find((x) => x.key === key);
|
|
385
409
|
if (!m)
|
|
386
410
|
throw new CliError("not_found", `no milestone ${key}`);
|
|
387
|
-
out.print(`${m.key}: ${m.title} [${m.status}${m.status === "open" && !m.ready ? `, waits on ${m.waiting_on.join(", ")}` : ""}]\n depends on: ${m.depends_on.join(", ") || "-"}\n units: ${m.units.done} done, ${m.units.open} open, ${m.units.queued} queued of ${m.units.total}\n exit: ${m.exit || "(not written)"}${m.closed_at ? `\n closed ${m.closed_at} by ${m.closed_by}: ${m.closed_note}${m.evidence.length ? ` (${m.evidence.map((e) => `evidence:${e}`).join(" ")})` : ""}` : ""}`, m);
|
|
411
|
+
out.print(`${m.key}: ${m.title} [${m.status}${m.status === "open" && !m.ready ? `, waits on ${m.waiting_on.join(", ")}` : ""}]\n depends on: ${m.depends_on.join(", ") || "-"}\n units: ${m.units.done} done, ${m.units.open} open, ${m.units.queued} queued of ${m.units.total}\n exit: ${m.exit || "(not written)"}${m.source ? `\n source: ${m.source} (the full brief; read it when planning this slice)` : ""}${m.closed_at ? `\n closed ${m.closed_at} by ${m.closed_by}: ${m.closed_note}${m.evidence.length ? ` (${m.evidence.map((e) => `evidence:${e}`).join(" ")})` : ""}` : ""}`, m);
|
|
388
412
|
return;
|
|
389
413
|
}
|
|
390
414
|
if (sub === "close") {
|
|
@@ -400,7 +424,7 @@ export async function milestone(p, out) {
|
|
|
400
424
|
out.print(`Milestone ${r.milestone.key} reopened.`, r);
|
|
401
425
|
return;
|
|
402
426
|
}
|
|
403
|
-
throw new CliError("usage", "milestone <show|close|reopen> <key>");
|
|
427
|
+
throw new CliError("usage", "milestone <add|edit|show|close|reopen> <key>");
|
|
404
428
|
}
|
|
405
429
|
export async function record(p, out) {
|
|
406
430
|
const name = resolveAgentName(str(p.flags, "as"));
|
package/dist/help.js
CHANGED
|
@@ -47,6 +47,9 @@ Agent commands
|
|
|
47
47
|
bschat milestones the plan's slices: ready or waiting on which, units done/total; wu open|assign --milestone <key>
|
|
48
48
|
bschat milestones set --file plan.json define or replace the plan (assigner roles or the operator): a JSON list of
|
|
49
49
|
{key, title, exit, depends_on}; existing keys keep their status; cycles are refused
|
|
50
|
+
bschat milestone add <key> --title ".." [--exit ".."] [--source "docs/plan.md#b0"] [--depends-on a,b] add one slice (assigner
|
|
51
|
+
roles or the operator); --source is where the full brief lives, read only when planning the slice;
|
|
52
|
+
no exit and no dependencies makes a container for ongoing work; milestone edit <key> amends
|
|
50
53
|
bschat milestone show <key> exit criterion, dependencies, counts; wu milestone <n> <key|none> moves a unit
|
|
51
54
|
bschat milestone close <key> --note ".." [--evidence a,b] [--abandon] the lead closes a slice against its exit criterion
|
|
52
55
|
(refused while it has units not done); milestone reopen <key> undoes it
|
package/dist/version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const CLI_VERSION = "0.12.
|
|
1
|
+
export const CLI_VERSION = "0.12.12";
|