gearbox-code 0.1.19 → 0.1.21

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 (3) hide show
  1. package/dist/cli.mjs +13 -6
  2. package/install.sh +23 -17
  3. package/package.json +1 -1
package/dist/cli.mjs CHANGED
@@ -147867,7 +147867,7 @@ init_permission();
147867
147867
  var jsx_dev_runtime13 = __toESM(require_jsx_dev_runtime(), 1);
147868
147868
  process.env.LANG = process.env.LANG || "en_US.UTF-8";
147869
147869
  process.env.LC_ALL = process.env.LC_ALL || "en_US.UTF-8";
147870
- var VERSION16 = "0.1.19";
147870
+ var VERSION16 = "0.1.21";
147871
147871
  var args = process.argv.slice(2);
147872
147872
  var supportsAnsi = process.env.FORCE_COLOR === "1" || process.env.TERM !== "dumb" && process.env.NO_COLOR !== "1" && process.stdout.isTTY;
147873
147873
  var ansi = (code) => supportsAnsi ? `\x1B[${code}m` : "";
@@ -148139,8 +148139,8 @@ Options:
148139
148139
  --model <name> e.g. sonnet-4.6, haiku, gemini-flash, deepseek
148140
148140
  -c, --continue resume the most recent session here (/resume to pick one)
148141
148141
  --yolo auto-approve writes/edits/shell (no permission prompts)
148142
- --fullscreen fullscreen app frame with fixed footer (alt-screen)
148143
- --inline terminal scrollback mode (default)
148142
+ --inline use terminal scrollback instead of the fullscreen frame
148143
+ --fullscreen fullscreen app frame (default)
148144
148144
  -v, --version print version
148145
148145
  -h, --help this help
148146
148146
 
@@ -148292,19 +148292,26 @@ if (process.stdout.isTTY && imageMode === "kitty")
148292
148292
  var uiPrefs = loadPrefs();
148293
148293
  var explicitInline = args.includes("--inline") || process.env.GEARBOX_INLINE === "1" || process.env.GEARBOX_FULLSCREEN === "0";
148294
148294
  var explicitFullscreen = args.includes("--fullscreen") || process.env.GEARBOX_FULLSCREEN === "1";
148295
- var wantsInline = !explicitFullscreen && (explicitInline || uiPrefs.fullscreen !== true);
148295
+ var wantsInline = explicitInline || !explicitFullscreen && uiPrefs.fullscreen === false;
148296
148296
  var wantsFullscreen = !wantsInline;
148297
148297
  var fullscreen = Boolean(process.stdout.isTTY) && wantsFullscreen;
148298
148298
  var mouse = Boolean(process.stdout.isTTY) && process.env.GEARBOX_MOUSE !== "0";
148299
+ var restored = false;
148299
148300
  var restore = () => {
148300
- if (!process.stdout.isTTY)
148301
+ if (restored || !process.stdout.isTTY)
148301
148302
  return;
148303
+ restored = true;
148302
148304
  process.stdout.write("\x1B[?2004l\x1B[?25h");
148303
148305
  if (mouse)
148304
148306
  process.stdout.write("\x1B[?1006l\x1B[?1002l\x1B[?1000l");
148305
148307
  if (fullscreen)
148306
- process.stdout.write("\x1B[?1049l");
148308
+ process.stdout.write("\x1B[?1049l\x1B[2J\x1B[H");
148307
148309
  };
148310
+ process.once("exit", restore);
148311
+ process.once("SIGTERM", () => {
148312
+ restore();
148313
+ process.exit(0);
148314
+ });
148308
148315
  if (process.stdout.isTTY)
148309
148316
  process.stdout.write("\x1B[?2004l\x1B[?25l");
148310
148317
  if (fullscreen)
package/install.sh CHANGED
@@ -11,6 +11,13 @@
11
11
  # directory is not on PATH.
12
12
  set -euo pipefail
13
13
 
14
+ # ANSI helpers (no-op when stdout is not a TTY or NO_COLOR is set)
15
+ if [[ -t 1 && "${NO_COLOR:-}" == "" ]]; then
16
+ R=$'\033[0m' B=$'\033[1m' D=$'\033[2m' C=$'\033[36m' G=$'\033[32m' Y=$'\033[33m'
17
+ else
18
+ R='' B='' D='' C='' G='' Y=''
19
+ fi
20
+
14
21
  PACKAGE_NAME="${GEARBOX_PACKAGE:-gearbox-code}"
15
22
  VERSION="${GEARBOX_VERSION:-latest}"
16
23
  INSTALL_ROOT="${GEARBOX_INSTALL_DIR:-${HOME}/.local/share/gearbox}"
@@ -73,7 +80,7 @@ trap cleanup EXIT
73
80
  meta_url="https://registry.npmjs.org/${PACKAGE_NAME}/${VERSION}"
74
81
  meta_file="${tmp}/meta.json"
75
82
 
76
- echo "-> Fetching ${PACKAGE_NAME}@${VERSION}"
83
+ printf "${D} → fetching ${PACKAGE_NAME}@${VERSION}${R}\n"
77
84
  curl -fsSL "$meta_url" -o "$meta_file"
78
85
 
79
86
  resolved_version="$(node -e 'const fs=require("fs"); const j=JSON.parse(fs.readFileSync(process.argv[1],"utf8")); console.log(j.version || "")' "$meta_file")"
@@ -88,7 +95,7 @@ target_dir="${INSTALL_ROOT}/${resolved_version}"
88
95
  archive="${tmp}/package.tgz"
89
96
  extract_dir="${tmp}/extract"
90
97
 
91
- echo "-> Downloading ${PACKAGE_NAME}@${resolved_version}"
98
+ printf "${D} → downloading ${PACKAGE_NAME}@${resolved_version}${R}\n"
92
99
  curl -fsSL "$tarball_url" -o "$archive"
93
100
  mkdir -p "$extract_dir" "$target_dir" "$BIN_DIR"
94
101
  tar -xzf "$archive" -C "$extract_dir"
@@ -111,37 +118,36 @@ exec node "${target_dir}/cli.mjs" "\$@"
111
118
  EOF
112
119
  chmod 0755 "${BIN_DIR}/gearbox"
113
120
 
114
- echo ""
115
- echo "Installed Gearbox ${resolved_version}"
116
- echo " ${BIN_DIR}/gearbox"
117
- echo ""
121
+ printf "\n"
122
+ printf "${G} ✓${R} ${B}gearbox ${resolved_version}${R} installed\n"
123
+ printf "${D} ${BIN_DIR}/gearbox${R}\n"
124
+ printf "\n"
118
125
 
119
126
  case ":${PATH}:" in
120
127
  *":${BIN_DIR}:"*)
121
- echo "Run it with: gearbox"
128
+ printf " run ${C}gearbox${R} to start\n"
122
129
  ;;
123
130
  *)
124
131
  shell_name="$(basename "${SHELL:-sh}")"
125
132
  rc_file="${HOME}/.profile"
126
133
  if [[ "$shell_name" == "zsh" ]]; then rc_file="${HOME}/.zshrc"; fi
127
134
  if [[ "$shell_name" == "bash" ]]; then rc_file="${HOME}/.bashrc"; fi
128
- echo "${BIN_DIR} is not on PATH yet."
129
- echo "Add it with:"
130
- echo " echo 'export PATH=\"${BIN_DIR}:\$PATH\"' >> ${rc_file}"
131
- echo " source ${rc_file}"
132
- echo ""
133
- echo "Then run: gearbox"
135
+ printf "${Y} ! ${BIN_DIR} is not on PATH${R}\n"
136
+ printf " echo 'export PATH=\"${BIN_DIR}:\$PATH\"' >> ${rc_file}\n"
137
+ printf " source ${rc_file}\n"
138
+ printf "\n"
139
+ printf " then run ${C}gearbox${R}\n"
134
140
  ;;
135
141
  esac
136
142
 
137
143
  if [[ "${GEARBOX_SKIP_ONBOARD:-}" != "1" ]]; then
138
- echo ""
139
- echo "Starting setup..."
144
+ printf "\n"
145
+ printf "${D} setting up …${R}\n"
140
146
  if [[ -t 1 && -e /dev/tty && -r /dev/tty && -w /dev/tty ]]; then
141
147
  if ! "${BIN_DIR}/gearbox" onboard < /dev/tty > /dev/tty; then
142
- echo "Setup did not complete. Run: ${BIN_DIR}/gearbox onboard"
148
+ printf "${Y} setup incomplete run: ${C}gearbox onboard${R}\n"
143
149
  fi
144
150
  else
145
- echo "No interactive terminal detected. Run: ${BIN_DIR}/gearbox onboard"
151
+ printf "${D} no interactive terminal run: ${C}gearbox onboard${R}\n"
146
152
  fi
147
153
  fi
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gearbox-code",
3
- "version": "0.1.19",
3
+ "version": "0.1.21",
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",