@shuyhere/bb-agent 0.0.6 → 0.0.8
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 +13 -24
- package/README.md +4 -2
- package/bin/bb +44 -10
- package/package.json +3 -2
- package/scripts/postinstall.js +37 -41
package/CHANGELOG.md
CHANGED
|
@@ -5,33 +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.8] - 2026-04-06
|
|
9
9
|
|
|
10
10
|
### Fixed
|
|
11
11
|
|
|
12
|
-
-
|
|
13
|
-
-
|
|
14
|
-
-
|
|
12
|
+
- auth-aware startup now prefers configured defaults or the last authenticated provider/model instead of falling back unexpectedly
|
|
13
|
+
- Gemini default model now prefers `gemini-3.1-pro`
|
|
14
|
+
- GitHub Copilot default model selection now prefers Claude Opus 4.6 when available
|
|
15
|
+
- login and no-auth UX now remind users that `/model` can switch to other configured models
|
|
16
|
+
- startup now shows a short update notice with npm-aware update commands when installed from npm
|
|
15
17
|
|
|
16
18
|
### Added
|
|
17
19
|
|
|
18
|
-
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
-
|
|
23
|
-
|
|
24
|
-
|
|
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
|
|
20
|
+
- startup update notice for published builds, including npm-specific upgrade guidance
|
|
21
|
+
|
|
22
|
+
### Changed
|
|
23
|
+
|
|
24
|
+
- latest published package includes the post-0.0.7 startup, auth, model-default, and update-notice improvements
|
|
25
|
+
|
|
26
|
+
[0.0.8]: https://github.com/shuyhere/bb-agent/releases/tag/v0.0.8
|
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,35 +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");
|
|
8
9
|
var packageJson = require("../package.json");
|
|
9
10
|
|
|
10
11
|
var wrapperRealPath = null;
|
|
11
12
|
try { wrapperRealPath = fs.realpathSync(__filename); } catch (e) {}
|
|
12
13
|
|
|
13
|
-
function
|
|
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) {
|
|
14
27
|
try {
|
|
15
|
-
|
|
16
|
-
|
|
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;
|
|
17
31
|
} catch (e) {
|
|
18
32
|
return false;
|
|
19
33
|
}
|
|
20
34
|
}
|
|
21
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
|
+
}
|
|
50
|
+
|
|
22
51
|
function findBinary() {
|
|
23
|
-
var nativeBin =
|
|
52
|
+
var nativeBin = bundledBinaryPath();
|
|
24
53
|
if (fs.existsSync(nativeBin)) {
|
|
25
54
|
try { fs.accessSync(nativeBin, fs.constants.X_OK); return nativeBin; } catch (e) {}
|
|
26
55
|
}
|
|
27
56
|
|
|
28
57
|
var dirs = (process.env.PATH || "").split(path.delimiter);
|
|
58
|
+
var names = candidateNames();
|
|
29
59
|
for (var i = 0; i < dirs.length; i++) {
|
|
30
60
|
if (path.resolve(dirs[i]) === path.resolve(__dirname)) continue;
|
|
31
|
-
var
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
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
|
+
}
|
|
37
69
|
}
|
|
38
70
|
|
|
39
71
|
return null;
|
|
@@ -56,6 +88,8 @@ if (!binary) {
|
|
|
56
88
|
console.error(" git clone https://github.com/shuyhere/bb-agent.git");
|
|
57
89
|
console.error(" cd bb-agent && cargo install --path crates/cli");
|
|
58
90
|
console.error("");
|
|
91
|
+
console.error("If this npm launcher shadows a source-built bb on your PATH, uninstall the npm package first.");
|
|
92
|
+
console.error("");
|
|
59
93
|
process.exit(1);
|
|
60
94
|
}
|
|
61
95
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@shuyhere/bb-agent",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.8",
|
|
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
|
@@ -12,15 +12,30 @@ const packageJson = require("../package.json");
|
|
|
12
12
|
const BINARY_RELEASE_TAG = `v${packageJson.version}`;
|
|
13
13
|
const REPO = "shuyhere/bb-agent";
|
|
14
14
|
const PACKAGE_ROOT = path.resolve(__dirname, "..");
|
|
15
|
-
const WRAPPER_SCRIPT = path.join(PACKAGE_ROOT, "bin", "bb");
|
|
16
15
|
const NATIVE_DIR = path.join(__dirname, "..", "native");
|
|
17
16
|
const DOWNLOAD_TIMEOUT_MS = 15_000;
|
|
18
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
|
+
|
|
19
30
|
function getTarget() {
|
|
20
31
|
const platform = os.platform();
|
|
21
32
|
const arch = os.arch();
|
|
22
33
|
|
|
23
|
-
const platformMap = {
|
|
34
|
+
const platformMap = {
|
|
35
|
+
darwin: "apple-darwin",
|
|
36
|
+
linux: "unknown-linux-gnu",
|
|
37
|
+
win32: "pc-windows-msvc",
|
|
38
|
+
};
|
|
24
39
|
const archMap = { x64: "x86_64", arm64: "aarch64" };
|
|
25
40
|
|
|
26
41
|
const p = platformMap[platform];
|
|
@@ -57,12 +72,27 @@ function downloadBinary(url, dest, timeoutMs) {
|
|
|
57
72
|
});
|
|
58
73
|
}
|
|
59
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
|
+
|
|
60
90
|
async function tryDownloadPrebuilt(target) {
|
|
61
|
-
const assetName =
|
|
91
|
+
const assetName = assetNameForTarget(target);
|
|
62
92
|
const url = `https://github.com/${REPO}/releases/download/${BINARY_RELEASE_TAG}/${assetName}`;
|
|
63
93
|
|
|
64
94
|
fs.mkdirSync(NATIVE_DIR, { recursive: true });
|
|
65
|
-
const dest =
|
|
95
|
+
const dest = nativeBinaryPath();
|
|
66
96
|
|
|
67
97
|
try {
|
|
68
98
|
console.log(`Downloading BB-Agent ${BINARY_RELEASE_TAG} for ${target}...`);
|
|
@@ -87,47 +117,13 @@ async function tryDownloadPrebuilt(target) {
|
|
|
87
117
|
}
|
|
88
118
|
}
|
|
89
119
|
|
|
90
|
-
function isCurrentPackageWrapper(candidate) {
|
|
91
|
-
try {
|
|
92
|
-
return fs.realpathSync(candidate) === fs.realpathSync(WRAPPER_SCRIPT);
|
|
93
|
-
} catch {
|
|
94
|
-
return false;
|
|
95
|
-
}
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
function findInPath(name) {
|
|
99
|
-
const dirs = (process.env.PATH || "").split(path.delimiter);
|
|
100
|
-
for (const dir of dirs) {
|
|
101
|
-
const full = path.join(dir, name);
|
|
102
|
-
try {
|
|
103
|
-
fs.accessSync(full, fs.constants.X_OK);
|
|
104
|
-
if (isCurrentPackageWrapper(full)) continue;
|
|
105
|
-
return full;
|
|
106
|
-
} catch {}
|
|
107
|
-
}
|
|
108
|
-
return null;
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
function checkExistingInstall() {
|
|
112
|
-
const existing = findInPath("bb");
|
|
113
|
-
if (!existing) return false;
|
|
114
|
-
|
|
115
|
-
try {
|
|
116
|
-
const version = execSync(`"${existing}" --version`, { encoding: "utf8", timeout: 5000 }).trim();
|
|
117
|
-
console.log(`✓ BB-Agent already installed: ${version} (${existing})`);
|
|
118
|
-
return true;
|
|
119
|
-
} catch {
|
|
120
|
-
return false;
|
|
121
|
-
}
|
|
122
|
-
}
|
|
123
120
|
|
|
124
121
|
async function main() {
|
|
125
122
|
if (process.env.BB_SKIP_POSTINSTALL) {
|
|
126
123
|
return;
|
|
127
124
|
}
|
|
128
125
|
|
|
129
|
-
|
|
130
|
-
if (checkExistingInstall()) return;
|
|
126
|
+
if (hasBundledNativeBinary()) return;
|
|
131
127
|
|
|
132
128
|
const target = getTarget();
|
|
133
129
|
|
|
@@ -147,8 +143,8 @@ async function main() {
|
|
|
147
143
|
console.log("║ BB-Agent: no prebuilt binary for " + platform.padEnd(19) + " ║");
|
|
148
144
|
console.log("║ ║");
|
|
149
145
|
console.log("║ Install Rust (if needed): ║");
|
|
150
|
-
console.log("║
|
|
151
|
-
console.log("║
|
|
146
|
+
console.log("║ https://rustup.rs ║");
|
|
147
|
+
console.log("║ Then install with rustup for your platform ║");
|
|
152
148
|
console.log("║ ║");
|
|
153
149
|
console.log("║ Then build BB-Agent: ║");
|
|
154
150
|
console.log("║ git clone https://github.com/shuyhere/bb-agent.git ║");
|