@shuyhere/bb-agent 0.0.4 → 0.0.6

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 ADDED
@@ -0,0 +1,37 @@
1
+ # Changelog
2
+
3
+ All notable changes to BB-Agent will be documented in this file.
4
+
5
+ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
6
+ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
+
8
+ ## [0.0.6] - 2026-04-06
9
+
10
+ ### Fixed
11
+
12
+ - npm launcher no longer recurses into itself when the native binary is missing
13
+ - npm postinstall now better detects whether the current package already has a usable native binary
14
+ - clearer npm fallback messaging when matching GitHub release assets are not yet available
15
+
16
+ ### Added
17
+
18
+ - **Fullscreen TUI** with streaming output, markdown rendering, and syntax highlighting
19
+ - **Multi-provider support**: Anthropic (Claude), OpenAI, Google (Gemini), Groq, xAI, OpenRouter, and custom OpenAI-compatible endpoints
20
+ - **Built-in tools**: `read`, `write`, `edit`, `bash`, `find`, `grep`, `ls`, `web_search`, `web_fetch`, `browser_fetch`
21
+ - **Session persistence** with SQLite-backed storage, branching, forking, and tree navigation
22
+ - **Extensions** via JS/TS plugin system for custom tools, commands, and event hooks
23
+ - **Skills** — markdown-based instruction files that auto-load contextual knowledge
24
+ - **System prompt templates** — save named prompts in `~/.bb-agent/system-prompts/` and use with `bb -t <name>`
25
+ - **OAuth login** for Anthropic and OpenAI (browser-based PKCE flow)
26
+ - **`@` file mention** autocomplete in the input area
27
+ - **`/` slash commands** for session management, model switching, and more
28
+ - **Layered configuration** — global `~/.bb-agent/settings.json` merged with project `.bb-agent/settings.json`
29
+ - **`AGENTS.md`** support (like Claude's `CLAUDE.md`) for persistent system prompt additions
30
+ - **Custom models and providers** via settings.json
31
+ - **Auto-retry** with exponential backoff and server-hinted delays
32
+ - **Session compaction** to keep context within model limits
33
+ - **Package management** — install skills/extensions from npm, git, or local paths
34
+ - **Print mode** (`bb -p`) for non-interactive scripted usage
35
+ - **Session resume** (`bb -c` to continue, `bb -r` to pick)
36
+
37
+ [0.0.6]: https://github.com/shuyhere/bb-agent/releases/tag/v0.0.6
package/README.md CHANGED
@@ -23,18 +23,35 @@ cargo install --path crates/cli
23
23
 
24
24
  This compiles the `bb` binary and installs it to `~/.cargo/bin/bb` (which Rust adds to your PATH).
25
25
 
26
- ### npm (Linux x86_64 — prebuilt binary)
26
+ ### npm (Linux/macOS x86_64 + arm64 downloads matching prebuilt binary when available)
27
27
 
28
28
  ```bash
29
29
  npm install -g @shuyhere/bb-agent
30
30
  ```
31
31
 
32
- > **macOS / other platforms:** npm install will print instructions to build from source.
33
- > Prebuilt binaries for macOS coming soon. After install, run `bb` to start.
32
+ > If no matching prebuilt binary is available for your platform, npm install will print source-build instructions instead. After install, run `bb` to start.
34
33
 
35
34
  ## Getting Started
36
35
 
37
- ### 1. Login to a provider
36
+ ### 1. Start the TUI
37
+
38
+ ```bash
39
+ bb
40
+ ```
41
+
42
+ That's the recommended way to get started.
43
+
44
+ ### 2. Log in with `/login`
45
+
46
+ Inside the TUI, run:
47
+
48
+ ```text
49
+ /login
50
+ ```
51
+
52
+ This opens the provider picker and auth flow directly in the fullscreen UI.
53
+
54
+ If you prefer, you can also log in from a normal terminal:
38
55
 
39
56
  ```bash
40
57
  bb login # Interactive provider selection
@@ -45,12 +62,6 @@ bb login google # Login to Google (API key)
45
62
 
46
63
  Or set environment variables: `ANTHROPIC_API_KEY`, `OPENAI_API_KEY`, `GOOGLE_API_KEY`, etc.
47
64
 
48
- ### 2. Start the TUI
49
-
50
- ```bash
51
- bb
52
- ```
53
-
54
65
  That's it! Run `bb` to launch the fullscreen interactive terminal UI. Type your prompt and press Enter.
55
66
 
56
67
  ### More ways to use `bb`
@@ -75,7 +86,7 @@ bb --list-models # List all available models
75
86
  - **Extensions** — JS/TS plugin system for custom tools, commands, and hooks
76
87
  - **Skills** — markdown-based instruction files that auto-load contextual knowledge
77
88
  - **System prompt templates** — save and switch between named prompt configurations
78
- - **OAuth login** — browser-based login for Anthropic and OpenAI
89
+ - **OAuth login** — browser/device login for Anthropic, OpenAI, and GitHub Copilot
79
90
 
80
91
  ## System Prompt Templates
81
92
 
package/bin/bb CHANGED
@@ -5,6 +5,19 @@
5
5
  var execFileSync = require("child_process").execFileSync;
6
6
  var path = require("path");
7
7
  var fs = require("fs");
8
+ var packageJson = require("../package.json");
9
+
10
+ var wrapperRealPath = null;
11
+ try { wrapperRealPath = fs.realpathSync(__filename); } catch (e) {}
12
+
13
+ function isSelfBinary(candidate) {
14
+ try {
15
+ if (!wrapperRealPath) return false;
16
+ return fs.realpathSync(candidate) === wrapperRealPath;
17
+ } catch (e) {
18
+ return false;
19
+ }
20
+ }
8
21
 
9
22
  function findBinary() {
10
23
  var nativeBin = path.join(__dirname, "..", "native", "bb");
@@ -16,7 +29,11 @@ function findBinary() {
16
29
  for (var i = 0; i < dirs.length; i++) {
17
30
  if (path.resolve(dirs[i]) === path.resolve(__dirname)) continue;
18
31
  var full = path.join(dirs[i], "bb");
19
- try { fs.accessSync(full, fs.constants.X_OK); return full; } catch (e) {}
32
+ try {
33
+ fs.accessSync(full, fs.constants.X_OK);
34
+ if (isSelfBinary(full)) continue;
35
+ return full;
36
+ } catch (e) {}
20
37
  }
21
38
 
22
39
  return null;
@@ -26,23 +43,27 @@ var binary = findBinary();
26
43
 
27
44
  if (!binary) {
28
45
  console.error("");
29
- console.error("BB-Agent binary not found.");
46
+ console.error("BB-Agent native binary not found.");
47
+ console.error("");
48
+ console.error("This npm package is a small launcher and expects a matching native binary.");
49
+ console.error("That binary may not have been downloaded yet for version " + packageJson.version + ".");
30
50
  console.error("");
31
- console.error("Install Rust (if needed):");
32
- console.error(" curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh");
33
- console.error(" source ~/.cargo/env");
51
+ console.error("Try reinstalling after the GitHub release assets are available:");
52
+ console.error(" npm uninstall -g @shuyhere/bb-agent");
53
+ console.error(" npm install -g @shuyhere/bb-agent@" + packageJson.version);
34
54
  console.error("");
35
- console.error("Then build BB-Agent:");
55
+ console.error("Or build from source:");
36
56
  console.error(" git clone https://github.com/shuyhere/bb-agent.git");
37
57
  console.error(" cd bb-agent && cargo install --path crates/cli");
38
58
  console.error("");
39
- console.error("Then run: bb");
40
- console.error("");
41
59
  process.exit(1);
42
60
  }
43
61
 
44
62
  try {
45
- execFileSync(binary, process.argv.slice(2), { stdio: "inherit" });
63
+ execFileSync(binary, process.argv.slice(2), {
64
+ stdio: "inherit",
65
+ env: Object.assign({}, process.env, { BB_NPM_WRAPPER_ACTIVE: "1" })
66
+ });
46
67
  } catch (err) {
47
68
  process.exit(err.status || 1);
48
69
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shuyhere/bb-agent",
3
- "version": "0.0.4",
3
+ "version": "0.0.6",
4
4
  "description": "BB-Agent — a Rust-native AI coding agent for the terminal",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -28,6 +28,7 @@
28
28
  "bin/",
29
29
  "scripts/",
30
30
  "README.md",
31
+ "CHANGELOG.md",
31
32
  "LICENSE"
32
33
  ],
33
34
  "scripts": {
@@ -8,9 +8,11 @@ const path = require("path");
8
8
  const os = require("os");
9
9
  const https = require("https");
10
10
 
11
- // Binary release tag — update this when you push a new GitHub release with binaries.
12
- const BINARY_RELEASE_TAG = "v0.0.1";
11
+ const packageJson = require("../package.json");
12
+ const BINARY_RELEASE_TAG = `v${packageJson.version}`;
13
13
  const REPO = "shuyhere/bb-agent";
14
+ const PACKAGE_ROOT = path.resolve(__dirname, "..");
15
+ const WRAPPER_SCRIPT = path.join(PACKAGE_ROOT, "bin", "bb");
14
16
  const NATIVE_DIR = path.join(__dirname, "..", "native");
15
17
  const DOWNLOAD_TIMEOUT_MS = 15_000;
16
18
 
@@ -85,12 +87,21 @@ async function tryDownloadPrebuilt(target) {
85
87
  }
86
88
  }
87
89
 
90
+ function isCurrentPackageWrapper(candidate) {
91
+ try {
92
+ return fs.realpathSync(candidate) === fs.realpathSync(WRAPPER_SCRIPT);
93
+ } catch {
94
+ return false;
95
+ }
96
+ }
97
+
88
98
  function findInPath(name) {
89
99
  const dirs = (process.env.PATH || "").split(path.delimiter);
90
100
  for (const dir of dirs) {
91
101
  const full = path.join(dir, name);
92
102
  try {
93
103
  fs.accessSync(full, fs.constants.X_OK);
104
+ if (isCurrentPackageWrapper(full)) continue;
94
105
  return full;
95
106
  } catch {}
96
107
  }
@@ -130,6 +141,8 @@ async function main() {
130
141
  // (cargo build takes 5+ minutes and would appear to hang)
131
142
  const platform = `${os.platform()}-${os.arch()}`;
132
143
  console.log("");
144
+ console.log(`BB-Agent ${packageJson.version}: matching prebuilt binary not available yet for ${platform}.`);
145
+ console.log("");
133
146
  console.log("╔══════════════════════════════════════════════════════════════╗");
134
147
  console.log("║ BB-Agent: no prebuilt binary for " + platform.padEnd(19) + " ║");
135
148
  console.log("║ ║");