@botbuddy/cli 1.84.0 → 1.85.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 CHANGED
@@ -1,5 +1,9 @@
1
1
  # Changelog
2
2
 
3
+ ## 1.85.0
4
+
5
+ - `bb release-notes digest --release <version> --voice internal|external` prints one production release's notes as Markdown, JSON (the bbrn-digest-1 schema) or Slack Block Kit (`--format`), byte for byte as the API returns them when piped, so a GitHub Actions step can post it to your own Slack or email (BOT-3204). On a terminal, control characters in a note print as visible escapes. `--repository owner/name` names the repository when a version exists in more than one; `--json` prints the whole answer.
6
+
3
7
  ## 1.84.0
4
8
 
5
9
  - `bb wait` tells the staging suspect to act (BOT-3287): a wait ended because you were elected release manager says your change may have broken staging and to fix staging as a priority; a `staging-release` wake on a red train for the suspect PR says to call `claim_release_manager` now (seat open) or names the release manager (seat held); a wake with `reason: cancelled` says the run did not release your PR and how to re-arm with `after_run=<run_id>`.
@@ -1,7 +1,7 @@
1
1
  {
2
- "release_version": "1.84.0",
3
- "source_commit": "4122a36c869b9a83a460f5a22f35b893a4a72afc",
4
- "source_sha256": "b86a6b6fa46c92581ae1325ad301176dc3267137c3426c82a21a0b33c2bcca69",
2
+ "release_version": "1.85.0",
3
+ "source_commit": "0597756faf47e986dc7c147b0f8fee8e77db06b4",
4
+ "source_sha256": "fe01dfc7bc60fb96051df54fbb1b690f7a8c535b271f39d46579c808015dd9ba",
5
5
  "target": "darwin-arm64",
6
- "sha256": "c19990b17a4a41f4fffe010584a544fa87ba597dd8b17f9f7efea98bb4f8fa3a"
6
+ "sha256": "10d2ac05c6c9f1637a5beffc2709abf02ccd980b6ca714cf5970437abec74771"
7
7
  }
@@ -1,7 +1,7 @@
1
1
  {
2
- "release_version": "1.84.0",
3
- "source_commit": "4122a36c869b9a83a460f5a22f35b893a4a72afc",
4
- "source_sha256": "b86a6b6fa46c92581ae1325ad301176dc3267137c3426c82a21a0b33c2bcca69",
2
+ "release_version": "1.85.0",
3
+ "source_commit": "0597756faf47e986dc7c147b0f8fee8e77db06b4",
4
+ "source_sha256": "fe01dfc7bc60fb96051df54fbb1b690f7a8c535b271f39d46579c808015dd9ba",
5
5
  "target": "linux-x64",
6
- "sha256": "f6d5ad986be0d473fea2bed4eb9ca5dcedc450b11ae0e0d798ea41f7bfe3d8bc"
6
+ "sha256": "292c775e27a87b030dc719dc24b8d43a7859210cc216e3ff77c1959d3edc75bc"
7
7
  }
@@ -1,21 +1,21 @@
1
1
  {
2
2
  "schema_version": 1,
3
- "release_version": "1.84.0",
4
- "source_commit": "4122a36c869b9a83a460f5a22f35b893a4a72afc",
5
- "source_sha256": "b86a6b6fa46c92581ae1325ad301176dc3267137c3426c82a21a0b33c2bcca69",
3
+ "release_version": "1.85.0",
4
+ "source_commit": "0597756faf47e986dc7c147b0f8fee8e77db06b4",
5
+ "source_sha256": "fe01dfc7bc60fb96051df54fbb1b690f7a8c535b271f39d46579c808015dd9ba",
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": "c19990b17a4a41f4fffe010584a544fa87ba597dd8b17f9f7efea98bb4f8fa3a",
11
+ "sha256": "10d2ac05c6c9f1637a5beffc2709abf02ccd980b6ca714cf5970437abec74771",
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": "f6d5ad986be0d473fea2bed4eb9ca5dcedc450b11ae0e0d798ea41f7bfe3d8bc",
18
+ "sha256": "292c775e27a87b030dc719dc24b8d43a7859210cc216e3ff77c1959d3edc75bc",
19
19
  "mode": "0755"
20
20
  }
21
21
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@botbuddy/cli",
3
- "version": "1.84.0",
3
+ "version": "1.85.0",
4
4
  "description": "BotBuddy — Swarm coordination CLI for multi-agent workflows",
5
5
  "type": "module",
6
6
  "bin": {
package/src/commands.mjs CHANGED
@@ -353,6 +353,8 @@ ${bold("EVIDENCE")} (${cyan("bb help evidence")})
353
353
  Publish a note to your team, or its external wording to customers
354
354
  release-notes withdraw <source_key>
355
355
  Take a note out of every feed (kept, never deleted)
356
+ release-notes digest --release <v> --voice internal|external
357
+ Print one release's notes as Markdown, JSON or Slack Block Kit
356
358
  release-notes grants list|add|remove
357
359
  Owners grant members the release-note submit or manage scope
358
360
  release-notes tags [group|add|retire|view]
@@ -12,6 +12,7 @@ export const RELEASE_NOTES_USAGE = `Usage: bb release-notes submit <note.json> [
12
12
  bb release-notes withdraw <source_key> [--tenant <slug>] [--json]
13
13
  bb release-notes list [--tag <group>=<value>]... [--type <type>] [--state <state>] [--cursor <cursor>] [--json]
14
14
  bb release-notes get <source_key> [--json]
15
+ bb release-notes digest --release <version> --voice internal|external [--format markdown|json|slack] [--repository owner/name] [--json]
15
16
  bb release-notes grants list [--tenant <slug>] [--json]
16
17
  bb release-notes grants add <email> <submit|manage> [--tenant <slug>] [--json]
17
18
  bb release-notes grants remove <email> <submit|manage> [--tenant <slug>] [--json]
@@ -101,6 +102,18 @@ own sign-in. A value is retired, never deleted: notes that carry it keep it.
101
102
  --internal-only marks a group that is never shown externally (one-way).
102
103
  view --show shows the tag and its filter, --tag-only the tag, --hide neither.
103
104
 
105
+ Digest (BOT-3204). digest prints one production release's notes, exactly as
106
+ the API returns them (byte for byte when piped; on a terminal, control
107
+ characters print as visible escapes): markdown, json (the bbrn-digest-1
108
+ schema) or slack ({"messages": [...]}: each message is a Block Kit payload for
109
+ your own incoming webhook; BotBuddy posts nothing). voice internal is your
110
+ team's wording with source keys and pull requests; voice external holds only
111
+ published external wording and never falls back to internal text. A release
112
+ with no notes prints an explicit empty digest. --json prints the whole answer
113
+ (tenant, version, note_count, content_type, body). Refusals: release_unknown,
114
+ repository_required, release_not_shipped, no_previous_release,
115
+ release_range_unavailable, entitlement_missing, scope_missing.
116
+
104
117
  Exit codes: 0 stored or read · 1 refused or not found · 2 usage · 3 authentication · 5 BotBuddy unreachable.
105
118
 
106
119
  Viewer keys and origins (tenant owners, BOT-3158):
@@ -114,6 +127,8 @@ export async function cmdReleaseNotes(args, {
114
127
  call = callToolJson,
115
128
  log = console.log,
116
129
  errorLog = console.error,
130
+ write = (text) => process.stdout.write(text),
131
+ isTTY = process.stdout.isTTY === true,
117
132
  } = {}) {
118
133
  if (args.length === 0 || ["help", "--help", "-h"].includes(args[0])) {
119
134
  (args.length === 0 ? errorLog : log)(RELEASE_NOTES_USAGE);
@@ -128,6 +143,8 @@ export async function cmdReleaseNotes(args, {
128
143
  // BOT-3158: viewer keys and allowed origins.
129
144
  if (args[0] === "keys") return await cmdReleaseNotesKeys(args.slice(1), { resolveAuth, call, log, errorLog });
130
145
  if (args[0] === "origins") return await cmdReleaseNotesOrigins(args.slice(1), { resolveAuth, call, log, errorLog });
146
+ // BOT-3204: the per-release digest.
147
+ if (args[0] === "digest") return await cmdDigest(args.slice(1), { resolveAuth, call, log, errorLog, write, isTTY });
131
148
  const json = args.includes("--json");
132
149
  let rest = args.filter((a) => a !== "--json");
133
150
  // BOT-3260: --pack <pack.json>, anywhere after submit.
@@ -505,6 +522,57 @@ async function cmdPublish(action, argv, { resolveAuth, call, log, errorLog }) {
505
522
  return CALL_EXIT.OK;
506
523
  }
507
524
 
525
+ // ── BOT-3204: bb release-notes digest ─────────────────────────────────
526
+
527
+ const DIGEST_TOOL = "get_release_note_digest";
528
+ const DIGEST_FLAGS = { "--release": "release", "--voice": "voice", "--format": "format", "--repository": "repository" };
529
+
530
+ export async function cmdDigest(argv, { resolveAuth, call, log, errorLog, write, isTTY = false }) {
531
+ const json = argv.includes("--json");
532
+ const args = {};
533
+ for (let i = 0; i < argv.length; i++) {
534
+ const a = argv[i];
535
+ if (a === "--json") continue;
536
+ const key = DIGEST_FLAGS[a];
537
+ const v = argv[i + 1];
538
+ if (!key || !v || v.startsWith("--") || key in args) {
539
+ errorLog(RELEASE_NOTES_USAGE);
540
+ return 2;
541
+ }
542
+ args[key] = v;
543
+ i++;
544
+ }
545
+ if (!args.release || !args.voice) {
546
+ errorLog(RELEASE_NOTES_USAGE);
547
+ return 2;
548
+ }
549
+
550
+ let result;
551
+ try {
552
+ const resolved = await resolveAuth({ toolName: DIGEST_TOOL, preferSession: true });
553
+ result = resolved?.error || !resolved?.auth
554
+ ? { ok: false, auth: true }
555
+ : await call(DIGEST_TOOL, args, { auth: resolved.auth, signal: AbortSignal.timeout(60_000) });
556
+ } catch {
557
+ result = { ok: false, status: null };
558
+ }
559
+ const data = result?.data;
560
+ if (result?.ok && data?.ok === true && typeof data.body === "string") {
561
+ // Piped or redirected, the API's document is written unchanged: no
562
+ // trailing newline is added or removed. On a terminal, note text could
563
+ // carry control sequences, so they print as visible escapes (tabs kept).
564
+ if (json) log(JSON.stringify(data));
565
+ else write(isTTY ? data.body.split("\t").map(termClean).join("\t") : data.body);
566
+ return CALL_EXIT.OK;
567
+ }
568
+ if (result?.ok && data?.ok !== false) {
569
+ if (json) log(JSON.stringify({ ok: false, error: "receipt_unavailable" }));
570
+ errorLog("✗ BotBuddy did not return a digest. Retry the same command; a digest is a read and changes nothing.");
571
+ return CALL_EXIT.ERROR;
572
+ }
573
+ return printRefusalOrFailure(result, json, log, errorLog, "Nothing was changed.");
574
+ }
575
+
508
576
  // ── BOT-3166: bb release-notes list | get ──────────────────────────────
509
577
 
510
578
  function readUsage(errorLog) {