@shuyhere/bb-agent 0.0.15 → 0.0.16

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
@@ -5,27 +5,58 @@ All notable changes to BB-Agent will be documented in this file.
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
+ ## [Unreleased]
9
+
10
+ ## [0.0.16] - 2026-04-15
11
+
12
+ ### Added
13
+
14
+ - added `bb setup browser`, including platform-specific guidance and optional shell-profile persistence for configuring `BB_BROWSER`
15
+ - added a dedicated release-notes draft for `v0.0.16` under `docs/release-notes-0.0.16.md`
16
+
17
+ ### Changed
18
+
19
+ - user-facing terminology now consistently uses **TUI** instead of legacy `fullscreen` wording, including CLI/help/docs text and internal module/type naming
20
+ - markdown code blocks and bash tool previews in the TUI now render as raw fenced blocks for easier copying and pasting
21
+ - tool availability, advertised schemas, transcript validation, and tool execution now follow a shared architecture with a single CLI `ToolRegistry`, centralized provider transcript repair, explicit tool lifecycle phases, lifecycle hook events, and mutation-aware scheduling for real tool execution
22
+ - release builds and npm installs now prefer stripped/compressed native binaries, reducing download size and improving install/update behavior
23
+
24
+ ### Fixed
25
+
26
+ - `browser_fetch` now gives actionable missing-browser diagnostics and setup guidance instead of failing opaquely when no local browser is installed
27
+ - TUI footer context usage no longer gets stuck at misleading values like `0.0%/272k (auto)` after resume/rebuild/fork paths
28
+ - queued prompt previews no longer hide compaction/local-action status, and fast local actions no longer flash meaningless `0ms` / `0.0s` timing
29
+ - failed or interrupted tool calls no longer wedge later prompts with provider-side `No tool output found ...` errors; transcript repair and lifecycle finalization now guarantee a valid follow-up turn state
30
+ - join-timeout warnings no longer make an active TUI turn look finished before the runner actually completes
31
+ - clean `bb-cli` builds no longer emit dead-code warnings from the new tool registry surface, and secret-bearing auth/token structs now redact sensitive fields in debug output instead of exposing raw credentials
32
+
33
+ ### Improved
34
+
35
+ - ongoing Rust audit cleanup significantly reduced boolean-heavy APIs, overexposed state, and hotspot modules across `bb-cli`, `bb-core`, `bb-tools`, `bb-session`, `bb-tui`, `bb-provider`, `bb-plugin-host`, and `bb-hooks`, with expanded focused regression coverage throughout
36
+ - npm install now prefers compressed `.gz` GitHub release assets when available, falling back to the legacy uncompressed binaries for older releases
37
+ - release builds now strip debug info before publishing, substantially reducing native binary download size for npm installs and updates
38
+
8
39
  ## [0.0.15] - 2026-04-12
9
40
 
10
41
  ### Fixed
11
42
 
12
- - fullscreen bash output now streams live stdout/stderr and keeps running, finished, historical, and expanded/collapsed tool blocks visually consistent with width-aware tail previews and elapsed/took footer hints
43
+ - tui bash output now streams live stdout/stderr and keeps running, finished, historical, and expanded/collapsed tool blocks visually consistent with width-aware tail previews and elapsed/took footer hints
13
44
  - bash tool titles now skip shell prelude lines like `set -e`, show configured timeout values in the UI, and validate invalid timeout arguments instead of accepting zero or non-finite values
14
45
  - fixed the session getting stuck after interrupted or failed tool calls by flushing synthetic tool results before later prompts, preventing follow-up turns from failing with missing tool output
15
46
  - Codex tool-call request handling is more robust: tool calls are serialized sequentially, orphan tool results are sanitized out of requests, and streamed/done function-call events are deduplicated more safely
16
47
  - plain URLs and hyphenated text no longer trigger accidental markdown horizontal-rule rendering while explicit markdown rules and setext headings still render correctly
17
- - fullscreen resume menu handling now awaits the async resume path correctly instead of dropping back through the synchronous menu flow
48
+ - tui resume menu handling now awaits the async resume path correctly instead of dropping back through the synchronous menu flow
18
49
 
19
50
  ### Added
20
51
 
21
- - regression coverage for interrupted tool-call recovery, Codex orphan-tool sanitization, builtin tool-name normalization, fullscreen bash rendering consistency, and bash timeout validation/visibility
52
+ - regression coverage for interrupted tool-call recovery, Codex orphan-tool sanitization, builtin tool-name normalization, tui bash rendering consistency, and bash timeout validation/visibility
22
53
 
23
54
  ## [0.0.14] - 2026-04-12
24
55
 
25
56
  ### Added
26
57
 
27
- - fullscreen now supports extension-driven workflows and structured slash-command outcomes, including menus, hidden dispatches, and richer command result handling
28
- - `/settings` in fullscreen now exposes compaction controls for `Auto-compact`, `Reserve tokens`, and `Keep recent tokens`
58
+ - tui now supports extension-driven workflows and structured slash-command outcomes, including menus, hidden dispatches, and richer command result handling
59
+ - `/settings` in tui now exposes compaction controls for `Auto-compact`, `Reserve tokens`, and `Keep recent tokens`
29
60
  - skills can now be listed, disabled, and re-enabled from the CLI without deleting their installed files
30
61
  - startup model selection now prefers configured provider/model defaults more consistently, with better OpenAI startup fallback behavior
31
62
  - added a parity test script against installed pi compaction logic to keep BB token accounting aligned with upstream behavior
@@ -33,39 +64,39 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
33
64
  ### Fixed
34
65
 
35
66
  - session resume now restores the prior model and thinking level instead of starting with mismatched runtime defaults
36
- - fullscreen/TUI terminal rendering now sanitizes terminal control text more reliably and avoids ANSI leakage into the UI
67
+ - tui/TUI terminal rendering now sanitizes terminal control text more reliably and avoids ANSI leakage into the UI
37
68
  - auto-compaction token estimation now matches pi more closely by using the last successful assistant usage plus trailing estimates, using ceil-based token heuristics, computing `tokens_before` from rebuilt context instead of raw payload size, and ignoring assistant usage from before the latest compaction boundary
38
- - fullscreen compaction behavior and status reporting are more consistent after auto-compaction and manual compaction events, and local fullscreen actions now show an animated elapsed-time status while they run
69
+ - tui compaction behavior and status reporting are more consistent after auto-compaction and manual compaction events, and local tui actions now show an animated elapsed-time status while they run
39
70
 
40
71
  ### Changed
41
72
 
42
- - fullscreen extension workflows and session compaction support are now merged into the main interaction path on `master`
73
+ - tui extension workflows and session compaction support are now merged into the main interaction path on `master`
43
74
 
44
75
  ## [0.0.13] - 2026-04-09
45
76
 
46
77
  ### Added
47
78
 
48
- - fullscreen screenshot and image clipboard paste now works on the normal paste path, with macOS clipboard fallbacks and Codex image preservation so pasted images reach image-capable models correctly
79
+ - tui screenshot and image clipboard paste now works on the normal paste path, with macOS clipboard fallbacks and Codex image preservation so pasted images reach image-capable models correctly
49
80
  - model registry metadata now tracks image input capability, making `/models` truthful about image support and allowing runtime warnings when users attach images to text-only models
50
81
 
51
82
  ### Fixed
52
83
 
53
- - fullscreen clipboard image attach no longer leaks helper `true` / `false` output or stray follow-up paste text into the input block
84
+ - tui clipboard image attach no longer leaks helper `true` / `false` output or stray follow-up paste text into the input block
54
85
  - attached image chips can now be removed with `Backspace`, image-only prompts can be submitted, and optimistic user messages keep attachment chip previews in the transcript
55
- - rebuilt fullscreen session transcripts now preserve user image attachment markers instead of silently dropping image blocks
86
+ - rebuilt tui session transcripts now preserve user image attachment markers instead of silently dropping image blocks
56
87
  - managed `bb-clipboard-*.png` temp files are now cleaned up after removal or ingestion instead of lingering in `/tmp`
57
- - the fullscreen input block now hides raw `@file` tokens when the corresponding attachment chip is already shown, preventing duplicated `@file` text in the editor
58
- - fullscreen tool-header regression tests now match the intended live bash-header rendering and running-dot animation behavior
88
+ - the tui input block now hides raw `@file` tokens when the corresponding attachment chip is already shown, preventing duplicated `@file` text in the editor
89
+ - tui tool-header regression tests now match the intended live bash-header rendering and running-dot animation behavior
59
90
 
60
91
  ## [0.0.12] - 2026-04-06
61
92
 
62
93
  ### Fixed
63
94
 
64
- - direct `@image` references in print mode and fullscreen now attach real image inputs instead of falling back to UTF-8 read warnings
95
+ - direct `@image` references in print mode and tui now attach real image inputs instead of falling back to UTF-8 read warnings
65
96
  - `@path with spaces` parsing now correctly keeps the full file path before trailing prompt text, including whole-message forms
66
97
  - image tool results are now preserved through provider conversion so models can actually see images returned by tools instead of responding as if no image was provided
67
- - fullscreen `@` folder navigation now keeps the completion menu open when you select a directory and immediately shows the next level, including directories with spaces
68
- - the fullscreen input block now shows attached files as `[name, sizeKB]`, keeps those chips visible, and places the cursor below them so typing starts after the attachments
98
+ - tui `@` folder navigation now keeps the completion menu open when you select a directory and immediately shows the next level, including directories with spaces
99
+ - the tui input block now shows attached files as `[name, sizeKB]`, keeps those chips visible, and places the cursor below them so typing starts after the attachments
69
100
 
70
101
  ### Changed
71
102
 
@@ -75,9 +106,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
75
106
 
76
107
  ### Added
77
108
 
78
- - startup update notices in the fullscreen transcript are now highlighted so available updates stand out clearly during startup
79
- - read-tool line ranges in fullscreen tool activity now highlight the requested span, so values like `2148-2267/5006` stand out while the model is using tools
80
- - fullscreen footer and `/session` info now show the active execution posture so safety vs yolo is visible during a run
109
+ - startup update notices in the tui transcript are now highlighted so available updates stand out clearly during startup
110
+ - read-tool line ranges in tui tool activity now highlight the requested span, so values like `2148-2267/5006` stand out while the model is using tools
111
+ - tui footer and `/session` info now show the active execution posture so safety vs yolo is visible during a run
81
112
 
82
113
  ### Improved
83
114
 
@@ -96,7 +127,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
96
127
 
97
128
  - npm install now uses a longer timeout, retries release-binary downloads, and reports real download errors instead of incorrectly saying no matching prebuilt binary exists
98
129
  - npm install now shows progress logs during native binary download and verification so first-time installs on macOS/Linux are less confusing
99
- - fullscreen `/login` provider-family status now correctly shows OpenAI OAuth state after ChatGPT login instead of incorrectly showing the API key path as not authenticated
130
+ - tui `/login` provider-family status now correctly shows OpenAI OAuth state after ChatGPT login instead of incorrectly showing the API key path as not authenticated
100
131
 
101
132
  ### Changed
102
133
 
@@ -112,9 +143,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
112
143
 
113
144
  ### Fixed
114
145
 
115
- - fullscreen paste in iTerm2/SSH no longer corrupts the input area after paste
146
+ - tui paste in iTerm2/SSH no longer corrupts the input area after paste
116
147
  - pasted file and image paths are normalized more reliably, including quoted paths and `file://` URLs
117
- - fullscreen prompt submission now expands `@file` references consistently
148
+ - tui prompt submission now expands `@file` references consistently
118
149
  - running tool timers continue updating after `TurnEnd` while tools are still executing
119
150
  - sub-second tool durations now display as `ms` instead of `0.0s`
120
151
  - startup Skills/Prompts/Extensions note now only appears at startup or explicit `/reload`
@@ -122,7 +153,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
122
153
 
123
154
  ### Changed
124
155
 
125
- - fullscreen `Ctrl+V` now falls back to clipboard text when no clipboard image is available
156
+ - tui `Ctrl+V` now falls back to clipboard text when no clipboard image is available
126
157
  - `@` autocomplete now inserts quoted file references when paths contain spaces
127
158
 
128
159
  ## [0.0.8] - 2026-04-06
@@ -143,6 +174,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
143
174
 
144
175
  - latest published package includes the post-0.0.7 startup, auth, model-default, and update-notice improvements
145
176
 
177
+ [0.0.16]: https://github.com/shuyhere/bb-agent/releases/tag/v0.0.16
178
+ [0.0.15]: https://github.com/shuyhere/bb-agent/releases/tag/v0.0.15
146
179
  [0.0.14]: https://github.com/shuyhere/bb-agent/releases/tag/v0.0.14
147
180
  [0.0.13]: https://github.com/shuyhere/bb-agent/releases/tag/v0.0.13
148
181
  [0.0.12]: https://github.com/shuyhere/bb-agent/releases/tag/v0.0.12
package/README.md CHANGED
@@ -4,7 +4,7 @@
4
4
 
5
5
  > BB means Bridge Baby in Death Stranding. I named this project that way because while building it, I was also enjoying Death Stranding and loved the idea of connecting everyone together.
6
6
 
7
- A Rust-native AI coding agent for the terminal — featuring a fullscreen TUI, multi-provider support, tool use, session persistence, branching, extensions, and skills.
7
+ A Rust-native AI coding agent for the terminal — featuring a TUI, multi-provider support, tool use, session persistence, branching, extensions, and skills.
8
8
 
9
9
  ## Install
10
10
 
@@ -17,7 +17,7 @@ npm install -g @shuyhere/bb-agent
17
17
  npm install downloads a small wrapper package first, then fetches the matching native BB-Agent binary from the GitHub release for your platform.
18
18
 
19
19
  What to expect:
20
- - first install can take a bit because npm downloads and verifies the native binary
20
+ - first install can take a bit because npm downloads a compressed native binary, expands it locally, and verifies it
21
21
  - the installer now prints progress and retry information while downloading
22
22
  - after install, run `bb`
23
23
 
@@ -68,7 +68,7 @@ Inside the TUI, run:
68
68
  /login
69
69
  ```
70
70
 
71
- This opens the provider picker and auth flow directly in the fullscreen UI.
71
+ This opens the provider picker and auth flow directly in the TUI.
72
72
 
73
73
  If you prefer, you can also log in from a normal terminal:
74
74
 
@@ -81,12 +81,12 @@ bb login google # Login to Google (API key)
81
81
 
82
82
  Or set environment variables: `ANTHROPIC_API_KEY`, `OPENAI_API_KEY`, `GOOGLE_API_KEY`, etc.
83
83
 
84
- That's it! Run `bb` to launch the fullscreen interactive terminal UI. Type your prompt and press Enter.
84
+ That's it! Run `bb` to launch the interactive TUI. Type your prompt and press Enter.
85
85
 
86
86
  ### More ways to use `bb`
87
87
 
88
88
  ```bash
89
- bb # Launch the fullscreen TUI
89
+ bb # Launch the TUI
90
90
  bb "Explain this codebase" # TUI with an initial prompt
91
91
  bb -p "What is 2+2?" # Print mode (non-interactive, pipe-friendly)
92
92
  bb -c # Continue your last session
@@ -98,7 +98,7 @@ bb --list-models # List all available models
98
98
 
99
99
  ## Features
100
100
 
101
- - **Fullscreen TUI** — rich terminal interface with streaming output, markdown rendering, syntax highlighting
101
+ - **TUI** — rich terminal interface with streaming output, markdown rendering, syntax highlighting
102
102
  - **Multi-provider** — Anthropic (Claude), OpenAI, Google (Gemini), Groq, xAI, OpenRouter, and custom OpenAI-compatible endpoints
103
103
  - **Built-in tools** — `read`, `write`, `edit`, `bash`, `find`, `grep`, `ls`, `web_search`, `web_fetch`, `browser_fetch`
104
104
  - **Safety and yolo execution modes** — default safety posture restricts built-in `write` and `edit` to the active workspace; yolo removes that guard
@@ -165,7 +165,7 @@ BB-Agent uses layered configuration:
165
165
 
166
166
  ### Execution Modes
167
167
 
168
- BB-Agent exposes the active permission posture in fullscreen and `/session`.
168
+ BB-Agent exposes the active permission posture in the TUI and `/session`.
169
169
 
170
170
  - `safety` is the default. Built-in `write` and `edit` stay inside the current workspace, and bash commands use the safer approval/sandboxed posture.
171
171
  - `yolo` is the opt-in less-restrictive mode.
@@ -202,14 +202,14 @@ Example:
202
202
  | `bb-provider` | Model/provider integrations and streaming |
203
203
  | `bb-hooks` | Hook event types for extensions |
204
204
  | `bb-plugin-host` | Plugin discovery and host runtime |
205
- | `bb-tui` | Terminal UI components and fullscreen experience |
205
+ | `bb-tui` | Terminal UI components and the interactive TUI experience |
206
206
  | `bb-cli` | The `bb` command-line application |
207
207
 
208
208
  ## Troubleshooting
209
209
 
210
210
  ### Terminal & Font Compatibility
211
211
 
212
- BB-Agent uses Unicode glyphs and ANSI color in the fullscreen TUI. For the best visual experience, use a modern terminal and a Unicode-capable monospace font such as:
212
+ BB-Agent uses Unicode glyphs and ANSI color in the TUI. For the best visual experience, use a modern terminal and a Unicode-capable monospace font such as:
213
213
 
214
214
  - JetBrains Mono
215
215
  - SF Mono / Menlo
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shuyhere/bb-agent",
3
- "version": "0.0.15",
3
+ "version": "0.0.16",
4
4
  "description": "BB-Agent — a Rust-native AI coding agent for the terminal",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -8,6 +8,7 @@ const path = require("path");
8
8
  const os = require("os");
9
9
  const https = require("https");
10
10
  const http = require("http");
11
+ const zlib = require("zlib");
11
12
 
12
13
  const packageJson = require("../package.json");
13
14
  const BINARY_RELEASE_TAG = `v${packageJson.version}`;
@@ -51,6 +52,20 @@ function assetNameForTarget(target) {
51
52
  return isWindows() ? `bb-${target}.exe` : `bb-${target}`;
52
53
  }
53
54
 
55
+ function assetCandidatesForTarget(target) {
56
+ const assetName = assetNameForTarget(target);
57
+ return [
58
+ {
59
+ assetName: `${assetName}.gz`,
60
+ compressed: true,
61
+ },
62
+ {
63
+ assetName,
64
+ compressed: false,
65
+ },
66
+ ];
67
+ }
68
+
54
69
  function logLine(message = "") {
55
70
  try {
56
71
  process.stderr.write(`${message}\n`);
@@ -387,9 +402,16 @@ function verifyBinary(binaryPath) {
387
402
  return { ok: true, version };
388
403
  }
389
404
 
405
+ function expandCompressedBinary(src, dest) {
406
+ logLine("Decompressing downloaded BB-Agent binary...");
407
+ ensureParentDir(dest);
408
+ const expanded = zlib.gunzipSync(fs.readFileSync(src));
409
+ fs.writeFileSync(dest, expanded);
410
+ removeIfExists(src);
411
+ }
412
+
390
413
  async function tryDownloadPrebuilt(target) {
391
- const assetName = assetNameForTarget(target);
392
- const url = `https://github.com/${REPO}/releases/download/${BINARY_RELEASE_TAG}/${assetName}`;
414
+ const assetCandidates = assetCandidatesForTarget(target);
393
415
 
394
416
  fs.mkdirSync(NATIVE_DIR, { recursive: true });
395
417
  const dest = nativeBinaryPath();
@@ -412,37 +434,67 @@ async function tryDownloadPrebuilt(target) {
412
434
  `Downloading BB-Agent ${BINARY_RELEASE_TAG} for ${target} (attempt ${attempt}/${MAX_DOWNLOAD_ATTEMPTS})...`
413
435
  );
414
436
  logLine("This may take a little while on first install because npm downloads the native binary from the GitHub release.");
415
- removeIfExists(tmpDest);
416
- await requestBinary(url, tmpDest, 0);
417
- if (!isWindows()) {
418
- fs.chmodSync(tmpDest, 0o755);
419
- }
420
437
 
421
- const verified = verifyBinary(tmpDest);
422
- if (!verified.ok) {
438
+ let missingCompressedAsset = false;
439
+ for (const asset of assetCandidates) {
440
+ const url = `https://github.com/${REPO}/releases/download/${BINARY_RELEASE_TAG}/${asset.assetName}`;
441
+ const downloadDest = asset.compressed ? `${tmpDest}.gz` : tmpDest;
442
+
423
443
  removeIfExists(tmpDest);
424
- return {
425
- ok: false,
426
- kind: "verify",
427
- message: `Downloaded binary could not run: ${verified.message}`,
428
- };
429
- }
444
+ removeIfExists(`${tmpDest}.gz`);
430
445
 
431
- fs.renameSync(tmpDest, dest);
432
- refreshCacheFromExistingBinary(target, dest);
433
- logLine("Cached verified BB-Agent binary for future installs.");
434
- logLine("✓ BB-Agent binary installed successfully.");
435
- return { ok: true, source: "download" };
446
+ try {
447
+ if (asset.compressed) {
448
+ logLine(`Trying compressed release asset ${asset.assetName} first for a faster download.`);
449
+ }
450
+ await requestBinary(url, downloadDest, 0);
451
+ if (asset.compressed) {
452
+ expandCompressedBinary(downloadDest, tmpDest);
453
+ }
454
+ if (!isWindows()) {
455
+ fs.chmodSync(tmpDest, 0o755);
456
+ }
457
+
458
+ const verified = verifyBinary(tmpDest);
459
+ if (!verified.ok) {
460
+ removeIfExists(tmpDest);
461
+ return {
462
+ ok: false,
463
+ kind: "verify",
464
+ message: `Downloaded binary could not run: ${verified.message}`,
465
+ };
466
+ }
467
+
468
+ fs.renameSync(tmpDest, dest);
469
+ refreshCacheFromExistingBinary(target, dest);
470
+ logLine("Cached verified BB-Agent binary for future installs.");
471
+ logLine("✓ BB-Agent binary installed successfully.");
472
+ return { ok: true, source: "download" };
473
+ } catch (err) {
474
+ lastError = err;
475
+ removeIfExists(tmpDest);
476
+ removeIfExists(`${tmpDest}.gz`);
477
+ if (err.kind === "not-found") {
478
+ if (asset.compressed) {
479
+ missingCompressedAsset = true;
480
+ logLine(`Compressed asset ${asset.assetName} not found; falling back to the uncompressed release binary.`);
481
+ continue;
482
+ }
483
+ return {
484
+ ok: false,
485
+ kind: "not-found",
486
+ message: missingCompressedAsset
487
+ ? `No release asset named ${asset.assetName} or ${assetCandidates[0].assetName} was found for ${BINARY_RELEASE_TAG}.`
488
+ : `No release asset named ${asset.assetName} was found for ${BINARY_RELEASE_TAG}.`,
489
+ };
490
+ }
491
+ throw err;
492
+ }
493
+ }
436
494
  } catch (err) {
437
495
  lastError = err;
438
496
  removeIfExists(tmpDest);
439
- if (err.kind === "not-found") {
440
- return {
441
- ok: false,
442
- kind: "not-found",
443
- message: `No release asset named ${assetName} was found for ${BINARY_RELEASE_TAG}.`,
444
- };
445
- }
497
+ removeIfExists(`${tmpDest}.gz`);
446
498
  if (attempt < MAX_DOWNLOAD_ATTEMPTS) {
447
499
  logLine(`Download failed (${err.message}). Retrying...`);
448
500
  await new Promise((resolve) => setTimeout(resolve, 1000 * attempt));