gearbox-code 0.1.11 → 0.1.13

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.
Files changed (4) hide show
  1. package/README.md +40 -1
  2. package/dist/cli.mjs +98876 -88193
  3. package/install.sh +38 -2
  4. package/package.json +4 -1
package/install.sh CHANGED
@@ -3,7 +3,7 @@
3
3
  #
4
4
  # Installs the published npm package into user-owned directories:
5
5
  # ~/.local/share/gearbox/<version>/cli.mjs
6
- # ~/.local/bin/gearbox
6
+ # first user-owned PATH bin dir containing gearbox, or ~/.local/bin/gearbox
7
7
  #
8
8
  # This intentionally avoids `npm install -g`, sudo, /usr/local, and any system
9
9
  # prefix. It follows the same practical model as modern CLI installers: place a
@@ -13,9 +13,45 @@ set -euo pipefail
13
13
 
14
14
  PACKAGE_NAME="${GEARBOX_PACKAGE:-gearbox-code}"
15
15
  VERSION="${GEARBOX_VERSION:-latest}"
16
- BIN_DIR="${GEARBOX_BIN_DIR:-${HOME}/.local/bin}"
17
16
  INSTALL_ROOT="${GEARBOX_INSTALL_DIR:-${HOME}/.local/share/gearbox}"
18
17
 
18
+ default_bin_dir() {
19
+ if [[ -n "${GEARBOX_BIN_DIR:-}" ]]; then
20
+ echo "$GEARBOX_BIN_DIR"
21
+ return
22
+ fi
23
+
24
+ # If an older user-owned gearbox shim is already first on PATH, replace it.
25
+ # This fixes stale Bun/npm links such as ~/.bun/bin/gearbox -> src/cli.tsx,
26
+ # which would otherwise keep shadowing the good ~/.local/bin installer shim.
27
+ local existing dir
28
+ existing="$(command -v gearbox 2>/dev/null || true)"
29
+ if [[ -n "$existing" ]]; then
30
+ dir="$(dirname "$existing")"
31
+ if [[ "$dir" == "$HOME"/* && -d "$dir" && -w "$dir" ]]; then
32
+ echo "$dir"
33
+ return
34
+ fi
35
+ fi
36
+
37
+ local path_dir
38
+ IFS=':' read -r -a path_dirs <<< "${PATH:-}"
39
+ for path_dir in "${path_dirs[@]}"; do
40
+ if [[ "$path_dir" == "$HOME"/* && -d "$path_dir" && -w "$path_dir" ]]; then
41
+ case "$path_dir" in
42
+ "$HOME/.local/bin"|"$HOME/.bun/bin"|"$HOME/bin")
43
+ echo "$path_dir"
44
+ return
45
+ ;;
46
+ esac
47
+ fi
48
+ done
49
+
50
+ echo "${HOME}/.local/bin"
51
+ }
52
+
53
+ BIN_DIR="$(default_bin_dir)"
54
+
19
55
  need() {
20
56
  if ! command -v "$1" >/dev/null 2>&1; then
21
57
  echo "Gearbox installer needs '$1'." >&2
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gearbox-code",
3
- "version": "0.1.11",
3
+ "version": "0.1.13",
4
4
  "description": "A beautiful multi-provider coding harness for the terminal. (Intelligent model routing lands on top of this soon.)",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -44,5 +44,8 @@
44
44
  "react": "^18.3.1",
45
45
  "typescript": "^5.6.0",
46
46
  "zod": "^3.25.0"
47
+ },
48
+ "dependencies": {
49
+ "@modelcontextprotocol/sdk": "^1.29.0"
47
50
  }
48
51
  }