@shuyhere/bb-agent 0.0.5 → 0.0.7
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 +16 -21
- package/README.md +4 -2
- package/bin/bb +65 -10
- package/package.json +3 -2
- package/scripts/postinstall.js +40 -31
package/CHANGELOG.md
CHANGED
|
@@ -5,27 +5,22 @@ 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
|
-
## [0.0.
|
|
8
|
+
## [0.0.7] - 2026-04-06
|
|
9
|
+
|
|
10
|
+
### Fixed
|
|
11
|
+
|
|
12
|
+
- fullscreen no-auth errors now direct users to `/login`
|
|
13
|
+
- successful TUI login now auto-switches to a friendly authenticated model (`gpt-5.4` for OpenAI, `claude-opus-4-6` for Anthropic)
|
|
14
|
+
- error and warning notes now use highlighted text without background blocks
|
|
15
|
+
- npm launcher and postinstall behavior improved when native binaries are missing
|
|
9
16
|
|
|
10
17
|
### Added
|
|
11
18
|
|
|
12
|
-
-
|
|
13
|
-
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
- **`@` file mention** autocomplete in the input area
|
|
21
|
-
- **`/` slash commands** for session management, model switching, and more
|
|
22
|
-
- **Layered configuration** — global `~/.bb-agent/settings.json` merged with project `.bb-agent/settings.json`
|
|
23
|
-
- **`AGENTS.md`** support (like Claude's `CLAUDE.md`) for persistent system prompt additions
|
|
24
|
-
- **Custom models and providers** via settings.json
|
|
25
|
-
- **Auto-retry** with exponential backoff and server-hinted delays
|
|
26
|
-
- **Session compaction** to keep context within model limits
|
|
27
|
-
- **Package management** — install skills/extensions from npm, git, or local paths
|
|
28
|
-
- **Print mode** (`bb -p`) for non-interactive scripted usage
|
|
29
|
-
- **Session resume** (`bb -c` to continue, `bb -r` to pick)
|
|
30
|
-
|
|
31
|
-
[0.0.5]: https://github.com/shuyhere/bb-agent/releases/tag/v0.0.5
|
|
19
|
+
- Windows release binaries via GitHub Releases
|
|
20
|
+
- Windows support in the npm installer/launcher path
|
|
21
|
+
|
|
22
|
+
### Changed
|
|
23
|
+
|
|
24
|
+
- release packaging now targets Linux, macOS, and Windows with matching npm/GitHub binary distribution paths
|
|
25
|
+
|
|
26
|
+
[0.0.7]: https://github.com/shuyhere/bb-agent/releases/tag/v0.0.7
|
package/README.md
CHANGED
|
@@ -4,7 +4,7 @@ A Rust-native AI coding agent for the terminal — featuring a fullscreen TUI, m
|
|
|
4
4
|
|
|
5
5
|
## Install
|
|
6
6
|
|
|
7
|
-
### From source (all platforms — macOS, Linux)
|
|
7
|
+
### From source (all platforms — macOS, Linux, Windows)
|
|
8
8
|
|
|
9
9
|
Requires [Rust](https://rustup.rs). Install Rust first if you don't have it:
|
|
10
10
|
|
|
@@ -23,13 +23,15 @@ 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/macOS
|
|
26
|
+
### npm (Linux/macOS/Windows — downloads matching prebuilt binary when available)
|
|
27
27
|
|
|
28
28
|
```bash
|
|
29
29
|
npm install -g @shuyhere/bb-agent
|
|
30
30
|
```
|
|
31
31
|
|
|
32
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.
|
|
33
|
+
>
|
|
34
|
+
> Current GitHub release binaries are published for Linux x86_64, macOS x86_64/arm64, and Windows x86_64.
|
|
33
35
|
|
|
34
36
|
## Getting Started
|
|
35
37
|
|
package/bin/bb
CHANGED
|
@@ -5,18 +5,67 @@
|
|
|
5
5
|
var execFileSync = require("child_process").execFileSync;
|
|
6
6
|
var path = require("path");
|
|
7
7
|
var fs = require("fs");
|
|
8
|
+
var os = require("os");
|
|
9
|
+
var packageJson = require("../package.json");
|
|
10
|
+
|
|
11
|
+
var wrapperRealPath = null;
|
|
12
|
+
try { wrapperRealPath = fs.realpathSync(__filename); } catch (e) {}
|
|
13
|
+
|
|
14
|
+
function isWindows() {
|
|
15
|
+
return os.platform() === "win32";
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
function candidateNames() {
|
|
19
|
+
return isWindows() ? ["bb.exe", "bb.cmd", "bb.ps1", "bb"] : ["bb"];
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
function bundledBinaryPath() {
|
|
23
|
+
return path.join(__dirname, "..", "native", isWindows() ? "bb.exe" : "bb");
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
function candidateReferencesCurrentPackage(candidate) {
|
|
27
|
+
try {
|
|
28
|
+
var text = fs.readFileSync(candidate, "utf8").replace(/\\/g, "/").toLowerCase();
|
|
29
|
+
var packageRoot = path.resolve(__dirname, "..").replace(/\\/g, "/").toLowerCase();
|
|
30
|
+
return text.indexOf(packageRoot) !== -1 || text.indexOf(packageJson.name.toLowerCase()) !== -1;
|
|
31
|
+
} catch (e) {
|
|
32
|
+
return false;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
function isSelfBinary(candidate) {
|
|
37
|
+
try {
|
|
38
|
+
if (wrapperRealPath && fs.realpathSync(candidate) === wrapperRealPath) return true;
|
|
39
|
+
} catch (e) {}
|
|
40
|
+
|
|
41
|
+
try {
|
|
42
|
+
var resolved = fs.realpathSync(candidate);
|
|
43
|
+
if (resolved.indexOf(path.resolve(__dirname, "..")) === 0 && path.basename(resolved) !== path.basename(bundledBinaryPath())) {
|
|
44
|
+
return true;
|
|
45
|
+
}
|
|
46
|
+
} catch (e) {}
|
|
47
|
+
|
|
48
|
+
return candidateReferencesCurrentPackage(candidate);
|
|
49
|
+
}
|
|
8
50
|
|
|
9
51
|
function findBinary() {
|
|
10
|
-
var nativeBin =
|
|
52
|
+
var nativeBin = bundledBinaryPath();
|
|
11
53
|
if (fs.existsSync(nativeBin)) {
|
|
12
54
|
try { fs.accessSync(nativeBin, fs.constants.X_OK); return nativeBin; } catch (e) {}
|
|
13
55
|
}
|
|
14
56
|
|
|
15
57
|
var dirs = (process.env.PATH || "").split(path.delimiter);
|
|
58
|
+
var names = candidateNames();
|
|
16
59
|
for (var i = 0; i < dirs.length; i++) {
|
|
17
60
|
if (path.resolve(dirs[i]) === path.resolve(__dirname)) continue;
|
|
18
|
-
var
|
|
19
|
-
|
|
61
|
+
for (var j = 0; j < names.length; j++) {
|
|
62
|
+
var full = path.join(dirs[i], names[j]);
|
|
63
|
+
try {
|
|
64
|
+
fs.accessSync(full, fs.constants.X_OK);
|
|
65
|
+
if (isSelfBinary(full)) continue;
|
|
66
|
+
return full;
|
|
67
|
+
} catch (e) {}
|
|
68
|
+
}
|
|
20
69
|
}
|
|
21
70
|
|
|
22
71
|
return null;
|
|
@@ -26,23 +75,29 @@ var binary = findBinary();
|
|
|
26
75
|
|
|
27
76
|
if (!binary) {
|
|
28
77
|
console.error("");
|
|
29
|
-
console.error("BB-Agent binary not found.");
|
|
78
|
+
console.error("BB-Agent native binary not found.");
|
|
79
|
+
console.error("");
|
|
80
|
+
console.error("This npm package is a small launcher and expects a matching native binary.");
|
|
81
|
+
console.error("That binary may not have been downloaded yet for version " + packageJson.version + ".");
|
|
30
82
|
console.error("");
|
|
31
|
-
console.error("
|
|
32
|
-
console.error("
|
|
33
|
-
console.error("
|
|
83
|
+
console.error("Try reinstalling after the GitHub release assets are available:");
|
|
84
|
+
console.error(" npm uninstall -g @shuyhere/bb-agent");
|
|
85
|
+
console.error(" npm install -g @shuyhere/bb-agent@" + packageJson.version);
|
|
34
86
|
console.error("");
|
|
35
|
-
console.error("
|
|
87
|
+
console.error("Or build from source:");
|
|
36
88
|
console.error(" git clone https://github.com/shuyhere/bb-agent.git");
|
|
37
89
|
console.error(" cd bb-agent && cargo install --path crates/cli");
|
|
38
90
|
console.error("");
|
|
39
|
-
console.error("
|
|
91
|
+
console.error("If this npm launcher shadows a source-built bb on your PATH, uninstall the npm package first.");
|
|
40
92
|
console.error("");
|
|
41
93
|
process.exit(1);
|
|
42
94
|
}
|
|
43
95
|
|
|
44
96
|
try {
|
|
45
|
-
execFileSync(binary, process.argv.slice(2), {
|
|
97
|
+
execFileSync(binary, process.argv.slice(2), {
|
|
98
|
+
stdio: "inherit",
|
|
99
|
+
env: Object.assign({}, process.env, { BB_NPM_WRAPPER_ACTIVE: "1" })
|
|
100
|
+
});
|
|
46
101
|
} catch (err) {
|
|
47
102
|
process.exit(err.status || 1);
|
|
48
103
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@shuyhere/bb-agent",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.7",
|
|
4
4
|
"description": "BB-Agent — a Rust-native AI coding agent for the terminal",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -36,7 +36,8 @@
|
|
|
36
36
|
},
|
|
37
37
|
"os": [
|
|
38
38
|
"darwin",
|
|
39
|
-
"linux"
|
|
39
|
+
"linux",
|
|
40
|
+
"win32"
|
|
40
41
|
],
|
|
41
42
|
"cpu": [
|
|
42
43
|
"x64",
|
package/scripts/postinstall.js
CHANGED
|
@@ -11,14 +11,31 @@ const https = require("https");
|
|
|
11
11
|
const packageJson = require("../package.json");
|
|
12
12
|
const BINARY_RELEASE_TAG = `v${packageJson.version}`;
|
|
13
13
|
const REPO = "shuyhere/bb-agent";
|
|
14
|
+
const PACKAGE_ROOT = path.resolve(__dirname, "..");
|
|
14
15
|
const NATIVE_DIR = path.join(__dirname, "..", "native");
|
|
15
16
|
const DOWNLOAD_TIMEOUT_MS = 15_000;
|
|
16
17
|
|
|
18
|
+
function isWindows() {
|
|
19
|
+
return os.platform() === "win32";
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
function nativeBinaryName() {
|
|
23
|
+
return isWindows() ? "bb.exe" : "bb";
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
function nativeBinaryPath() {
|
|
27
|
+
return path.join(NATIVE_DIR, nativeBinaryName());
|
|
28
|
+
}
|
|
29
|
+
|
|
17
30
|
function getTarget() {
|
|
18
31
|
const platform = os.platform();
|
|
19
32
|
const arch = os.arch();
|
|
20
33
|
|
|
21
|
-
const platformMap = {
|
|
34
|
+
const platformMap = {
|
|
35
|
+
darwin: "apple-darwin",
|
|
36
|
+
linux: "unknown-linux-gnu",
|
|
37
|
+
win32: "pc-windows-msvc",
|
|
38
|
+
};
|
|
22
39
|
const archMap = { x64: "x86_64", arm64: "aarch64" };
|
|
23
40
|
|
|
24
41
|
const p = platformMap[platform];
|
|
@@ -55,12 +72,27 @@ function downloadBinary(url, dest, timeoutMs) {
|
|
|
55
72
|
});
|
|
56
73
|
}
|
|
57
74
|
|
|
75
|
+
function assetNameForTarget(target) {
|
|
76
|
+
return isWindows() ? `bb-${target}.exe` : `bb-${target}`;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
function hasBundledNativeBinary() {
|
|
80
|
+
const dest = nativeBinaryPath();
|
|
81
|
+
if (!fs.existsSync(dest)) return false;
|
|
82
|
+
try {
|
|
83
|
+
execSync(`"${dest}" --version`, { stdio: "pipe", timeout: 5000 });
|
|
84
|
+
return true;
|
|
85
|
+
} catch {
|
|
86
|
+
return false;
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
|
|
58
90
|
async function tryDownloadPrebuilt(target) {
|
|
59
|
-
const assetName =
|
|
91
|
+
const assetName = assetNameForTarget(target);
|
|
60
92
|
const url = `https://github.com/${REPO}/releases/download/${BINARY_RELEASE_TAG}/${assetName}`;
|
|
61
93
|
|
|
62
94
|
fs.mkdirSync(NATIVE_DIR, { recursive: true });
|
|
63
|
-
const dest =
|
|
95
|
+
const dest = nativeBinaryPath();
|
|
64
96
|
|
|
65
97
|
try {
|
|
66
98
|
console.log(`Downloading BB-Agent ${BINARY_RELEASE_TAG} for ${target}...`);
|
|
@@ -85,38 +117,13 @@ async function tryDownloadPrebuilt(target) {
|
|
|
85
117
|
}
|
|
86
118
|
}
|
|
87
119
|
|
|
88
|
-
function findInPath(name) {
|
|
89
|
-
const dirs = (process.env.PATH || "").split(path.delimiter);
|
|
90
|
-
for (const dir of dirs) {
|
|
91
|
-
const full = path.join(dir, name);
|
|
92
|
-
try {
|
|
93
|
-
fs.accessSync(full, fs.constants.X_OK);
|
|
94
|
-
return full;
|
|
95
|
-
} catch {}
|
|
96
|
-
}
|
|
97
|
-
return null;
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
function checkExistingInstall() {
|
|
101
|
-
const existing = findInPath("bb");
|
|
102
|
-
if (!existing) return false;
|
|
103
|
-
|
|
104
|
-
try {
|
|
105
|
-
const version = execSync(`"${existing}" --version`, { encoding: "utf8", timeout: 5000 }).trim();
|
|
106
|
-
console.log(`✓ BB-Agent already installed: ${version} (${existing})`);
|
|
107
|
-
return true;
|
|
108
|
-
} catch {
|
|
109
|
-
return false;
|
|
110
|
-
}
|
|
111
|
-
}
|
|
112
120
|
|
|
113
121
|
async function main() {
|
|
114
122
|
if (process.env.BB_SKIP_POSTINSTALL) {
|
|
115
123
|
return;
|
|
116
124
|
}
|
|
117
125
|
|
|
118
|
-
|
|
119
|
-
if (checkExistingInstall()) return;
|
|
126
|
+
if (hasBundledNativeBinary()) return;
|
|
120
127
|
|
|
121
128
|
const target = getTarget();
|
|
122
129
|
|
|
@@ -130,12 +137,14 @@ async function main() {
|
|
|
130
137
|
// (cargo build takes 5+ minutes and would appear to hang)
|
|
131
138
|
const platform = `${os.platform()}-${os.arch()}`;
|
|
132
139
|
console.log("");
|
|
140
|
+
console.log(`BB-Agent ${packageJson.version}: matching prebuilt binary not available yet for ${platform}.`);
|
|
141
|
+
console.log("");
|
|
133
142
|
console.log("╔══════════════════════════════════════════════════════════════╗");
|
|
134
143
|
console.log("║ BB-Agent: no prebuilt binary for " + platform.padEnd(19) + " ║");
|
|
135
144
|
console.log("║ ║");
|
|
136
145
|
console.log("║ Install Rust (if needed): ║");
|
|
137
|
-
console.log("║
|
|
138
|
-
console.log("║
|
|
146
|
+
console.log("║ https://rustup.rs ║");
|
|
147
|
+
console.log("║ Then install with rustup for your platform ║");
|
|
139
148
|
console.log("║ ║");
|
|
140
149
|
console.log("║ Then build BB-Agent: ║");
|
|
141
150
|
console.log("║ git clone https://github.com/shuyhere/bb-agent.git ║");
|