@botbuddy/cli 1.76.0 → 1.78.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 +8 -0
- package/claude-plugin/.claude-plugin/marketplace.json +1 -1
- package/claude-plugin/bb-status/.claude-plugin/plugin.json +1 -1
- package/claude-plugin/bb-status/hooks/register.js +32 -3
- 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 +146 -1
- package/src/status-band-read.mjs +16 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 1.78.0
|
|
4
|
+
|
|
5
|
+
- `bb release-notes tags` lists the tenant's release-note tag groups: each group's rules, values, retired values and what the internal and external views show; `--json` prints the server's answer (BOT-3164). `tags group <key> [--label …] [--min n] [--max n] [--position n] [--internal-only] [--carries-version]`, `tags add|retire <group> <value>` and `tags view <group> --audience internal|external --show|--tag-only|--hide [--label …]` change them with your own sign-in (the manage scope). A refusal prints its code and changes nothing.
|
|
6
|
+
|
|
7
|
+
## 1.77.0
|
|
8
|
+
|
|
9
|
+
- The bb-status band's project row shows BB's Must + unsure progress (BOT-3259). The badge is the percent alone, for example `88%`, followed by `22 done · 3 left · 3 unsure`: done and left count Must tickets and tickets with no Must/Could milestone, and unsure counts the open ones with no milestone. Could, canceled and duplicate tickets no longer count. Each number links to the project drawer filtered to those tickets (`/kanban?card=project:<id>&progress=done|left|unsure`). The figure comes from BB (`v_project_progress`, through `get_session_status` and `get_epic_health`), so it matches the drawer exactly; against an older MCP the row keeps its previous `done/total`. bb-status plugin 1.5.0.
|
|
10
|
+
|
|
3
11
|
## 1.76.0
|
|
4
12
|
|
|
5
13
|
- A stored credential is bound to the BotBuddy server that issued it and is never sent to another (BOT-3257). Before, with `BOTBUDDY_SERVER_URL` pointing at staging, every owner-authenticated command (`bb mcp setup` included) sent the machine's production client key to staging, and a staging `bb login` overwrote the production one. Production keeps `~/.botbuddy/config.json` and the Keychain service `BOTBUDDY_CLIENT_KEY`; any other server gets `~/.botbuddy/servers/<origin>/config.json` and `BOTBUDDY_CLIENT_KEY@<origin>`. A login written before this release has no `server_origin` and counts as production-only, so it keeps working. With no login for the target server while another server's exists, a command stops before any request with `credential_origin_mismatch`, naming both origins and the `bb login` to run. The worktree session cache records `server_origin` and is never presented to another server; the default `BOTBUDDY_MCP_KEY` binding is production-only; `bb mcp setup` against another server refuses the default variable (`mcp_env_required_for_server`). `bb logout` clears only the current server's slot. Explicit credentials (a session-token flag or export, or a binding naming another variable) are unchanged.
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
"name": "bb-status",
|
|
12
12
|
"source": "./bb-status",
|
|
13
13
|
"description": "BB session status above the prompt: tickets, PRs with review counts, epic, staging, context use and active waits, for BotBuddy and Supply Guard sessions",
|
|
14
|
-
"version": "1.
|
|
14
|
+
"version": "1.5.0"
|
|
15
15
|
},
|
|
16
16
|
{
|
|
17
17
|
"name": "bb-session",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "bb-status",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.5.0",
|
|
4
4
|
"description": "BB session status above the prompt: tickets, PRs with review counts, epic, staging, context use and active waits, live only while the session is on screen.",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "BotBuddy"
|
|
@@ -131,6 +131,19 @@ function validCounts(c) {
|
|
|
131
131
|
COUNT_KEYS.reduce((n, k) => n + c[k], 0) === c.total
|
|
132
132
|
);
|
|
133
133
|
}
|
|
134
|
+
// BOT-3259: BB's Must + unsure figure; unsure is a subset of remaining.
|
|
135
|
+
const PROGRESS_KINDS = [
|
|
136
|
+
["complete", "done", "done"],
|
|
137
|
+
["remaining", "left", "left"],
|
|
138
|
+
["unsure", "unsure", "unsure"],
|
|
139
|
+
];
|
|
140
|
+
function validProgress(p) {
|
|
141
|
+
return (
|
|
142
|
+
!!p &&
|
|
143
|
+
PROGRESS_KINDS.every(([k]) => Number.isSafeInteger(p[k]) && p[k] >= 0 && p[k] <= 100000) &&
|
|
144
|
+
p.unsure <= p.remaining
|
|
145
|
+
);
|
|
146
|
+
}
|
|
134
147
|
function countsText(c) {
|
|
135
148
|
return [c.done + " done", c.in_progress + " in progress", c.blocked + " blocked", c.todo + " todo"].join(" · ");
|
|
136
149
|
}
|
|
@@ -196,7 +209,8 @@ function validSnapshot(value, harness, now) {
|
|
|
196
209
|
(value.epic.total === undefined ||
|
|
197
210
|
(Number.isSafeInteger(value.epic.total) && Number.isSafeInteger(value.epic.done) && value.epic.done >= 0 && value.epic.done <= value.epic.total)) &&
|
|
198
211
|
(value.epic.role === undefined || value.epic.role === "coordinator") &&
|
|
199
|
-
(value.epic.counts === undefined || validCounts(value.epic.counts))
|
|
212
|
+
(value.epic.counts === undefined || validCounts(value.epic.counts)) &&
|
|
213
|
+
(value.epic.progress === undefined || validProgress(value.epic.progress))
|
|
200
214
|
)) ||
|
|
201
215
|
(value.blockers !== null &&
|
|
202
216
|
!(value.tenant === "botbuddy" && Array.isArray(value.blockers) && value.blockers.length <= 100)) ||
|
|
@@ -252,6 +266,8 @@ const APP = "https://app.bot-buddy.ai";
|
|
|
252
266
|
const LINKS = {
|
|
253
267
|
ticket: (key) => APP + "/kanban?card=ticket:" + key,
|
|
254
268
|
project: (id) => APP + "/kanban?card=project:" + id,
|
|
269
|
+
// BOT-3259: the project drawer, filtered to one progress set (done|left|unsure).
|
|
270
|
+
projectProgress: (id, kind) => APP + "/kanban?card=project:" + id + "&progress=" + kind,
|
|
255
271
|
pr: (repo, n) => APP + "/kanban?card=pr:" + repo + "%23" + n,
|
|
256
272
|
// BOT-3223 AC-1: a wait badge opens that wait on BB's Waits page.
|
|
257
273
|
wait: (id) => APP + "/waits?wait=" + id,
|
|
@@ -909,7 +925,12 @@ function bandLine(el, spec, widths, right) {
|
|
|
909
925
|
if (id.label) ids.push(el.Link({ href: id.href, label: id.label }));
|
|
910
926
|
if (id.out) ids.push(el.Text({ children: [" "] }), el.Link({ href: id.out, label: "↗" }));
|
|
911
927
|
});
|
|
912
|
-
const title = [
|
|
928
|
+
const title = [];
|
|
929
|
+
// BOT-3259: the project's counts, each opening the drawer filtered to that set.
|
|
930
|
+
for (const link of spec.links || []) {
|
|
931
|
+
title.push(el.Link({ href: link.href, label: link.label }), dim(el, " · "));
|
|
932
|
+
}
|
|
933
|
+
title.push(el.Text({ wrap: "wrap", dimColor: spec.dim || undefined, children: [spec.title] }));
|
|
913
934
|
if (spec.note) title.push(dim(el, " " + spec.note));
|
|
914
935
|
const children = [
|
|
915
936
|
el.Box({ key: spec.key + "-ids", flexDirection: "row", width: widths.ids, flexShrink: 0, children: ids }),
|
|
@@ -1162,7 +1183,15 @@ function bandLines(el, $, inPane) {
|
|
|
1162
1183
|
iconSource: inked(epicIcon(s.epic.state, s.epic.percent), badgeColors(epicHex(s.epic.state)).bg),
|
|
1163
1184
|
iconAlt: "project " + s.epic.state + " " + s.epic.percent + "%",
|
|
1164
1185
|
hex: epicHex(s.epic.state),
|
|
1165
|
-
|
|
1186
|
+
// BOT-3259: with BB's Must + unsure figure the badge is the percent alone and
|
|
1187
|
+
// the counts follow as links; an older snapshot keeps its done/total.
|
|
1188
|
+
status: [
|
|
1189
|
+
{ text: s.epic.percent + "%" },
|
|
1190
|
+
...(!s.epic.progress && Number.isSafeInteger(s.epic.total) && s.epic.total > 0 ? [{ text: s.epic.done + "/" + s.epic.total, muted: true }] : []),
|
|
1191
|
+
],
|
|
1192
|
+
links: s.epic.progress
|
|
1193
|
+
? PROGRESS_KINDS.map(([k, label, kind]) => ({ label: s.epic.progress[k] + " " + label, href: LINKS.projectProgress(s.epic.id, kind) }))
|
|
1194
|
+
: [],
|
|
1166
1195
|
// BOT-3213: the project a coordinator session runs, with its tickets by state.
|
|
1167
1196
|
title: s.epic.role === "coordinator"
|
|
1168
1197
|
? "Coordinating · " + (s.epic.counts ? countsText(s.epic.counts) + " · " : "") + s.epic.name
|
|
Binary file
|
|
Binary file
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
|
-
"release_version": "1.
|
|
3
|
-
"source_commit": "
|
|
4
|
-
"source_sha256": "
|
|
2
|
+
"release_version": "1.78.0",
|
|
3
|
+
"source_commit": "d1d71be9cf32932eb09adaca324829bf643c9c3a",
|
|
4
|
+
"source_sha256": "d6e8bde1777cdcee29120aac387cf7dc0c0cfcb11495f99c1b6ec22ed457e154",
|
|
5
5
|
"target": "darwin-arm64",
|
|
6
|
-
"sha256": "
|
|
6
|
+
"sha256": "744982a2a08a8d796911eb2cb37229a6a9de5b43ab41848d2d797d31093ac3e7"
|
|
7
7
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
|
-
"release_version": "1.
|
|
3
|
-
"source_commit": "
|
|
4
|
-
"source_sha256": "
|
|
2
|
+
"release_version": "1.78.0",
|
|
3
|
+
"source_commit": "d1d71be9cf32932eb09adaca324829bf643c9c3a",
|
|
4
|
+
"source_sha256": "d6e8bde1777cdcee29120aac387cf7dc0c0cfcb11495f99c1b6ec22ed457e154",
|
|
5
5
|
"target": "linux-x64",
|
|
6
|
-
"sha256": "
|
|
6
|
+
"sha256": "fe36d3e84ca6cf34e4a718356aeb295fc86d04914c5649fc1ddd10ce45ea9ec6"
|
|
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.78.0",
|
|
4
|
+
"source_commit": "d1d71be9cf32932eb09adaca324829bf643c9c3a",
|
|
5
|
+
"source_sha256": "d6e8bde1777cdcee29120aac387cf7dc0c0cfcb11495f99c1b6ec22ed457e154",
|
|
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": "744982a2a08a8d796911eb2cb37229a6a9de5b43ab41848d2d797d31093ac3e7",
|
|
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": "fe36d3e84ca6cf34e4a718356aeb295fc86d04914c5649fc1ddd10ce45ea9ec6",
|
|
19
19
|
"mode": "0755"
|
|
20
20
|
}
|
|
21
21
|
}
|
package/package.json
CHANGED
package/src/commands.mjs
CHANGED
|
@@ -350,6 +350,8 @@ ${bold("EVIDENCE")} (${cyan("bb help evidence")})
|
|
|
350
350
|
Submit one release note for your tenant (stored as draft)
|
|
351
351
|
release-notes grants list|add|remove
|
|
352
352
|
Owners grant members the release-note submit or manage scope
|
|
353
|
+
release-notes tags [group|add|retire|view]
|
|
354
|
+
List or manage the tenant's release-note tag groups
|
|
353
355
|
release-notes keys|origins Viewer keys and allowed origins for your own app (owners)
|
|
354
356
|
status-band install Install the bb-status band into Claude Code (bb setup does it)
|
|
355
357
|
status-band read|relay The band's own reads and live wake (run by the mod)
|
package/src/release-notes.mjs
CHANGED
|
@@ -11,6 +11,10 @@ export const RELEASE_NOTES_USAGE = `Usage: bb release-notes submit <note.json> [
|
|
|
11
11
|
bb release-notes grants list [--tenant <slug>] [--json]
|
|
12
12
|
bb release-notes grants add <email> <submit|manage> [--tenant <slug>] [--json]
|
|
13
13
|
bb release-notes grants remove <email> <submit|manage> [--tenant <slug>] [--json]
|
|
14
|
+
bb release-notes tags [--json]
|
|
15
|
+
bb release-notes tags group <key> [--label <label>] [--min <n>] [--max <n>] [--position <n>] [--internal-only] [--carries-version]
|
|
16
|
+
bb release-notes tags add|retire <group> <value>
|
|
17
|
+
bb release-notes tags view <group> --audience internal|external --show|--tag-only|--hide [--label <label>]
|
|
14
18
|
|
|
15
19
|
Submits one release note for your tenant. The file is a schema-1 payload:
|
|
16
20
|
|
|
@@ -20,7 +24,8 @@ Submits one release note for your tenant. The file is a schema-1 payload:
|
|
|
20
24
|
"internal": { "title": "…", "body": "…" },
|
|
21
25
|
"external": { "title": "…", "body": "…" },
|
|
22
26
|
"internal_links": [ { "name": "PR #12", "url": "https://github.com/…", "kind": "pr" } ],
|
|
23
|
-
"external_links": [ { "name": "Open the report", "url": "/reports?tab=x", "kind": "deep_link" } ]
|
|
27
|
+
"external_links": [ { "name": "Open the report", "url": "/reports?tab=x", "kind": "deep_link" } ],
|
|
28
|
+
"tags": { "component": ["Web app"], "module": ["Reports"] } }
|
|
24
29
|
|
|
25
30
|
type is one of Feature, Improvement, Fix, Security, Deprecation, Internal.
|
|
26
31
|
external and both link lists are optional. A body uses bbrn-md-1: paragraphs,
|
|
@@ -44,6 +49,16 @@ the effective grants and the newest changes. Grants use your own sign-in
|
|
|
44
49
|
owner), member_not_in_tenant, owner_scope_is_implicit, scope_unknown,
|
|
45
50
|
entitlement_missing.
|
|
46
51
|
|
|
52
|
+
Tags. Each tenant manages its own tag groups (Component and Module to start,
|
|
53
|
+
plus any it adds, such as Customer). tags lists each group's values, retired
|
|
54
|
+
values and what the internal and external views show; read it before you
|
|
55
|
+
submit. A note may carry only listed values: tag_group_unknown,
|
|
56
|
+
tag_value_unknown (the message lists the allowed values) and tag_count_invalid
|
|
57
|
+
store nothing. group, add, retire and view need the manage scope and use your
|
|
58
|
+
own sign-in. A value is retired, never deleted: notes that carry it keep it.
|
|
59
|
+
--internal-only marks a group that is never shown externally (one-way).
|
|
60
|
+
view --show shows the tag and its filter, --tag-only the tag, --hide neither.
|
|
61
|
+
|
|
47
62
|
Exit codes: 0 stored · 1 refused · 2 usage · 3 authentication · 5 BotBuddy unreachable.
|
|
48
63
|
|
|
49
64
|
Viewer keys and origins (tenant owners, BOT-3158):
|
|
@@ -63,6 +78,7 @@ export async function cmdReleaseNotes(args, {
|
|
|
63
78
|
return args.length === 0 ? 2 : CALL_EXIT.OK;
|
|
64
79
|
}
|
|
65
80
|
if (args[0] === "grants") return cmdGrants(args.slice(1), { resolveAuth, call, log, errorLog });
|
|
81
|
+
if (args[0] === "tags") return cmdTags(args.slice(1), { resolveAuth, call, log, errorLog });
|
|
66
82
|
// BOT-3158: viewer keys and allowed origins.
|
|
67
83
|
if (args[0] === "keys") return await cmdReleaseNotesKeys(args.slice(1), { resolveAuth, call, log, errorLog });
|
|
68
84
|
if (args[0] === "origins") return await cmdReleaseNotesOrigins(args.slice(1), { resolveAuth, call, log, errorLog });
|
|
@@ -213,3 +229,132 @@ async function cmdGrants(argv, { resolveAuth, call, log, errorLog }) {
|
|
|
213
229
|
}
|
|
214
230
|
return CALL_EXIT.OK;
|
|
215
231
|
}
|
|
232
|
+
|
|
233
|
+
// ── BOT-3164: bb release-notes tags [list] | group | add | retire | view ──
|
|
234
|
+
|
|
235
|
+
const TAG_TOOLS = {
|
|
236
|
+
list: "list_release_note_tags",
|
|
237
|
+
group: "save_release_note_tag_group",
|
|
238
|
+
add: "save_release_note_tag_value",
|
|
239
|
+
retire: "retire_release_note_tag_value",
|
|
240
|
+
view: "set_release_note_view_config",
|
|
241
|
+
};
|
|
242
|
+
|
|
243
|
+
function tagUsage(errorLog) {
|
|
244
|
+
errorLog(RELEASE_NOTES_USAGE);
|
|
245
|
+
return 2;
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
/** Parse `tags …` into { tool, args } or null for a usage error. Values are sent as typed; the server validates. */
|
|
249
|
+
export function parseTagsArgs(argv) {
|
|
250
|
+
const positional = [];
|
|
251
|
+
const flags = {};
|
|
252
|
+
const BOOL = new Set(["--internal-only", "--carries-version", "--show", "--tag-only", "--hide", "--json"]);
|
|
253
|
+
const VALUED = new Set(["--label", "--min", "--max", "--position", "--audience", "--tenant"]);
|
|
254
|
+
for (let i = 0; i < argv.length; i++) {
|
|
255
|
+
const a = argv[i];
|
|
256
|
+
if (BOOL.has(a)) { flags[a] = true; continue; }
|
|
257
|
+
if (VALUED.has(a)) {
|
|
258
|
+
const v = argv[i + 1];
|
|
259
|
+
if (v === undefined || v.startsWith("--")) return null;
|
|
260
|
+
flags[a] = v;
|
|
261
|
+
i++;
|
|
262
|
+
continue;
|
|
263
|
+
}
|
|
264
|
+
if (a.startsWith("--")) return null;
|
|
265
|
+
positional.push(a);
|
|
266
|
+
}
|
|
267
|
+
const [sub = "list", ...rest] = positional;
|
|
268
|
+
const tool = TAG_TOOLS[sub];
|
|
269
|
+
if (!tool) return null;
|
|
270
|
+
const json = flags["--json"] === true;
|
|
271
|
+
const tenant = flags["--tenant"] ?? null;
|
|
272
|
+
const int = (flag) => {
|
|
273
|
+
if (flags[flag] === undefined) return undefined;
|
|
274
|
+
return /^\d+$/.test(flags[flag]) ? Number(flags[flag]) : NaN;
|
|
275
|
+
};
|
|
276
|
+
if (sub === "list") return rest.length === 0 ? { sub, tool, args: {}, json, tenant } : null;
|
|
277
|
+
if (sub === "add" || sub === "retire") {
|
|
278
|
+
if (rest.length !== 2) return null;
|
|
279
|
+
return { sub, tool, args: { group: rest[0], value: rest[1] }, json, tenant };
|
|
280
|
+
}
|
|
281
|
+
if (sub === "group") {
|
|
282
|
+
if (rest.length !== 1) return null;
|
|
283
|
+
const args = { key: rest[0] };
|
|
284
|
+
if (flags["--label"] !== undefined) args.label = flags["--label"];
|
|
285
|
+
for (const [flag, field] of [["--min", "min_values"], ["--max", "max_values"], ["--position", "position"]]) {
|
|
286
|
+
const n = int(flag);
|
|
287
|
+
if (Number.isNaN(n)) return null;
|
|
288
|
+
if (n !== undefined) args[field] = n;
|
|
289
|
+
}
|
|
290
|
+
if (flags["--internal-only"]) args.internal_only = true;
|
|
291
|
+
if (flags["--carries-version"]) args.carries_version = true;
|
|
292
|
+
return { sub, tool, args, json, tenant };
|
|
293
|
+
}
|
|
294
|
+
// view
|
|
295
|
+
if (rest.length !== 1) return null;
|
|
296
|
+
const audience = flags["--audience"];
|
|
297
|
+
if (audience !== "internal" && audience !== "external") return null;
|
|
298
|
+
const modes = ["--show", "--tag-only", "--hide"].filter((f) => flags[f]);
|
|
299
|
+
if (modes.length > 1 || (modes.length === 0 && flags["--label"] === undefined)) return null;
|
|
300
|
+
const args = { group: rest[0], audience };
|
|
301
|
+
if (modes[0] === "--show") Object.assign(args, { show_tag: true, show_filter: true });
|
|
302
|
+
if (modes[0] === "--tag-only") Object.assign(args, { show_tag: true, show_filter: false });
|
|
303
|
+
if (modes[0] === "--hide") Object.assign(args, { show_tag: false, show_filter: false });
|
|
304
|
+
if (flags["--label"] !== undefined) args.label = flags["--label"];
|
|
305
|
+
return { sub, tool, args, json, tenant };
|
|
306
|
+
}
|
|
307
|
+
|
|
308
|
+
function describeView(v) {
|
|
309
|
+
if (!v || !v.show_tag) return "hidden";
|
|
310
|
+
return `${v.show_filter ? "tag + filter" : "tag only"}${v.label ? ` as "${v.label}"` : ""}`;
|
|
311
|
+
}
|
|
312
|
+
|
|
313
|
+
async function cmdTags(argv, { resolveAuth, call, log, errorLog }) {
|
|
314
|
+
const parsed = parseTagsArgs(argv);
|
|
315
|
+
if (!parsed) return tagUsage(errorLog);
|
|
316
|
+
const { sub, tool, args, json, tenant } = parsed;
|
|
317
|
+
const isChange = sub !== "list";
|
|
318
|
+
let result;
|
|
319
|
+
try {
|
|
320
|
+
// A vocabulary change is a change manager's decision: their own sign-in, like grants.
|
|
321
|
+
const resolved = await resolveAuth({ toolName: tool, preferSession: !isChange });
|
|
322
|
+
result = resolved?.error || !resolved?.auth
|
|
323
|
+
? { ok: false, auth: true }
|
|
324
|
+
: await call(tool, args, { auth: resolved.auth, tenant, signal: AbortSignal.timeout(30_000) });
|
|
325
|
+
} catch {
|
|
326
|
+
result = { ok: false, status: null };
|
|
327
|
+
}
|
|
328
|
+
const data = result?.data;
|
|
329
|
+
if (!(result?.ok && data?.ok === true)) return printRefusalOrFailure(result, json, log, errorLog, isChange ? "Nothing was changed." : "");
|
|
330
|
+
if (json) {
|
|
331
|
+
log(JSON.stringify(data));
|
|
332
|
+
return CALL_EXIT.OK;
|
|
333
|
+
}
|
|
334
|
+
const where = `in tenant ${data.tenant}`;
|
|
335
|
+
if (sub === "add") {
|
|
336
|
+
log(data.changed ? `${data.restored ? "Restored" : "Added"} ${data.value} to ${data.group} ${where}.` : `${data.group} already has ${data.value} ${where}; nothing changed.`);
|
|
337
|
+
} else if (sub === "retire") {
|
|
338
|
+
log(data.changed
|
|
339
|
+
? `Retired ${data.value} from ${data.group} ${where}. Notes that carry it keep it; new notes cannot use it.`
|
|
340
|
+
: `${data.value} was already retired from ${data.group} ${where}; nothing changed.`);
|
|
341
|
+
} else if (sub === "group") {
|
|
342
|
+
const g = data.group ?? {};
|
|
343
|
+
log(data.created ? `Created tag group ${g.key} (${g.label}) ${where}.` : data.changed ? `Updated tag group ${g.key} ${where}.` : `Tag group ${g.key} is unchanged ${where}.`);
|
|
344
|
+
} else if (sub === "view") {
|
|
345
|
+
log(data.changed ? `${data.group}, ${data.audience} view: ${describeView(data.view)} ${where}.` : `${data.group}, ${data.audience} view is unchanged ${where}.`);
|
|
346
|
+
} else {
|
|
347
|
+
const groups = Array.isArray(data.groups) ? data.groups : [];
|
|
348
|
+
log(`Release-note tags in tenant ${data.tenant}`);
|
|
349
|
+
if (groups.length === 0) log("No tag groups.");
|
|
350
|
+
for (const g of groups) {
|
|
351
|
+
const count = g.min_values === g.max_values ? `exactly ${g.min_values}` : `${g.min_values}-${g.max_values}`;
|
|
352
|
+
const marks = [g.carries_version ? "carries the version" : null, g.internal_only ? "internal only" : null].filter(Boolean);
|
|
353
|
+
log(`${g.key} (${g.label}) · ${count} per note${marks.length ? ` · ${marks.join(" · ")}` : ""}`);
|
|
354
|
+
log(` values: ${Array.isArray(g.values) && g.values.length ? g.values.join(", ") : "none"}`);
|
|
355
|
+
if (Array.isArray(g.retired) && g.retired.length) log(` retired: ${g.retired.join(", ")}`);
|
|
356
|
+
log(` internal: ${describeView(g.views?.internal)} · external: ${describeView(g.views?.external)}`);
|
|
357
|
+
}
|
|
358
|
+
}
|
|
359
|
+
return CALL_EXIT.OK;
|
|
360
|
+
}
|
package/src/status-band-read.mjs
CHANGED
|
@@ -6,6 +6,19 @@ import { promisify } from "node:util";
|
|
|
6
6
|
import { join } from "node:path";
|
|
7
7
|
import { homedir } from "node:os";
|
|
8
8
|
import { findAgentStateRoot } from "./agent-state.mjs";
|
|
9
|
+
// BOT-3259: BB's one project figure (v_project_progress): Must + unsure members
|
|
10
|
+
// only, complete / remaining / unsure, with BB's percent. Null unless all four
|
|
11
|
+
// are sane, so an older MCP keeps the legacy done/total.
|
|
12
|
+
function mustUnsureProgress(src) {
|
|
13
|
+
const n = (v) => (Number.isSafeInteger(v) && v >= 0 ? v : null);
|
|
14
|
+
const c = n(src?.progress_complete);
|
|
15
|
+
const r = n(src?.progress_remaining);
|
|
16
|
+
const u = n(src?.progress_unsure);
|
|
17
|
+
const p = n(src?.progress_percent);
|
|
18
|
+
if (c === null || r === null || u === null || p === null || p > 100 || u > r) return null;
|
|
19
|
+
return { progress: { complete: c, remaining: r, unsure: u }, done: c, total: c + r, percent: p };
|
|
20
|
+
}
|
|
21
|
+
|
|
9
22
|
const execFileAsync = promisify(execFile);
|
|
10
23
|
const UUID =
|
|
11
24
|
/^[0-9a-f]{8}-[0-9a-f]{4}-[1-8][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i;
|
|
@@ -498,6 +511,8 @@ export async function readStatus({
|
|
|
498
511
|
}
|
|
499
512
|
if (!epic.identifier && PROJECT_IDENTIFIER.test(coordinator.identifier || "")) epic.identifier = coordinator.identifier;
|
|
500
513
|
}
|
|
514
|
+
// BOT-3259: BB's Must + unsure figure wins over every older count.
|
|
515
|
+
Object.assign(epic, mustUnsureProgress(se) || {});
|
|
501
516
|
}
|
|
502
517
|
if (owner) {
|
|
503
518
|
const total = Math.max(0, (owner.children_total ?? 0) - (owner.children_canceled ?? 0));
|
|
@@ -515,6 +530,7 @@ export async function readStatus({
|
|
|
515
530
|
done,
|
|
516
531
|
total,
|
|
517
532
|
percent: total ? Math.round((100 * done) / total) : 0,
|
|
533
|
+
...(mustUnsureProgress(owner) || {}),
|
|
518
534
|
};
|
|
519
535
|
}
|
|
520
536
|
// A bootstrap/session switch during either network request invalidates this snapshot.
|