gearbox-code 0.1.18 → 0.1.20
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/dist/cli.mjs +18 -10
- package/install.sh +23 -17
- 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.
|
|
147870
|
+
var VERSION16 = "0.1.20";
|
|
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` : "";
|
|
@@ -147906,10 +147906,17 @@ function ghostLines(cells, pad3 = " ") {
|
|
|
147906
147906
|
return line;
|
|
147907
147907
|
});
|
|
147908
147908
|
}
|
|
147909
|
-
function onboardingBoo() {
|
|
147910
|
-
|
|
147909
|
+
function onboardingBoo(termWidth) {
|
|
147910
|
+
const cells = renderGhost({ palette: "default", face: "happy", scale: 1 });
|
|
147911
|
+
const ghostW = cells[0]?.length ?? 20;
|
|
147912
|
+
const leftPad = Math.max(2, Math.floor((termWidth - ghostW) / 2));
|
|
147913
|
+
return ghostLines(cells, " ".repeat(leftPad)).join(`
|
|
147911
147914
|
`);
|
|
147912
147915
|
}
|
|
147916
|
+
var centerStr = (text2, width) => {
|
|
147917
|
+
const pad3 = Math.max(0, Math.floor((width - visibleLength(text2)) / 2));
|
|
147918
|
+
return " ".repeat(pad3) + text2;
|
|
147919
|
+
};
|
|
147913
147920
|
function box(title, lines) {
|
|
147914
147921
|
const width = Math.min(78, Math.max(title.length + 4, ...lines.map((l) => visibleLength(l) + 4)));
|
|
147915
147922
|
const rule = "─".repeat(width - 2);
|
|
@@ -147971,12 +147978,13 @@ async function runCliOnboarding() {
|
|
|
147971
147978
|
return true;
|
|
147972
147979
|
};
|
|
147973
147980
|
try {
|
|
147981
|
+
const termWidth = Math.min(process.stdout.columns || 80, 100);
|
|
147974
147982
|
console.log("");
|
|
147975
|
-
console.log(onboardingBoo());
|
|
147983
|
+
console.log(onboardingBoo(termWidth));
|
|
147976
147984
|
console.log("");
|
|
147977
|
-
console.log(bold("
|
|
147978
|
-
console.log("
|
|
147979
|
-
console.log(dim("
|
|
147985
|
+
console.log(centerStr(bold("gearbox"), termWidth));
|
|
147986
|
+
console.log(centerStr("set up one account — Gearbox routes from there", termWidth));
|
|
147987
|
+
console.log(centerStr(dim("keys stay local, never sent anywhere"), termWidth));
|
|
147980
147988
|
console.log("");
|
|
147981
147989
|
while (!anyProviderAvailable()) {
|
|
147982
147990
|
const env3 = importableEnvCreds2();
|
|
@@ -148131,8 +148139,8 @@ Options:
|
|
|
148131
148139
|
--model <name> e.g. sonnet-4.6, haiku, gemini-flash, deepseek
|
|
148132
148140
|
-c, --continue resume the most recent session here (/resume to pick one)
|
|
148133
148141
|
--yolo auto-approve writes/edits/shell (no permission prompts)
|
|
148134
|
-
--
|
|
148135
|
-
--
|
|
148142
|
+
--fullscreen fullscreen app frame with fixed footer (alt-screen)
|
|
148143
|
+
--inline terminal scrollback mode (default)
|
|
148136
148144
|
-v, --version print version
|
|
148137
148145
|
-h, --help this help
|
|
148138
148146
|
|
|
@@ -148284,7 +148292,7 @@ if (process.stdout.isTTY && imageMode === "kitty")
|
|
|
148284
148292
|
var uiPrefs = loadPrefs();
|
|
148285
148293
|
var explicitInline = args.includes("--inline") || process.env.GEARBOX_INLINE === "1" || process.env.GEARBOX_FULLSCREEN === "0";
|
|
148286
148294
|
var explicitFullscreen = args.includes("--fullscreen") || process.env.GEARBOX_FULLSCREEN === "1";
|
|
148287
|
-
var wantsInline =
|
|
148295
|
+
var wantsInline = !explicitFullscreen && (explicitInline || uiPrefs.fullscreen !== true);
|
|
148288
148296
|
var wantsFullscreen = !wantsInline;
|
|
148289
148297
|
var fullscreen = Boolean(process.stdout.isTTY) && wantsFullscreen;
|
|
148290
148298
|
var mouse = Boolean(process.stdout.isTTY) && process.env.GEARBOX_MOUSE !== "0";
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
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
|
-
|
|
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
|
-
|
|
129
|
-
echo "
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
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
|
-
|
|
139
|
-
|
|
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
|
-
|
|
148
|
+
printf "${Y} setup incomplete — run: ${C}gearbox onboard${R}\n"
|
|
143
149
|
fi
|
|
144
150
|
else
|
|
145
|
-
|
|
151
|
+
printf "${D} no interactive terminal — run: ${C}gearbox onboard${R}\n"
|
|
146
152
|
fi
|
|
147
153
|
fi
|
package/package.json
CHANGED