@lousy-agents/cli 3.0.0 → 3.1.0

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.
@@ -45708,18 +45708,16 @@ function defaultExec(command, args, options) {
45708
45708
  }
45709
45709
  /**
45710
45710
  * Resolves a GitHub token from GH_TOKEN/GITHUB_TOKEN env vars, with gh CLI fallback
45711
- */ async function resolveGitHubToken() {
45712
- const envToken = process.env.GH_TOKEN || process.env.GITHUB_TOKEN;
45711
+ */ async function resolveGitHubToken(exec = defaultExec) {
45712
+ const envToken = process.env.GH_TOKEN?.trim() || process.env.GITHUB_TOKEN?.trim();
45713
45713
  if (envToken) {
45714
45714
  return envToken;
45715
45715
  }
45716
45716
  try {
45717
- const { stdout } = await execFileAsync("gh", [
45717
+ const { stdout } = await exec("gh", [
45718
45718
  "auth",
45719
45719
  "token"
45720
- ], {
45721
- encoding: "utf-8"
45722
- });
45720
+ ]);
45723
45721
  const token = stdout.trim();
45724
45722
  return token || null;
45725
45723
  } catch {