gearbox-code 0.1.33 → 0.1.35
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 +32 -12
- package/package.json +1 -1
package/dist/cli.mjs
CHANGED
|
@@ -105932,6 +105932,7 @@ __export(exports_store, {
|
|
|
105932
105932
|
accountsForProvider: () => accountsForProvider
|
|
105933
105933
|
});
|
|
105934
105934
|
import { createCipheriv, createDecipheriv, randomBytes } from "node:crypto";
|
|
105935
|
+
import { execFileSync } from "node:child_process";
|
|
105935
105936
|
import { readFileSync as readFileSync3, writeFileSync as writeFileSync2, mkdirSync as mkdirSync2, existsSync as existsSync2 } from "node:fs";
|
|
105936
105937
|
import { join as join3 } from "node:path";
|
|
105937
105938
|
import { homedir as homedir2 } from "node:os";
|
|
@@ -105958,7 +105959,27 @@ async function getSecret(ref) {
|
|
|
105958
105959
|
return null;
|
|
105959
105960
|
}
|
|
105960
105961
|
}
|
|
105961
|
-
|
|
105962
|
+
const f3 = fileGet(ref);
|
|
105963
|
+
if (f3 != null)
|
|
105964
|
+
return f3;
|
|
105965
|
+
if (typeof Bun === "undefined" && mode() !== "file") {
|
|
105966
|
+
return keychainCliGet(ref);
|
|
105967
|
+
}
|
|
105968
|
+
return null;
|
|
105969
|
+
}
|
|
105970
|
+
function keychainCliGet(ref) {
|
|
105971
|
+
if (process.platform !== "darwin")
|
|
105972
|
+
return null;
|
|
105973
|
+
try {
|
|
105974
|
+
const out = execFileSync("security", ["find-generic-password", "-s", SERVICE, "-a", ref, "-w"], {
|
|
105975
|
+
encoding: "utf8",
|
|
105976
|
+
stdio: ["ignore", "pipe", "ignore"]
|
|
105977
|
+
});
|
|
105978
|
+
const v = out.replace(/\n+$/, "");
|
|
105979
|
+
return v.length ? v : null;
|
|
105980
|
+
} catch {
|
|
105981
|
+
return null;
|
|
105982
|
+
}
|
|
105962
105983
|
}
|
|
105963
105984
|
async function deleteSecret(ref) {
|
|
105964
105985
|
if (typeof Bun !== "undefined" && mode() !== "file") {
|
|
@@ -119039,14 +119060,14 @@ __export(exports_proc, {
|
|
|
119039
119060
|
readStream: () => readStream,
|
|
119040
119061
|
Glob: () => Glob
|
|
119041
119062
|
});
|
|
119042
|
-
import { spawn, spawnSync as nodeSpawnSync, execFileSync } from "node:child_process";
|
|
119063
|
+
import { spawn, spawnSync as nodeSpawnSync, execFileSync as execFileSync2 } from "node:child_process";
|
|
119043
119064
|
import { readdirSync as readdirSync2, statSync as statSync2 } from "node:fs";
|
|
119044
119065
|
import { writeFile } from "node:fs/promises";
|
|
119045
119066
|
import { resolve as resolve6 } from "node:path";
|
|
119046
119067
|
function which(bin) {
|
|
119047
119068
|
try {
|
|
119048
119069
|
const cmd = process.platform === "win32" ? "where" : "which";
|
|
119049
|
-
const out =
|
|
119070
|
+
const out = execFileSync2(cmd, [bin], {
|
|
119050
119071
|
encoding: "utf8",
|
|
119051
119072
|
stdio: ["ignore", "pipe", "ignore"]
|
|
119052
119073
|
});
|
|
@@ -135602,7 +135623,7 @@ var import_react20 = __toESM(require_react(), 1);
|
|
|
135602
135623
|
var import_react21 = __toESM(require_react(), 1);
|
|
135603
135624
|
// src/cli.tsx
|
|
135604
135625
|
import { createInterface } from "node:readline/promises";
|
|
135605
|
-
import { execFileSync as
|
|
135626
|
+
import { execFileSync as execFileSync5, spawnSync } from "node:child_process";
|
|
135606
135627
|
import { resolve as resolve13 } from "node:path";
|
|
135607
135628
|
import { existsSync as existsSync12 } from "node:fs";
|
|
135608
135629
|
|
|
@@ -143761,7 +143782,7 @@ import { readFileSync as readFileSync10 } from "node:fs";
|
|
|
143761
143782
|
import { resolve as resolve9 } from "node:path";
|
|
143762
143783
|
|
|
143763
143784
|
// src/ui/files.ts
|
|
143764
|
-
import { execFileSync as
|
|
143785
|
+
import { execFileSync as execFileSync3 } from "node:child_process";
|
|
143765
143786
|
import { readdirSync as readdirSync3, statSync as statSync3, existsSync as existsSync6, readFileSync as readFileSync9 } from "node:fs";
|
|
143766
143787
|
import { join as join9, relative as relative2, resolve as resolve8 } from "node:path";
|
|
143767
143788
|
var IGNORE2 = new Set(["node_modules", ".git", "dist", ".next", "build", "coverage"]);
|
|
@@ -143772,7 +143793,7 @@ function listProjectFiles(cwd2 = process.cwd()) {
|
|
|
143772
143793
|
if (cache4)
|
|
143773
143794
|
return cache4;
|
|
143774
143795
|
try {
|
|
143775
|
-
const out =
|
|
143796
|
+
const out = execFileSync3("git", ["ls-files"], { cwd: cwd2, encoding: "utf8", timeout: 2000, stdio: ["ignore", "pipe", "ignore"] });
|
|
143776
143797
|
const files2 = out.split(`
|
|
143777
143798
|
`).map((s2) => s2.trim()).filter(Boolean);
|
|
143778
143799
|
if (files2.length)
|
|
@@ -145667,13 +145688,13 @@ function isNetworkError(e2) {
|
|
|
145667
145688
|
}
|
|
145668
145689
|
|
|
145669
145690
|
// src/ui/git.ts
|
|
145670
|
-
import { execFileSync as
|
|
145691
|
+
import { execFileSync as execFileSync4 } from "node:child_process";
|
|
145671
145692
|
var cached4;
|
|
145672
145693
|
function gitBranch() {
|
|
145673
145694
|
if (cached4 !== undefined)
|
|
145674
145695
|
return cached4;
|
|
145675
145696
|
try {
|
|
145676
|
-
const out =
|
|
145697
|
+
const out = execFileSync4("git", ["rev-parse", "--abbrev-ref", "HEAD"], {
|
|
145677
145698
|
cwd: process.cwd(),
|
|
145678
145699
|
encoding: "utf8",
|
|
145679
145700
|
stdio: ["ignore", "pipe", "ignore"],
|
|
@@ -146746,9 +146767,8 @@ function App2({ selector: initialSelector, runner, fullscreen = false, resumeId
|
|
|
146746
146767
|
onEvent({ type: "error", message: "Gearbox docs aren't bundled with this install — can't answer from them." });
|
|
146747
146768
|
return { messages, usage: { inputTokens: 0, outputTokens: 0 } };
|
|
146748
146769
|
}
|
|
146749
|
-
const choice3 =
|
|
146770
|
+
const choice3 = new RoutingSelector().select({ prompt, kind: "search" });
|
|
146750
146771
|
routedRef.current = { model: choice3.model, reason: choice3.reason };
|
|
146751
|
-
setLastPick({ model: choice3.model, reason: choice3.reason });
|
|
146752
146772
|
onEvent({ type: "model-pick", model: choice3.model.label, provider: choice3.model.provider, reason: choice3.reason });
|
|
146753
146773
|
const acct = accountResolver.pick(choice3.model.provider);
|
|
146754
146774
|
const creds2 = acct ? await resolveCreds(acct) : undefined;
|
|
@@ -149081,9 +149101,9 @@ if (args[0] === "upgrade" || args[0] === "update") {
|
|
|
149081
149101
|
}
|
|
149082
149102
|
try {
|
|
149083
149103
|
console.log("→ Pulling latest…");
|
|
149084
|
-
console.log(
|
|
149104
|
+
console.log(execFileSync5("git", ["-C", root2, "pull", "--ff-only"], { encoding: "utf8" }).trim());
|
|
149085
149105
|
console.log("→ Installing dependencies…");
|
|
149086
|
-
|
|
149106
|
+
execFileSync5("bun", ["install"], { cwd: root2, stdio: "inherit" });
|
|
149087
149107
|
console.log("✓ Gearbox is up to date. Restart any running session to use the new version.");
|
|
149088
149108
|
} catch (e2) {
|
|
149089
149109
|
console.log("Upgrade failed: " + (e2?.message ?? String(e2)));
|
package/package.json
CHANGED