@botbuddy/cli 1.73.7 → 1.74.0
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/CHANGELOG.md +4 -0
- package/daemon/bin/darwin-arm64/botbuddy-daemon +0 -0
- package/daemon/bin/linux-x64/botbuddy-daemon +0 -0
- package/daemon-release/darwin-arm64.json +4 -4
- package/daemon-release/linux-x64.json +4 -4
- package/daemon-release/manifest.json +5 -5
- package/package.json +1 -1
- package/src/commands.mjs +2 -0
- package/src/release-notes.mjs +106 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 1.74.0
|
|
4
|
+
|
|
5
|
+
- `bb release-notes grants list|add|remove` (BOT-3160). A tenant owner names who may submit or manage release notes: `grants add <email> <submit|manage>` grants one scope to one member of the tenant, `grants remove` revokes it, and `grants list` prints the owners (who manage implicitly), the effective grants and the newest changes. The commands use your own sign-in (`bb login`), never the agent session, and take `--tenant <slug>` and `--json`. A refusal names its code (`scope_missing`, `member_not_in_tenant`, `owner_scope_is_implicit`, `scope_unknown`, `entitlement_missing`) and changes nothing; repeating a grant or a revoke changes nothing twice.
|
|
6
|
+
|
|
3
7
|
## 1.73.7
|
|
4
8
|
|
|
5
9
|
- `bb stack run` says why a stack failed to provision and whose fault it was (BOT-3238). When the serving host rolls a provision back, the receipt now carries a typed `code` (`STACK_SCHEMA_FAILED` or `STACK_PROVISION_FAILED`, where before it was `null`), the lease's `reap_reason`, a `failure_kind` (`schema` or `platform`) and, when the host sent it, `provision_failure: { stage, sqlstate, migration }`. One stderr line names the cause. When Postgres rejects your own migrations or seed (a schema-stage failure with a SQLSTATE that is not a resource, connection or server condition), the run is recorded as a `script` failure and no platform feedback is offered, because retrying or moving host fails the same way. A lease that failed with no recorded reason says `reason_unavailable: true`. The exit code (6) is unchanged.
|
|
Binary file
|
|
Binary file
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
|
-
"release_version": "1.
|
|
3
|
-
"source_commit": "
|
|
4
|
-
"source_sha256": "
|
|
2
|
+
"release_version": "1.74.0",
|
|
3
|
+
"source_commit": "07346042a7617efbf032661a79bae0528e4ae2f4",
|
|
4
|
+
"source_sha256": "53d3c62c6e011b65b455d7d37dd2a10445e4555e1a48ea92faaa33f9db601440",
|
|
5
5
|
"target": "darwin-arm64",
|
|
6
|
-
"sha256": "
|
|
6
|
+
"sha256": "bb0942d5d7a8a247dcbe9ab733bfe38fa40e6e72f5f2432038cb473d6c85338b"
|
|
7
7
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
|
-
"release_version": "1.
|
|
3
|
-
"source_commit": "
|
|
4
|
-
"source_sha256": "
|
|
2
|
+
"release_version": "1.74.0",
|
|
3
|
+
"source_commit": "07346042a7617efbf032661a79bae0528e4ae2f4",
|
|
4
|
+
"source_sha256": "53d3c62c6e011b65b455d7d37dd2a10445e4555e1a48ea92faaa33f9db601440",
|
|
5
5
|
"target": "linux-x64",
|
|
6
|
-
"sha256": "
|
|
6
|
+
"sha256": "bccb77188742510964be176335390f4c3da231aee6cfb52bcf1cb3dd190f7a11"
|
|
7
7
|
}
|
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
{
|
|
2
2
|
"schema_version": 1,
|
|
3
|
-
"release_version": "1.
|
|
4
|
-
"source_commit": "
|
|
5
|
-
"source_sha256": "
|
|
3
|
+
"release_version": "1.74.0",
|
|
4
|
+
"source_commit": "07346042a7617efbf032661a79bae0528e4ae2f4",
|
|
5
|
+
"source_sha256": "53d3c62c6e011b65b455d7d37dd2a10445e4555e1a48ea92faaa33f9db601440",
|
|
6
6
|
"targets": {
|
|
7
7
|
"darwin-arm64": {
|
|
8
8
|
"goos": "darwin",
|
|
9
9
|
"goarch": "arm64",
|
|
10
10
|
"binary": "daemon/bin/darwin-arm64/botbuddy-daemon",
|
|
11
|
-
"sha256": "
|
|
11
|
+
"sha256": "bb0942d5d7a8a247dcbe9ab733bfe38fa40e6e72f5f2432038cb473d6c85338b",
|
|
12
12
|
"mode": "0755"
|
|
13
13
|
},
|
|
14
14
|
"linux-x64": {
|
|
15
15
|
"goos": "linux",
|
|
16
16
|
"goarch": "amd64",
|
|
17
17
|
"binary": "daemon/bin/linux-x64/botbuddy-daemon",
|
|
18
|
-
"sha256": "
|
|
18
|
+
"sha256": "bccb77188742510964be176335390f4c3da231aee6cfb52bcf1cb3dd190f7a11",
|
|
19
19
|
"mode": "0755"
|
|
20
20
|
}
|
|
21
21
|
}
|
package/package.json
CHANGED
package/src/commands.mjs
CHANGED
|
@@ -348,6 +348,8 @@ ${bold("EVIDENCE")} (${cyan("bb help evidence")})
|
|
|
348
348
|
Prepare or send a BotBuddy issue report
|
|
349
349
|
release-notes submit <note.json>
|
|
350
350
|
Submit one release note for your tenant (stored as draft)
|
|
351
|
+
release-notes grants list|add|remove
|
|
352
|
+
Owners grant members the release-note submit or manage scope
|
|
351
353
|
status-band install Install the bb-status band into Claude Code (bb setup does it)
|
|
352
354
|
status-band read|relay The band's own reads and live wake (run by the mod)
|
|
353
355
|
evidence require <file> Record an exact-head evidence disposition → botbuddy/ready
|
package/src/release-notes.mjs
CHANGED
|
@@ -7,6 +7,9 @@ import { readFile } from "node:fs/promises";
|
|
|
7
7
|
import { CALL_EXIT, callToolJson, resolveCallAuth } from "./api.mjs";
|
|
8
8
|
|
|
9
9
|
export const RELEASE_NOTES_USAGE = `Usage: bb release-notes submit <note.json> [--json]
|
|
10
|
+
bb release-notes grants list [--tenant <slug>] [--json]
|
|
11
|
+
bb release-notes grants add <email> <submit|manage> [--tenant <slug>] [--json]
|
|
12
|
+
bb release-notes grants remove <email> <submit|manage> [--tenant <slug>] [--json]
|
|
10
13
|
|
|
11
14
|
Submits one release note for your tenant. The file is a schema-1 payload:
|
|
12
15
|
|
|
@@ -30,6 +33,16 @@ An unchanged resubmit (a retry) adds none. A refusal names its code
|
|
|
30
33
|
(schema_invalid, type_unknown, markup_refused, link_refused,
|
|
31
34
|
entitlement_missing) and stores nothing.
|
|
32
35
|
|
|
36
|
+
Scopes. Every member and agent key of the tenant reads. Agent keys submit
|
|
37
|
+
unless their scope list is read-only. Tenant owners manage (and submit)
|
|
38
|
+
implicitly; a member submits or manages only when an owner grants it:
|
|
39
|
+
grants add names one member of your tenant and one scope (submit, or manage,
|
|
40
|
+
which includes submit); grants remove revokes it; grants list shows owners,
|
|
41
|
+
the effective grants and the newest changes. Grants use your own sign-in
|
|
42
|
+
(bb login), never the agent session. Refusals: scope_missing (you are not an
|
|
43
|
+
owner), member_not_in_tenant, owner_scope_is_implicit, scope_unknown,
|
|
44
|
+
entitlement_missing.
|
|
45
|
+
|
|
33
46
|
Exit codes: 0 stored · 1 refused · 2 usage · 3 authentication · 5 BotBuddy unreachable.`;
|
|
34
47
|
|
|
35
48
|
const TOOL = "submit_release_note";
|
|
@@ -45,6 +58,7 @@ export async function cmdReleaseNotes(args, {
|
|
|
45
58
|
(args.length === 0 ? errorLog : log)(RELEASE_NOTES_USAGE);
|
|
46
59
|
return args.length === 0 ? 2 : CALL_EXIT.OK;
|
|
47
60
|
}
|
|
61
|
+
if (args[0] === "grants") return cmdGrants(args.slice(1), { resolveAuth, call, log, errorLog });
|
|
48
62
|
const json = args.includes("--json");
|
|
49
63
|
const rest = args.filter((a) => a !== "--json");
|
|
50
64
|
if (rest[0] !== "submit" || rest.length !== 2 || !rest[1] || rest[1].startsWith("-")) {
|
|
@@ -100,3 +114,95 @@ export async function cmdReleaseNotes(args, {
|
|
|
100
114
|
errorLog("✗ BotBuddy did not confirm the submit. Retry the same command; an unchanged resubmit adds no revision.");
|
|
101
115
|
return CALL_EXIT.ERROR;
|
|
102
116
|
}
|
|
117
|
+
|
|
118
|
+
// ── BOT-3160: bb release-notes grants list|add|remove ─────────────────
|
|
119
|
+
|
|
120
|
+
const GRANT_TOOLS = { add: "grant_release_note_scope", remove: "revoke_release_note_scope", list: "list_release_note_scope_grants" };
|
|
121
|
+
|
|
122
|
+
function printRefusalOrFailure(result, json, log, errorLog, nothing) {
|
|
123
|
+
const data = result?.data;
|
|
124
|
+
if (result?.ok && data?.ok === false && typeof data.error === "string") {
|
|
125
|
+
const refusal = { ok: false, error: data.error, ...(data.field ? { field: data.field } : {}), message: data.message ?? null };
|
|
126
|
+
if (json) log(JSON.stringify(refusal));
|
|
127
|
+
errorLog(`✗ ${refusal.error}${refusal.field ? ` (${refusal.field})` : ""}: ${refusal.message ?? nothing}`);
|
|
128
|
+
return CALL_EXIT.ERROR;
|
|
129
|
+
}
|
|
130
|
+
if (result?.auth) {
|
|
131
|
+
if (json) log(JSON.stringify({ ok: false, error: "authentication_failed" }));
|
|
132
|
+
errorLog(`✗ BotBuddy could not authenticate this command. Sign in with bb login, then retry. ${nothing}`);
|
|
133
|
+
return CALL_EXIT.AUTH;
|
|
134
|
+
}
|
|
135
|
+
if (!result?.ok && result?.status == null) {
|
|
136
|
+
if (json) log(JSON.stringify({ ok: false, error: "transport_unavailable" }));
|
|
137
|
+
errorLog(`✗ BotBuddy is unreachable. Retry the same command. ${nothing}`);
|
|
138
|
+
return CALL_EXIT.TRANSPORT;
|
|
139
|
+
}
|
|
140
|
+
if (json) log(JSON.stringify({ ok: false, error: "receipt_unavailable" }));
|
|
141
|
+
errorLog(`✗ BotBuddy did not confirm the command. Retry it; repeating a grant or revoke changes nothing twice.`);
|
|
142
|
+
return CALL_EXIT.ERROR;
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
async function cmdGrants(argv, { resolveAuth, call, log, errorLog }) {
|
|
146
|
+
const json = argv.includes("--json");
|
|
147
|
+
let tenant = null;
|
|
148
|
+
const rest = [];
|
|
149
|
+
for (let i = 0; i < argv.length; i++) {
|
|
150
|
+
const a = argv[i];
|
|
151
|
+
if (a === "--json") continue;
|
|
152
|
+
if (a === "--tenant") {
|
|
153
|
+
const v = argv[i + 1];
|
|
154
|
+
if (!v || v.startsWith("-")) { errorLog(RELEASE_NOTES_USAGE); return 2; }
|
|
155
|
+
tenant = v;
|
|
156
|
+
i++;
|
|
157
|
+
continue;
|
|
158
|
+
}
|
|
159
|
+
rest.push(a);
|
|
160
|
+
}
|
|
161
|
+
const [sub, email, scope, ...extra] = rest;
|
|
162
|
+
const tool = GRANT_TOOLS[sub];
|
|
163
|
+
const isChange = sub === "add" || sub === "remove";
|
|
164
|
+
if (!tool || extra.length > 0 || (sub === "list" && email !== undefined) || (isChange && (!email || !scope || email.startsWith("-") || scope.startsWith("-")))) {
|
|
165
|
+
errorLog(RELEASE_NOTES_USAGE);
|
|
166
|
+
return 2;
|
|
167
|
+
}
|
|
168
|
+
const args = isChange ? { member_email: email, scope } : {};
|
|
169
|
+
|
|
170
|
+
let result;
|
|
171
|
+
try {
|
|
172
|
+
const resolved = await resolveAuth({ toolName: tool, preferSession: false });
|
|
173
|
+
result = resolved?.error || !resolved?.auth
|
|
174
|
+
? { ok: false, auth: true }
|
|
175
|
+
: await call(tool, args, { auth: resolved.auth, tenant, signal: AbortSignal.timeout(30_000) });
|
|
176
|
+
} catch {
|
|
177
|
+
result = { ok: false, status: null };
|
|
178
|
+
}
|
|
179
|
+
const data = result?.data;
|
|
180
|
+
if (!(result?.ok && data?.ok === true)) return printRefusalOrFailure(result, json, log, errorLog, isChange ? "Nothing was changed." : "");
|
|
181
|
+
|
|
182
|
+
if (json) {
|
|
183
|
+
log(JSON.stringify(data));
|
|
184
|
+
return CALL_EXIT.OK;
|
|
185
|
+
}
|
|
186
|
+
if (isChange) {
|
|
187
|
+
const where = `in tenant ${data.tenant}`;
|
|
188
|
+
if (sub === "add") log(data.changed ? `Granted ${data.scope} to ${data.member_email} ${where}.` : `${data.member_email} already holds ${data.scope} ${where}; nothing changed.`);
|
|
189
|
+
else log(data.changed ? `Revoked ${data.scope} from ${data.member_email} ${where}.` : `${data.member_email} does not hold ${data.scope} ${where}; nothing changed.`);
|
|
190
|
+
return CALL_EXIT.OK;
|
|
191
|
+
}
|
|
192
|
+
const owners = Array.isArray(data.owners) ? data.owners : [];
|
|
193
|
+
const effective = Array.isArray(data.effective) ? data.effective : [];
|
|
194
|
+
const rows = Array.isArray(data.rows) ? data.rows : [];
|
|
195
|
+
log(`Release-note scopes in tenant ${data.tenant}`);
|
|
196
|
+
log(`Owners (manage implicitly): ${owners.length ? owners.join(", ") : "none"}`);
|
|
197
|
+
if (effective.length === 0) log("Grants: none");
|
|
198
|
+
else {
|
|
199
|
+
log("Grants:");
|
|
200
|
+
for (const g of effective) log(` ${g.member_email} ${g.scope}`);
|
|
201
|
+
}
|
|
202
|
+
if (rows.length === 0) log("Recent changes: none");
|
|
203
|
+
else {
|
|
204
|
+
log("Recent changes:");
|
|
205
|
+
for (const r of rows) log(` ${r.created_at} ${r.action} ${r.scope} ${r.member_email ?? r.member_user_id} by ${r.granted_by_email ?? r.granted_by}`);
|
|
206
|
+
}
|
|
207
|
+
return CALL_EXIT.OK;
|
|
208
|
+
}
|