gearbox-code 0.1.34 → 0.1.36

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 (2) hide show
  1. package/dist/cli.mjs +35 -11
  2. 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
- return fileGet(ref);
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 = execFileSync(cmd, [bin], {
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 execFileSync4, spawnSync } from "node:child_process";
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
 
@@ -142603,6 +142624,7 @@ function updatePrefs(patch) {
142603
142624
 
142604
142625
  // src/config.ts
142605
142626
  init_providers();
142627
+ init_store();
142606
142628
  var config2 = {
142607
142629
  defaultModelId: process.env.GEARBOX_MODEL ?? "claude-sonnet-4-6",
142608
142630
  maxSteps: Number(process.env.GEARBOX_MAX_STEPS ?? 24)
@@ -142615,7 +142637,9 @@ function pickDefaultModel(preferredId) {
142615
142637
  return modelRegistry().find((m2) => providerAvailable(m2.provider));
142616
142638
  }
142617
142639
  function anyProviderAvailable() {
142618
- return modelRegistry().some((m2) => providerAvailable(m2.provider));
142640
+ if (modelRegistry().some((m2) => providerAvailable(m2.provider)))
142641
+ return true;
142642
+ return listAccounts().some((a) => a.enabled && a.exec === "cli");
142619
142643
  }
142620
142644
 
142621
142645
  // src/model/selector.ts
@@ -143761,7 +143785,7 @@ import { readFileSync as readFileSync10 } from "node:fs";
143761
143785
  import { resolve as resolve9 } from "node:path";
143762
143786
 
143763
143787
  // src/ui/files.ts
143764
- import { execFileSync as execFileSync2 } from "node:child_process";
143788
+ import { execFileSync as execFileSync3 } from "node:child_process";
143765
143789
  import { readdirSync as readdirSync3, statSync as statSync3, existsSync as existsSync6, readFileSync as readFileSync9 } from "node:fs";
143766
143790
  import { join as join9, relative as relative2, resolve as resolve8 } from "node:path";
143767
143791
  var IGNORE2 = new Set(["node_modules", ".git", "dist", ".next", "build", "coverage"]);
@@ -143772,7 +143796,7 @@ function listProjectFiles(cwd2 = process.cwd()) {
143772
143796
  if (cache4)
143773
143797
  return cache4;
143774
143798
  try {
143775
- const out = execFileSync2("git", ["ls-files"], { cwd: cwd2, encoding: "utf8", timeout: 2000, stdio: ["ignore", "pipe", "ignore"] });
143799
+ const out = execFileSync3("git", ["ls-files"], { cwd: cwd2, encoding: "utf8", timeout: 2000, stdio: ["ignore", "pipe", "ignore"] });
143776
143800
  const files2 = out.split(`
143777
143801
  `).map((s2) => s2.trim()).filter(Boolean);
143778
143802
  if (files2.length)
@@ -145667,13 +145691,13 @@ function isNetworkError(e2) {
145667
145691
  }
145668
145692
 
145669
145693
  // src/ui/git.ts
145670
- import { execFileSync as execFileSync3 } from "node:child_process";
145694
+ import { execFileSync as execFileSync4 } from "node:child_process";
145671
145695
  var cached4;
145672
145696
  function gitBranch() {
145673
145697
  if (cached4 !== undefined)
145674
145698
  return cached4;
145675
145699
  try {
145676
- const out = execFileSync3("git", ["rev-parse", "--abbrev-ref", "HEAD"], {
145700
+ const out = execFileSync4("git", ["rev-parse", "--abbrev-ref", "HEAD"], {
145677
145701
  cwd: process.cwd(),
145678
145702
  encoding: "utf8",
145679
145703
  stdio: ["ignore", "pipe", "ignore"],
@@ -149080,9 +149104,9 @@ if (args[0] === "upgrade" || args[0] === "update") {
149080
149104
  }
149081
149105
  try {
149082
149106
  console.log("→ Pulling latest…");
149083
- console.log(execFileSync4("git", ["-C", root2, "pull", "--ff-only"], { encoding: "utf8" }).trim());
149107
+ console.log(execFileSync5("git", ["-C", root2, "pull", "--ff-only"], { encoding: "utf8" }).trim());
149084
149108
  console.log("→ Installing dependencies…");
149085
- execFileSync4("bun", ["install"], { cwd: root2, stdio: "inherit" });
149109
+ execFileSync5("bun", ["install"], { cwd: root2, stdio: "inherit" });
149086
149110
  console.log("✓ Gearbox is up to date. Restart any running session to use the new version.");
149087
149111
  } catch (e2) {
149088
149112
  console.log("Upgrade failed: " + (e2?.message ?? String(e2)));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gearbox-code",
3
- "version": "0.1.34",
3
+ "version": "0.1.36",
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",