@evident-ai/cli 3.2.0 → 3.2.1-dev.6d96a16

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/index.js CHANGED
@@ -212,6 +212,7 @@ var api = {
212
212
 
213
213
  // src/lib/keychain.ts
214
214
  var SERVICE_NAME = "evident-cli";
215
+ var keytarWarned = false;
215
216
  async function getKeytar() {
216
217
  try {
217
218
  const keytar = await import("keytar");
@@ -219,7 +220,13 @@ async function getKeytar() {
219
220
  return null;
220
221
  }
221
222
  return keytar;
222
- } catch {
223
+ } catch (err) {
224
+ if (!keytarWarned) {
225
+ keytarWarned = true;
226
+ console.warn(
227
+ `System keychain unavailable, falling back to file-based credential storage: ${err instanceof Error ? err.message : String(err)}`
228
+ );
229
+ }
223
230
  return null;
224
231
  }
225
232
  }
@@ -368,8 +375,9 @@ async function deviceFlowLogin(options) {
368
375
  await waitForEnter("Press Enter to open the browser...");
369
376
  try {
370
377
  await open(verification_uri);
371
- } catch {
372
- console.log(chalk2.dim("Could not open browser. Please visit the URL manually."));
378
+ } catch (error2) {
379
+ const message = error2 instanceof Error ? error2.message : String(error2);
380
+ console.log(chalk2.dim(`Could not open browser (${message}). Please visit the URL manually.`));
373
381
  }
374
382
  }
375
383
  const spinner = ora("Waiting for authentication...").start();
@@ -909,14 +917,25 @@ function readClaudeCliCredentials() {
909
917
  { encoding: "utf-8", timeout: 2e3, stdio: ["pipe", "pipe", "ignore"] }
910
918
  );
911
919
  return parseClaudeCliCredentials(raw);
912
- } catch {
920
+ } catch (err) {
921
+ if (err.status !== 44) {
922
+ console.warn(
923
+ `readClaudeCliCredentials: security find-generic-password failed: ${err instanceof Error ? err.message : String(err)}`
924
+ );
925
+ }
913
926
  return null;
914
927
  }
915
928
  }
916
929
  try {
917
930
  const raw = readFileSync(join(homedir(), ".claude", ".credentials.json"), "utf-8");
918
931
  return parseClaudeCliCredentials(raw);
919
- } catch {
932
+ } catch (err) {
933
+ const code = err.code;
934
+ if (code !== "ENOENT" && code !== "ENOTDIR") {
935
+ console.warn(
936
+ `readClaudeCliCredentials: reading .claude/.credentials.json failed: ${err instanceof Error ? err.message : String(err)}`
937
+ );
938
+ }
920
939
  return null;
921
940
  }
922
941
  }
@@ -1414,7 +1433,10 @@ function findOpenCodeProcesses() {
1414
1433
  }
1415
1434
  }
1416
1435
  }
1417
- } catch {
1436
+ } catch (err) {
1437
+ console.warn(
1438
+ `findOpenCodeProcesses: ps fallback failed: ${err instanceof Error ? err.message : String(err)}`
1439
+ );
1418
1440
  }
1419
1441
  }
1420
1442
  for (const pid of pids) {
@@ -1437,7 +1459,10 @@ function findOpenCodeProcesses() {
1437
1459
  }
1438
1460
  }
1439
1461
  }
1440
- } catch {
1462
+ } catch (err) {
1463
+ console.warn(
1464
+ `findOpenCodeProcesses: process detection failed: ${err instanceof Error ? err.message : String(err)}`
1465
+ );
1441
1466
  }
1442
1467
  return instances;
1443
1468
  }
@@ -1511,7 +1536,12 @@ function stopOpenCode(opencodeProcess) {
1511
1536
  } else {
1512
1537
  process.kill(-opencodeProcess.pid, "SIGTERM");
1513
1538
  }
1514
- } catch {
1539
+ } catch (err) {
1540
+ if (err.code !== "ESRCH") {
1541
+ console.warn(
1542
+ `stopOpenCode: kill failed: ${err instanceof Error ? err.message : String(err)}`
1543
+ );
1544
+ }
1515
1545
  }
1516
1546
  }
1517
1547
 
@@ -6826,7 +6856,9 @@ async function handleAuthError(state, error2) {
6826
6856
  );
6827
6857
  const newAuthHeader = getAuthHeader(credentials2);
6828
6858
  return { success: true, newAuthHeader };
6829
- } catch {
6859
+ } catch (error3) {
6860
+ const message = error3 instanceof Error ? error3.message : String(error3);
6861
+ logActivity(state, { type: "error", error: `Re-authentication failed: ${message}` });
6830
6862
  return { success: false };
6831
6863
  }
6832
6864
  }