baro-ai 0.10.3 → 0.11.1

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,13 +1,6 @@
1
1
  #!/usr/bin/env sh
2
- # Resolve symlinks to find the real script directory (where baro-native lives)
3
- SELF="$0"
4
- while [ -L "$SELF" ]; do
5
- DIR="$(cd "$(dirname "$SELF")" && pwd)"
6
- SELF="$(readlink "$SELF")"
7
- case "$SELF" in /*) ;; *) SELF="$DIR/$SELF" ;; esac
8
- done
9
- SCRIPT_DIR="$(cd "$(dirname "$SELF")" && pwd)"
10
- NATIVE="$SCRIPT_DIR/baro-native"
2
+ # Look for baro binary in ~/.baro/bin/
3
+ NATIVE="$HOME/.baro/bin/baro"
11
4
  if [ -x "$NATIVE" ]; then
12
5
  exec "$NATIVE" "$@"
13
6
  else
package/bin/baro.cmd CHANGED
@@ -1,6 +1,5 @@
1
1
  @echo off
2
- set "SCRIPT_DIR=%~dp0"
3
- set "NATIVE=%SCRIPT_DIR%baro-native.exe"
2
+ set "NATIVE=%USERPROFILE%\.baro\bin\baro.exe"
4
3
  if exist "%NATIVE%" (
5
4
  "%NATIVE%" %*
6
5
  ) else (
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "baro-ai",
3
- "version": "0.10.3",
3
+ "version": "0.11.1",
4
4
  "description": "Autonomous parallel coding - plan and execute with AI",
5
5
  "type": "module",
6
6
  "bin": {
@@ -1,20 +1,20 @@
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 and saved as baro-native (not baro)
5
- * so the package directory only contains small npm-managed files, avoiding
6
- * ENOTEMPTY errors on upgrade.
4
+ * Binary is stored in ~/.baro/bin/ (outside the npm package directory)
5
+ * to avoid ENOTEMPTY errors when npm upgrades the package.
7
6
  */
8
7
 
9
8
  import * as fs from "fs"
10
9
  import * as path from "path"
11
10
  import { fileURLToPath } from "url"
12
11
  import * as https from "https"
12
+ import * as os from "os"
13
13
 
14
14
  const __dirname = path.dirname(fileURLToPath(import.meta.url))
15
15
  const PACKAGE_ROOT = path.resolve(__dirname, "..")
16
- const BIN_DIR = path.join(PACKAGE_ROOT, "bin")
17
- const NATIVE_NAME = process.platform === "win32" ? "baro-native.exe" : "baro-native"
16
+ const BARO_HOME = path.join(os.homedir(), ".baro", "bin")
17
+ const BINARY_NAME = process.platform === "win32" ? "baro.exe" : "baro"
18
18
  const REPO = "Lotus015/baro"
19
19
 
20
20
  function getPlatformKey() {
@@ -66,7 +66,7 @@ async function download(url, dest) {
66
66
  }
67
67
 
68
68
  async function main() {
69
- const nativePath = path.join(BIN_DIR, NATIVE_NAME)
69
+ const binaryPath = path.join(BARO_HOME, BINARY_NAME)
70
70
  const platformKey = getPlatformKey()
71
71
  const version = getVersion()
72
72
 
@@ -77,17 +77,17 @@ async function main() {
77
77
 
78
78
  console.log(`Downloading baro for ${platformKey}...`)
79
79
 
80
- fs.mkdirSync(BIN_DIR, { recursive: true })
80
+ fs.mkdirSync(BARO_HOME, { recursive: true })
81
81
 
82
- // Clean up old binary (from previous versions or failed installs)
83
- try { fs.unlinkSync(nativePath) } catch {}
82
+ // Clean up old binary
83
+ try { fs.unlinkSync(binaryPath) } catch {}
84
84
 
85
85
  try {
86
- await download(url, nativePath)
86
+ await download(url, binaryPath)
87
87
  if (process.platform !== "win32") {
88
- fs.chmodSync(nativePath, 0o755)
88
+ fs.chmodSync(binaryPath, 0o755)
89
89
  }
90
- console.log(`baro installed successfully`)
90
+ console.log(`baro installed to ${BARO_HOME}`)
91
91
  } catch (err) {
92
92
  console.warn(`Warning: Could not download baro: ${err.message}`)
93
93
  console.warn(` Build manually: cargo build --release -p baro-tui`)