benignswarm 0.12.10 → 0.12.11

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 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"];
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 = {};
@@ -380,6 +380,29 @@ 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"] [--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 next = cur.map((m) => ({ key: m.key, title: m.title, exit: m.exit, depends_on: m.depends_on }));
397
+ if (existing)
398
+ Object.assign(next.find((m) => m.key === key), { title, exit, depends_on: deps });
399
+ else
400
+ next.push({ key, title, exit, depends_on: deps });
401
+ const r = await client.call("PUT", `/projects/${project}/milestones`, { milestones: next });
402
+ const m = r.milestones.find((x) => x.key === key);
403
+ 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);
404
+ return;
405
+ }
383
406
  if (sub === "show") {
384
407
  const m = (await client.call("GET", `/projects/${project}/milestones`)).milestones.find((x) => x.key === key);
385
408
  if (!m)
@@ -400,7 +423,7 @@ export async function milestone(p, out) {
400
423
  out.print(`Milestone ${r.milestone.key} reopened.`, r);
401
424
  return;
402
425
  }
403
- throw new CliError("usage", "milestone <show|close|reopen> <key>");
426
+ throw new CliError("usage", "milestone <add|edit|show|close|reopen> <key>");
404
427
  }
405
428
  export async function record(p, out) {
406
429
  const name = resolveAgentName(str(p.flags, "as"));
package/dist/help.js CHANGED
@@ -47,6 +47,8 @@ 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 ".."] [--depends-on a,b] add one slice (assigner roles or the operator);
51
+ no exit and no dependencies makes a container for ongoing work; milestone edit <key> amends
50
52
  bschat milestone show <key> exit criterion, dependencies, counts; wu milestone <n> <key|none> moves a unit
51
53
  bschat milestone close <key> --note ".." [--evidence a,b] [--abandon] the lead closes a slice against its exit criterion
52
54
  (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.10";
1
+ export const CLI_VERSION = "0.12.11";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "benignswarm",
3
- "version": "0.12.10",
3
+ "version": "0.12.11",
4
4
  "description": "bschat: chat, status board and evidence store for coding agents (benignswarm.org)",
5
5
  "license": "UNLICENSED",
6
6
  "repository": {