benignswarm 0.12.80 → 0.12.82
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/operator.js +7 -2
- package/dist/commands/wu.js +11 -2
- package/dist/help.js +7 -2
- package/dist/version.js +1 -1
- package/package.json +1 -1
package/dist/args.js
CHANGED
|
@@ -3,7 +3,7 @@ import { CliError } from "./errors.js";
|
|
|
3
3
|
// These options accept comma-separated collections, so repeating them should
|
|
4
4
|
// append another collection instead of discarding earlier values.
|
|
5
5
|
export const LIST_FLAGS = ["tags", "projects", "evidence", "statuses", "depends-on", "default-tags", "units", "waits-on", "needs", "exclude", "remove", "post", "harness", "variant", "requires"];
|
|
6
|
-
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", "unacked-after", "category", "command", "follow-delay", "env", "scope", "append", "pr", "note", "add", "remove", "merged", "tag", "activity", "max-unanswered", "to", "replay-of", "branch", "effort", "by", "target", "milestone", "file", "exit", "depends-on", "default-tags", "source", "by", "on", "question", "ruling", "gaps", "unit", "units", "blocks", "sla", "takeover", "max-open", "max-in-progress", "require-scope", "require-evidence", "default-approver", "merged-by", "integrator-role", "require-rebased", "require-merge-commit", "require-pushed", "quiet", "summary", "meaning", "expert-role", "reviews", "works", "trials", "email", "repeat", "summary-minutes", "churn", "unmet", "require-cited-changes", "checks-every", "propose", "waits-on", "sandbox", "thread", "turn-timeout", "session", "plain", "if-yes", "if-no", "ssh", "variant", "count", "needs", "min-ram", "exclude", "carry", "from", "to-ssh", "wait", "writable", "for", "until", "reason", "at", "requires", "priority", "informs", "amend", "waive-informs", "text", "kind", "claim", "decision"];
|
|
6
|
+
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", "unacked-after", "category", "command", "follow-delay", "env", "scope", "append", "pr", "note", "add", "remove", "merged", "tag", "activity", "max-unanswered", "to", "replay-of", "branch", "effort", "by", "target", "milestone", "file", "exit", "depends-on", "default-tags", "source", "by", "on", "partial", "question", "ruling", "gaps", "unit", "units", "blocks", "sla", "takeover", "max-open", "max-in-progress", "require-scope", "require-evidence", "default-approver", "merged-by", "integrator-role", "require-rebased", "require-merge-commit", "require-pushed", "quiet", "summary", "meaning", "expert-role", "reviews", "works", "trials", "email", "repeat", "summary-minutes", "churn", "unmet", "require-cited-changes", "checks-every", "propose", "waits-on", "sandbox", "thread", "turn-timeout", "session", "plain", "if-yes", "if-no", "ssh", "variant", "count", "needs", "min-ram", "exclude", "carry", "from", "to-ssh", "wait", "writable", "for", "until", "reason", "at", "requires", "priority", "informs", "amend", "waive-informs", "text", "kind", "claim", "decision"];
|
|
7
7
|
export const BOOL_FLAGS = ["latest", "no-restart", "json", "follow", "account", "help", "version", "broadcast", "create-channels", "read-account-status", "replace-key", "mentions-me", "no-skill", "replace", "scope-only", "unread", "pending", "force", "no-hooks", "yes", "open", "bind-here", "peek", "once", "launchd", "full", "no-bind", "all", "here", "keep-worktree", "prune", "abandon", "defer", "hold", "clear", "met", "shared", "archive", "approve", "turn", "service", "print-hooks", "create", "rotate", "codex-userns", "bwrap-userns", "print-apparmor", "cancel"];
|
|
8
8
|
export function parse(argv) {
|
|
9
9
|
const options = {};
|
|
@@ -275,16 +275,21 @@ export async function answerAdmin(rest, p, out) {
|
|
|
275
275
|
const [key, ...words] = rest;
|
|
276
276
|
const answer = (words.join(" ") || str(p.flags, "note") || "").trim();
|
|
277
277
|
const approve = bool(p.flags, "approve");
|
|
278
|
+
const assign = str(p.flags, "assign");
|
|
278
279
|
if (!key || (!answer && !approve))
|
|
279
|
-
throw new CliError("usage", 'admin answer <key from admin needs> "decision" | --approve [--note ".."]');
|
|
280
|
+
throw new CliError("usage", 'admin answer <key from admin needs> "decision" | --approve [--assign <agent>] [--note ".."]');
|
|
281
|
+
if (assign && !approve)
|
|
282
|
+
throw new CliError("usage", "--assign is only valid with --approve");
|
|
280
283
|
const c = adminClient(p);
|
|
281
284
|
const n = (await c.call("GET", "/account/needs")).needs.find((x) => x.key === key);
|
|
282
285
|
if (!n)
|
|
283
286
|
throw new CliError("not_found", `nothing waiting with key ${key}; list them with: bschat-admin needs`);
|
|
287
|
+
if (assign && n.kind !== "ask")
|
|
288
|
+
throw new CliError("usage", "--assign names the owner of an approved ask action; this need is not an ask");
|
|
284
289
|
if (approve && n.kind !== "ask" && n.kind !== "unit_question")
|
|
285
290
|
throw new CliError("usage", "--approve accepts a proposal on an ask or a unit question; this one has none");
|
|
286
291
|
if (n.kind === "ask")
|
|
287
|
-
return out.print(approve ?
|
|
292
|
+
return out.print(approve ? `Approved the proposal${assign ? ` and assigned the action to ${assign}` : ""}; the asker was told.` : "Answered; the asker was told.", await c.call("POST", `/projects/${n.project}/asks/${n.ask_id}/answer`, approve ? { approve: true, answer, ...(assign ? { assign } : {}) } : { answer }));
|
|
288
293
|
if (n.kind === "unit_question")
|
|
289
294
|
return out.print(`Ruled on WU #${n.unit}${approve ? " (proposal approved)" : ""}; the asker, owner and reviewers were told.`, await c.call("POST", `/projects/${n.project}/work-units/${n.unit}/rule`, approve ? { approve: true, ruling: answer } : { ruling: answer }));
|
|
290
295
|
throw new CliError("not_answerable", n.kind === "wake_broken" ? `a broken wake path clears when ${n.agent} shows activity: fix its watcher or harness session` : "a notifier problem clears on the next report that reaches you: fix it with bschat-admin notifier");
|
package/dist/commands/wu.js
CHANGED
|
@@ -47,6 +47,11 @@ export function assignmentDisposition(unit, to) {
|
|
|
47
47
|
: "\nNo eligible worker candidates were found.";
|
|
48
48
|
return `Queued: nobody qualified is free; it goes to the first qualified worker with capacity (or bschat wu take ${unit.number} --to <agent>).${reasons}`;
|
|
49
49
|
}
|
|
50
|
+
/** Keeps the former numeric --on unit request shape while allowing named review blockers. */
|
|
51
|
+
export function waitPayload(on, clear, note, partial = "") {
|
|
52
|
+
const value = on === undefined ? null : /^\d{1,6}$/.test(on) ? Number(on) : on;
|
|
53
|
+
return { on: value, clear, note, partial };
|
|
54
|
+
}
|
|
50
55
|
/**
|
|
51
56
|
* Work units under the project's process. Work is described by tags from the project's
|
|
52
57
|
* vocabulary; reviewers are whoever is qualified to review those tags.
|
|
@@ -132,7 +137,7 @@ export async function wu(p, out) {
|
|
|
132
137
|
};
|
|
133
138
|
const tags = (u) => (u.tags.length ? u.tags.map((t) => `#${t}`).join(" ") : "(untagged)");
|
|
134
139
|
const fmt = (u) => {
|
|
135
|
-
const flags = [u.assigned_by ? `assigned by ${u.assigned_by}` : null, u.preferred_name ? `reserved for ${u.preferred_name}` : null, u.hold && u.status === "assigned" ? "held" : null, u.waiting_on ? `waits on #${u.waiting_on}` : null, u.milestone ? `milestone ${u.milestone}` : null, u.target ? `lands in ${u.target}` : null, u.replay_of ? "REPLAY" : null, u.trial_tags?.length ? `trial on ${u.trial_tags.map((t) => `#${t}`).join(" ")}` : null].filter(Boolean).join(" · ");
|
|
140
|
+
const flags = [u.assigned_by ? `assigned by ${u.assigned_by}` : null, u.preferred_name ? `reserved for ${u.preferred_name}` : null, u.hold && u.status === "assigned" ? "held" : null, u.waiting_on ? `waits on #${u.waiting_on}` : null, u.review_wait ? `waiting on ${u.review_wait.type === "unit" ? `WU #${u.review_wait.target}` : u.review_wait.type === "ask" ? `ask ${u.review_wait.target}` : u.review_wait.type === "machine" ? `machine ${u.review_wait.target}` : u.review_wait.type === "text" ? u.review_wait.target : "evidence"} for ${Math.max(0, Math.round((Date.now() - Date.parse(u.review_wait.started_at)) / 60000))} min` : null, u.milestone ? `milestone ${u.milestone}` : null, u.target ? `lands in ${u.target}` : null, u.replay_of ? "REPLAY" : null, u.trial_tags?.length ? `trial on ${u.trial_tags.map((t) => `#${t}`).join(" ")}` : null].filter(Boolean).join(" · ");
|
|
136
141
|
const reviewers = u.reviewers.map((r) => `${r.name}${r.tags.length ? ` for ${r.tags.map((t) => `#${t}`).join(" ")}` : ""}`).join(", ");
|
|
137
142
|
const approvals = u.approvals.map((a) => a.name).join(", ");
|
|
138
143
|
return [
|
|
@@ -310,7 +315,11 @@ export async function wu(p, out) {
|
|
|
310
315
|
const on = str(p.flags, "on");
|
|
311
316
|
if (!on && !bool(p.flags, "clear"))
|
|
312
317
|
throw new CliError("usage", 'wu wait <n> --on <m> [--note ".."] (or --clear)');
|
|
313
|
-
|
|
318
|
+
if (on && bool(p.flags, "clear"))
|
|
319
|
+
throw new CliError("usage", "choose either --on or --clear");
|
|
320
|
+
if (on && !str(p.flags, "note"))
|
|
321
|
+
throw new CliError("usage", 'wu wait <n> --on "evidence|unit #m|ask id|machine name|text blocker" --note "why"');
|
|
322
|
+
const r = await client.call("POST", `${base}/${num()}/wait`, waitPayload(on, bool(p.flags, "clear"), str(p.flags, "note") ?? "", str(p.flags, "partial") ?? ""));
|
|
314
323
|
out.print(fmt(r.unit), r);
|
|
315
324
|
return;
|
|
316
325
|
}
|
package/dist/help.js
CHANGED
|
@@ -13,6 +13,8 @@ Joining (first time on a machine, with an enrollment token from the account owne
|
|
|
13
13
|
gemini-cli (GEMINI.md). Identity persists in .bschat/identity.json per repo and vendor, surviving reboots.
|
|
14
14
|
|
|
15
15
|
Account-wide agents: project commands take --project <name> (or BSCHAT_PROJECT); see projects with: bschat me
|
|
16
|
+
Assistant use is off by default; an admin key or signed-in owner toggles it with PATCH /account {"assistant_enabled":true|false}.
|
|
17
|
+
GET /account/usage reports used and allowed micro-dollars, uncertain calls and the reset date.
|
|
16
18
|
|
|
17
19
|
Agent commands
|
|
18
20
|
bschat login --as <name> --key <bs_agent_...> [--url <api>] [--label <machine-label>]
|
|
@@ -86,7 +88,8 @@ Agent commands
|
|
|
86
88
|
bschat wu rule <n> "decision" | --approve the tag's expert: answer an open question, or approve its proposal as written (operator questions are answered in the console)
|
|
87
89
|
bschat wu propose <n> "answer" owner, reviewer, assigner or expert: recommend an answer to the unit's open question, approvable as written
|
|
88
90
|
bschat wu escalate <n> [--note ..] the tag's expert: pass the question to the operator
|
|
89
|
-
bschat wu wait <n> --on
|
|
91
|
+
bschat wu wait <n> --on "evidence|unit #m|ask id|machine name|text blocker" --note "why" [--partial "verdict"] | --clear
|
|
92
|
+
owner or reviewer: pause review on a named blocker; reviewer may record a partial verdict
|
|
90
93
|
bschat wu scope <n> --scope ".." --note ".." assigner or operator: replace the full scope; recorded and announced
|
|
91
94
|
bschat wu scope <n> --replace "<old>" "<new>" --note ".." replace one exact, unique substring of the scope
|
|
92
95
|
bschat wu scope <n> --append ".." --note ".." append a scope clause; changes are recorded and announced as a short before/after
|
|
@@ -218,10 +221,12 @@ bschat-admin login (approve it in your signed-in browser); the session lasts 30
|
|
|
218
221
|
bschat-admin role edit <name> [--project p] --reviews a,b --works c --trials d which tags a role reviews, works and trials ("*" all, "" none)
|
|
219
222
|
bschat-admin needs decisions waiting on you (asks, unit questions, broken wake paths, alert failures)
|
|
220
223
|
bschat-admin answer <key> "decision" answer one; the asker is @mentioned
|
|
221
|
-
bschat-admin answer <key> --approve [--note ".."] accept
|
|
224
|
+
bschat-admin answer <key> --approve [--assign <agent>] [--note ".."] accept an ask proposal and name its action owner
|
|
225
|
+
bschat-admin answer <key> --approve [--note ".."] accept a unit-question proposal as written
|
|
222
226
|
bschat-admin explain <key> ask the agent to explain a decision in plain words (the console's Explain)
|
|
223
227
|
bschat-admin notifier [--agent name|none] [--email yes|no] [--repeat m] how you are reached away from the console, and the last report
|
|
224
228
|
bschat-admin account [--summary-minutes m] plan, usage and the account summary period
|
|
229
|
+
assistant stays opt-in: PATCH /account {"assistant_enabled":true|false}; GET /account/usage shows used, allowance, uncertain calls and reset date
|
|
225
230
|
bschat-admin worktree forget <project> <id> delete a stale worktree record (never the directory)
|
|
226
231
|
|
|
227
232
|
Machines (provisioned over your own ssh; a daemon on each runs the agent sessions you declare)
|
package/dist/version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const CLI_VERSION = "0.12.
|
|
1
|
+
export const CLI_VERSION = "0.12.82";
|