benignswarm 0.12.59 → 0.12.60
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/commands/admin.js +4 -0
- package/dist/commands/watch.js +16 -0
- package/dist/help.js +1 -0
- package/dist/version.js +1 -1
- package/package.json +1 -1
package/dist/commands/admin.js
CHANGED
|
@@ -150,6 +150,10 @@ async function agent(action, rest, p, out) {
|
|
|
150
150
|
const r = await c.call("PATCH", `/projects/${proj}/agents/${name}`, { role: extra === "none" ? null : extra });
|
|
151
151
|
out.print(`agent ${name} role is now ${r.role_name ?? "(none)"}`, r);
|
|
152
152
|
}
|
|
153
|
+
else if (action === "vendor" && proj && name && extra) {
|
|
154
|
+
const r = await c.call("PATCH", `/projects/${proj}/agents/${name}`, { vendor: extra });
|
|
155
|
+
out.print(`agent ${name} is recorded as a ${r.vendor} agent`, r);
|
|
156
|
+
}
|
|
153
157
|
else if (action === "rotate-key" && proj && name) {
|
|
154
158
|
const r = await c.call("POST", `/projects/${proj}/agents/${name}/keys`, { machine: str(p.flags, "machine") ?? null });
|
|
155
159
|
out.print(`previous keys revoked. New key shown once.\nPaste this into the agent's instructions:\n\n${r.instructions}`, r);
|
package/dist/commands/watch.js
CHANGED
|
@@ -96,6 +96,10 @@ export async function watch(p, out) {
|
|
|
96
96
|
// scan on start and then hourly reports worktrees nobody is touching, which agent calls never would.
|
|
97
97
|
const scanCreds = loadAgent(name);
|
|
98
98
|
let lastScan = 0;
|
|
99
|
+
// A watcher holding a pending wake-up makes no server call, so a revoked key (the agent moved to
|
|
100
|
+
// another machine) went unnoticed: fabricbios codex-coordinator's kept running on the Mac. Check
|
|
101
|
+
// the key on its own clock.
|
|
102
|
+
let lastKeyCheck = 0;
|
|
99
103
|
const ctl = { turn: null, failedAt: 0, loggedRunning: null, pausedUntil: 0, pausedAt: 0 };
|
|
100
104
|
for (;;) {
|
|
101
105
|
if (activity && heartbeatClient)
|
|
@@ -136,6 +140,17 @@ export async function watch(p, out) {
|
|
|
136
140
|
log(`worktree scan skipped: ${e.message}`);
|
|
137
141
|
}
|
|
138
142
|
}
|
|
143
|
+
if (!once && Date.now() - lastKeyCheck > KEY_CHECK_MS) {
|
|
144
|
+
lastKeyCheck = Date.now();
|
|
145
|
+
try {
|
|
146
|
+
await Client.forAgent(loadAgent(name), undefined, { presence: false }).call("GET", "/me");
|
|
147
|
+
}
|
|
148
|
+
catch (e) {
|
|
149
|
+
if (e.code === "unauthorized")
|
|
150
|
+
stopRevokedWatcher(name, log);
|
|
151
|
+
log(`could not check this agent's key: ${e.message}`);
|
|
152
|
+
}
|
|
153
|
+
}
|
|
139
154
|
if (!full) {
|
|
140
155
|
try {
|
|
141
156
|
if (turnMode)
|
|
@@ -329,6 +344,7 @@ function stopRevokedWatcher(name, log) {
|
|
|
329
344
|
process.exit(0);
|
|
330
345
|
}
|
|
331
346
|
const TURN_RETRY_MS = 5 * 60_000;
|
|
347
|
+
const KEY_CHECK_MS = 5 * 60_000;
|
|
332
348
|
/**
|
|
333
349
|
* One poll in turn mode. While a turn runs nothing else starts: the turn's own hooks (Stop with new
|
|
334
350
|
* direct items) keep it going. The wake-up is acknowledged by the watcher once the session file
|
package/dist/help.js
CHANGED
|
@@ -172,6 +172,7 @@ bschat-admin login (approve it in your signed-in browser); the session lasts 30
|
|
|
172
172
|
bschat-admin enroll list <project>
|
|
173
173
|
bschat-admin enroll revoke <project> <token-id>
|
|
174
174
|
bschat-admin agent role <project> <name> <role|none>
|
|
175
|
+
bschat-admin agent vendor <project> <name> <harness> correct what it runs in (codex, claude-code, ...) when join recorded it wrong
|
|
175
176
|
bschat-admin agent rotate-key <project> <name> [--machine m]
|
|
176
177
|
bschat-admin agent delete <project> <name>
|
|
177
178
|
bschat-admin role create <name> [--project p] [--description d] [--broadcast] [--create-channels] [--read-account-status] [--permissions '{json}'] [--cardinality one|many]
|
package/dist/version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const CLI_VERSION = "0.12.
|
|
1
|
+
export const CLI_VERSION = "0.12.60";
|