baro-ai 0.10.0 → 0.10.2

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/baro CHANGED
@@ -1,3 +1,9 @@
1
1
  #!/usr/bin/env sh
2
- echo "baro: binary not yet installed. Run: npm rebuild baro-ai" >&2
3
- exit 1
2
+ SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
3
+ NATIVE="$SCRIPT_DIR/baro-native"
4
+ if [ -x "$NATIVE" ]; then
5
+ exec "$NATIVE" "$@"
6
+ else
7
+ echo "baro: binary not installed. Run: npm rebuild baro-ai" >&2
8
+ exit 1
9
+ fi
package/bin/baro.cmd CHANGED
@@ -1,3 +1,9 @@
1
1
  @echo off
2
- echo baro: binary not yet installed. Run: npm rebuild baro-ai 1>&2
3
- exit /b 1
2
+ set "SCRIPT_DIR=%~dp0"
3
+ set "NATIVE=%SCRIPT_DIR%baro-native.exe"
4
+ if exist "%NATIVE%" (
5
+ "%NATIVE%" %*
6
+ ) else (
7
+ echo baro: binary not installed. Run: npm rebuild baro-ai 1>&2
8
+ exit /b 1
9
+ )
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "baro-ai",
3
- "version": "0.10.0",
3
+ "version": "0.10.2",
4
4
  "description": "Autonomous parallel coding - plan and execute with AI",
5
5
  "type": "module",
6
6
  "bin": {
@@ -1,7 +1,9 @@
1
1
  #!/usr/bin/env node
2
2
  /**
3
3
  * Postinstall script - downloads the baro binary for the current platform.
4
- * Binary is fetched from GitHub Releases.
4
+ * Binary is fetched from GitHub Releases and saved as baro-native (not baro)
5
+ * so the package directory only contains small npm-managed files, avoiding
6
+ * ENOTEMPTY errors on upgrade.
5
7
  */
6
8
 
7
9
  import * as fs from "fs"
@@ -12,7 +14,7 @@ import * as https from "https"
12
14
  const __dirname = path.dirname(fileURLToPath(import.meta.url))
13
15
  const PACKAGE_ROOT = path.resolve(__dirname, "..")
14
16
  const BIN_DIR = path.join(PACKAGE_ROOT, "bin")
15
- const BINARY_NAME = process.platform === "win32" ? "baro.exe" : "baro"
17
+ const NATIVE_NAME = process.platform === "win32" ? "baro-native.exe" : "baro-native"
16
18
  const REPO = "Lotus015/baro"
17
19
 
18
20
  function getPlatformKey() {
@@ -64,23 +66,26 @@ async function download(url, dest) {
64
66
  }
65
67
 
66
68
  async function main() {
67
- const binaryPath = path.join(BIN_DIR, BINARY_NAME)
69
+ const nativePath = path.join(BIN_DIR, NATIVE_NAME)
68
70
  const platformKey = getPlatformKey()
69
71
  const version = getVersion()
70
72
 
71
73
  const artifactName = process.platform === "win32"
72
74
  ? `baro-${platformKey}.exe`
73
- : `${BINARY_NAME}-${platformKey}`
75
+ : `baro-${platformKey}`
74
76
  const url = `https://github.com/${REPO}/releases/download/v${version}/${artifactName}`
75
77
 
76
78
  console.log(`Downloading baro for ${platformKey}...`)
77
79
 
78
80
  fs.mkdirSync(BIN_DIR, { recursive: true })
79
81
 
82
+ // Clean up old binary (from previous versions or failed installs)
83
+ try { fs.unlinkSync(nativePath) } catch {}
84
+
80
85
  try {
81
- await download(url, binaryPath)
86
+ await download(url, nativePath)
82
87
  if (process.platform !== "win32") {
83
- fs.chmodSync(binaryPath, 0o755)
88
+ fs.chmodSync(nativePath, 0o755)
84
89
  }
85
90
  console.log(`baro installed successfully`)
86
91
  } catch (err) {