@shuyhere/bb-agent 0.0.2 → 0.0.3

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/bin/bb CHANGED
@@ -2,46 +2,42 @@
2
2
 
3
3
  "use strict";
4
4
 
5
- const { execFileSync } = require("child_process");
6
- const path = require("path");
7
- const fs = require("fs");
5
+ var execFileSync = require("child_process").execFileSync;
6
+ var path = require("path");
7
+ var fs = require("fs");
8
8
 
9
9
  function findBinary() {
10
- // 1. Check native/ dir (downloaded by postinstall)
11
- const nativeBin = path.join(__dirname, "..", "native", "bb");
10
+ var nativeBin = path.join(__dirname, "..", "native", "bb");
12
11
  if (fs.existsSync(nativeBin)) {
13
- try { fs.accessSync(nativeBin, fs.constants.X_OK); return nativeBin; } catch {}
12
+ try { fs.accessSync(nativeBin, fs.constants.X_OK); return nativeBin; } catch (e) {}
14
13
  }
15
14
 
16
- // 2. Check PATH (cargo install)
17
- const dirs = (process.env.PATH || "").split(path.delimiter);
18
- for (const dir of dirs) {
19
- // Skip our own bin/ dir to avoid infinite recursion
20
- if (path.resolve(dir) === path.resolve(__dirname)) continue;
21
- const full = path.join(dir, "bb");
22
- try { fs.accessSync(full, fs.constants.X_OK); return full; } catch {}
15
+ var dirs = (process.env.PATH || "").split(path.delimiter);
16
+ for (var i = 0; i < dirs.length; i++) {
17
+ if (path.resolve(dirs[i]) === path.resolve(__dirname)) continue;
18
+ var full = path.join(dirs[i], "bb");
19
+ try { fs.accessSync(full, fs.constants.X_OK); return full; } catch (e) {}
23
20
  }
24
21
 
25
22
  return null;
26
23
  }
27
24
 
28
- const binary = findBinary();
25
+ var binary = findBinary();
29
26
 
30
27
  if (!binary) {
31
- console.error(`
32
- BB-Agent binary not found.
33
-
34
- Install Rust (if needed):
35
- curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
36
- source ~/.cargo/env
37
-
38
- Then build BB-Agent:
39
- git clone https://github.com/shuyhere/bb-agent.git
40
- cd bb-agent && cargo install --path crates/cli
41
-
42
- Then run:
43
- bb
44
- `;
28
+ console.error("");
29
+ console.error("BB-Agent binary not found.");
30
+ 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");
34
+ console.error("");
35
+ console.error("Then build BB-Agent:");
36
+ console.error(" git clone https://github.com/shuyhere/bb-agent.git");
37
+ console.error(" cd bb-agent && cargo install --path crates/cli");
38
+ console.error("");
39
+ console.error("Then run: bb");
40
+ console.error("");
45
41
  process.exit(1);
46
42
  }
47
43
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shuyhere/bb-agent",
3
- "version": "0.0.2",
3
+ "version": "0.0.3",
4
4
  "description": "BB-Agent — a Rust-native AI coding agent for the terminal",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -8,7 +8,7 @@ const path = require("path");
8
8
  const os = require("os");
9
9
  const https = require("https");
10
10
 
11
- const VERSION = "0.0.2";
11
+ const VERSION = "0.0.3";
12
12
  const REPO = "shuyhere/bb-agent";
13
13
  const NATIVE_DIR = path.join(__dirname, "..", "native");
14
14
  const DOWNLOAD_TIMEOUT_MS = 15_000;