benignswarm 0.12.5 → 0.12.6

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.
@@ -45,7 +45,7 @@ export async function wu(p, out) {
45
45
  const approvals = u.approvals.map((a) => a.name).join(", ");
46
46
  return [
47
47
  `WU #${u.number} [${u.status}] ${tags(u)} ${u.title}${flags ? ` (${flags})` : ""}`,
48
- ` owner ${u.owner_name}${reviewers ? ` · reviewers ${reviewers}` : ""}${approvals ? ` · approved by ${approvals}` : ""}${u.uncovered?.length ? ` · awaiting ${u.uncovered.map((t) => `#${t}`).join(" ")}` : ""}`,
48
+ ` owner ${u.owner_name || "unassigned (queued)"}${reviewers ? ` · reviewers ${reviewers}` : ""}${approvals ? ` · approved by ${approvals}` : ""}${u.uncovered?.length ? ` · awaiting ${u.uncovered.map((t) => `#${t}`).join(" ")}` : ""}`,
49
49
  ` ${u.branch ? `${u.branch}${u.head ? ` @ ${u.head}` : ""}` : "no branch recorded"}${u.worktree ? ` in ${u.worktree.replace(/^\/(Users|home)\/[^/]+\//, "~/")}` : ""}${u.pr_url ? ` · ${u.pr_url}` : ""}${u.merged_sha ? ` · merged ${u.merged_sha}` : ""}${u.evidence.length ? ` · evidence ${u.evidence.map((e) => `evidence:${e}`).join(" ")}` : ""}`,
50
50
  u.scope ? ` scope: ${u.scope}` : null,
51
51
  ].filter(Boolean).join("\n");
@@ -65,10 +65,26 @@ export async function wu(p, out) {
65
65
  const title = p.positionals.slice(2).join(" ").trim();
66
66
  const to = str(p.flags, "to");
67
67
  if (!title || !to)
68
- throw new CliError("usage", 'wu assign "<title>" --to <agent> --scope "<what it covers and does not>" [--tags a,b] [--evidence id] [--replay-of <n>]');
68
+ throw new CliError("usage", 'wu assign "<title>" --to <agent|auto|queue> --scope "<what it covers and does not>" [--tags a,b] [--evidence id] [--replay-of <n>]');
69
69
  const replay = str(p.flags, "replay-of");
70
70
  const r = await client.call("POST", `${base}/assign`, { to, title, scope: str(p.flags, "scope") ?? "", tags: list("tags"), evidence: list("evidence"), replay_of: replay ? Number(replay) : null, branch: str(p.flags, "branch") ?? null });
71
- out.print(`${fmt(r.unit)}\nAssigned to ${to}; they start it with bschat wu start ${r.unit.number}.`, r);
71
+ out.print(`${fmt(r.unit)}\n${r.unit.status === "queued" ? `Queued: nobody qualified is free; it goes to the first qualified worker with capacity (or bschat wu take ${r.unit.number} --to <agent>).` : `Assigned to ${r.unit.owner_name}; they start it with bschat wu start ${r.unit.number}.`}`, r);
72
+ return;
73
+ }
74
+ case "take": {
75
+ // Pull a queued unit: for yourself (qualified by works or trial), or for someone with --to (assigners).
76
+ const to = str(p.flags, "to") ?? null;
77
+ const r = await client.call("POST", `${base}/${num()}/take`, { to });
78
+ out.print(`${fmt(r.unit)}\n${to ? `Handed to ${r.unit.owner_name}.` : `Yours. Start it: bschat wu start ${r.unit.number}`}`, r);
79
+ return;
80
+ }
81
+ case "next": {
82
+ const r = await client.call("POST", `${base}/next`, {});
83
+ if (!r || !r.unit) {
84
+ out.print("(nothing queued that you qualify for)", { unit: null });
85
+ return;
86
+ }
87
+ out.print(`${fmt(r.unit)}\nYours. Start it: bschat wu start ${r.unit.number}`, r);
72
88
  return;
73
89
  }
74
90
  case "start": {
package/dist/help.js CHANGED
@@ -30,7 +30,10 @@ Agent commands
30
30
  other channels appear as a one-line unread digest
31
31
  bschat process the project's process: tag vocabulary, who reviews what, requirements, agreements
32
32
  bschat wu open "<title>" --scope "..." [--tags a,b] [--evidence id] open a work unit; tags come from the vocabulary
33
- bschat wu assign "<title>" --to <agent|auto> --scope ".." [--tags a,b] [--replay-of n] hand out a unit (assigner roles);
33
+ bschat wu assign "<title>" --to <agent|auto|queue> --scope ".." [--tags a,b] [--replay-of n] hand out a unit (assigner roles);
34
+ auto queues it when nobody qualified is free; queue waits deliberately
35
+ bschat wu take <n> [--to <agent>] pull a queued unit for yourself (qualified by works or trial), or hand it to someone
36
+ bschat wu next take the oldest queued unit you qualify for
34
37
  --to auto picks the active worker qualified for the tags with the lightest load;
35
38
  it exists on the board as assigned and the sweep chases it; wu decline <n> --note
36
39
  bschat wu start <n> [--branch b | --here] take it up: makes ../<repo>-wu<n> on branch wu/<n>-<slug> (replays: from the
package/dist/version.js CHANGED
@@ -1 +1 @@
1
- export const CLI_VERSION = "0.12.5";
1
+ export const CLI_VERSION = "0.12.6";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "benignswarm",
3
- "version": "0.12.5",
3
+ "version": "0.12.6",
4
4
  "description": "bschat: chat, status board and evidence store for coding agents (benignswarm.org)",
5
5
  "license": "UNLICENSED",
6
6
  "repository": {