@episoda/cli 0.2.159 → 0.2.161

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
@@ -4017,8 +4017,8 @@ var WorktreeManager = class _WorktreeManager {
4017
4017
  console.log(`[WorktreeManager] EP959: Timeout: ${TIMEOUT_MINUTES} minutes`);
4018
4018
  console.log(`[WorktreeManager] EP959: Script: ${scriptPreview}`);
4019
4019
  try {
4020
- const { execSync: execSync10 } = require("child_process");
4021
- execSync10(script, {
4020
+ const { execSync: execSync11 } = require("child_process");
4021
+ execSync11(script, {
4022
4022
  cwd: worktree.worktreePath,
4023
4023
  stdio: "inherit",
4024
4024
  timeout: TIMEOUT_MINUTES * 60 * 1e3,
@@ -4052,8 +4052,8 @@ var WorktreeManager = class _WorktreeManager {
4052
4052
  console.log(`[WorktreeManager] EP959: Timeout: ${TIMEOUT_MINUTES} minutes`);
4053
4053
  console.log(`[WorktreeManager] EP959: Script: ${scriptPreview}`);
4054
4054
  try {
4055
- const { execSync: execSync10 } = require("child_process");
4056
- execSync10(script, {
4055
+ const { execSync: execSync11 } = require("child_process");
4056
+ execSync11(script, {
4057
4057
  cwd: worktree.worktreePath,
4058
4058
  stdio: "inherit",
4059
4059
  timeout: TIMEOUT_MINUTES * 60 * 1e3,
@@ -5479,6 +5479,7 @@ ${exportLine}
5479
5479
  }
5480
5480
 
5481
5481
  // src/commands/status.ts
5482
+ var import_child_process10 = require("child_process");
5482
5483
  var import_core8 = __toESM(require_dist());
5483
5484
 
5484
5485
  // src/utils/update-checker.ts
@@ -5619,6 +5620,22 @@ function getInstalledVersion() {
5619
5620
  }
5620
5621
  }
5621
5622
 
5623
+ // src/utils/github-token.ts
5624
+ var INVALID_GITHUB_TOKEN_LITERALS = /* @__PURE__ */ new Set([
5625
+ "${GITHUB_PERSONAL_ACCESS_TOKEN}",
5626
+ "undefined",
5627
+ "null",
5628
+ '""',
5629
+ "''"
5630
+ ]);
5631
+ function sanitizeGithubToken(token) {
5632
+ if (token === void 0) return "";
5633
+ const trimmed = token.trim();
5634
+ if (!trimmed) return "";
5635
+ if (INVALID_GITHUB_TOKEN_LITERALS.has(trimmed)) return "";
5636
+ return trimmed;
5637
+ }
5638
+
5622
5639
  // src/commands/status.ts
5623
5640
  async function statusCommand(options = {}) {
5624
5641
  status.info("Checking CLI status...");
@@ -5750,12 +5767,25 @@ async function statusCommand(options = {}) {
5750
5767
  }
5751
5768
  status.info("");
5752
5769
  status.info("MCP Configuration:");
5753
- if (process.env.GITHUB_PERSONAL_ACCESS_TOKEN) {
5770
+ const envGithubToken = sanitizeGithubToken(process.env.GITHUB_PERSONAL_ACCESS_TOKEN);
5771
+ if (envGithubToken) {
5754
5772
  status.success(" \u2713 GitHub MCP token available (GITHUB_PERSONAL_ACCESS_TOKEN is set)");
5755
5773
  } else {
5756
- status.warning(" \u26A0 GitHub MCP token missing (GITHUB_PERSONAL_ACCESS_TOKEN not set)");
5757
- status.info(' GitHub MCP tools will fail with "Requires authentication".');
5758
- status.info(" Fix: export GITHUB_PERSONAL_ACCESS_TOKEN=$(gh auth token)");
5774
+ let ghAuthAvailable = false;
5775
+ try {
5776
+ const ghToken = (0, import_child_process10.execSync)("gh auth token", { encoding: "utf8", timeout: 5e3, stdio: ["pipe", "pipe", "pipe"] }).trim();
5777
+ ghAuthAvailable = ghToken.length > 0;
5778
+ } catch {
5779
+ }
5780
+ if (ghAuthAvailable) {
5781
+ status.success(" \u2713 GitHub MCP token available (via gh auth)");
5782
+ status.info(' The portable launcher (scripts/github-mcp-server.sh) will use "gh auth token" automatically.');
5783
+ } else {
5784
+ status.warning(" \u26A0 GitHub MCP token missing");
5785
+ status.info(' GitHub MCP tools will fail with "Requires authentication".');
5786
+ status.info(" Fix: gh auth login # Authenticate GitHub CLI (recommended)");
5787
+ status.info(" Alt: export GITHUB_PERSONAL_ACCESS_TOKEN=ghp_...");
5788
+ }
5759
5789
  }
5760
5790
  if (options.verify) {
5761
5791
  status.info("");
@@ -6626,7 +6656,7 @@ async function listWorktrees(options) {
6626
6656
  }
6627
6657
 
6628
6658
  // src/commands/update.ts
6629
- var import_child_process10 = require("child_process");
6659
+ var import_child_process11 = require("child_process");
6630
6660
  var import_core14 = __toESM(require_dist());
6631
6661
  async function isDaemonRunning2() {
6632
6662
  try {
@@ -6638,7 +6668,7 @@ async function isDaemonRunning2() {
6638
6668
  }
6639
6669
  function stopDaemon2() {
6640
6670
  try {
6641
- (0, import_child_process10.execSync)("episoda stop", { stdio: "pipe" });
6671
+ (0, import_child_process11.execSync)("episoda stop", { stdio: "pipe" });
6642
6672
  return true;
6643
6673
  } catch {
6644
6674
  return false;
@@ -6646,7 +6676,7 @@ function stopDaemon2() {
6646
6676
  }
6647
6677
  function startDaemon2() {
6648
6678
  try {
6649
- const child = (0, import_child_process10.spawn)("episoda", ["dev"], {
6679
+ const child = (0, import_child_process11.spawn)("episoda", ["dev"], {
6650
6680
  detached: true,
6651
6681
  stdio: "ignore",
6652
6682
  shell: process.platform === "win32"
@@ -6659,7 +6689,7 @@ function startDaemon2() {
6659
6689
  }
6660
6690
  function performUpdate(targetVersion) {
6661
6691
  try {
6662
- (0, import_child_process10.execSync)(`npm install -g ${PACKAGE_NAME}@${targetVersion}`, {
6692
+ (0, import_child_process11.execSync)(`npm install -g ${PACKAGE_NAME}@${targetVersion}`, {
6663
6693
  stdio: "pipe",
6664
6694
  timeout: 12e4
6665
6695
  // 2 minute timeout
@@ -6787,7 +6817,7 @@ async function setupCommand(options = {}) {
6787
6817
  }
6788
6818
 
6789
6819
  // src/commands/run.ts
6790
- var import_child_process11 = require("child_process");
6820
+ var import_child_process12 = require("child_process");
6791
6821
  var import_core15 = __toESM(require_dist());
6792
6822
 
6793
6823
  // src/utils/env-cache.ts
@@ -6945,7 +6975,7 @@ async function runCommand(args, options = {}) {
6945
6975
  status.info(`Running: ${command} ${commandArgs.join(" ")}`);
6946
6976
  status.info("");
6947
6977
  }
6948
- const child = (0, import_child_process11.spawn)(command, commandArgs, {
6978
+ const child = (0, import_child_process12.spawn)(command, commandArgs, {
6949
6979
  stdio: "inherit",
6950
6980
  env: mergedEnv,
6951
6981
  shell: process.platform === "win32"
@@ -6996,7 +7026,7 @@ function signalToNumber(signal) {
6996
7026
  }
6997
7027
 
6998
7028
  // src/commands/shell.ts
6999
- var import_child_process12 = require("child_process");
7029
+ var import_child_process13 = require("child_process");
7000
7030
  var import_core16 = __toESM(require_dist());
7001
7031
  async function shellCommand(shell, options = {}) {
7002
7032
  const config = await (0, import_core16.loadConfig)();
@@ -7040,7 +7070,7 @@ async function shellCommand(shell, options = {}) {
7040
7070
  // Set a marker so users know they're in an episoda shell
7041
7071
  EPISODA_SHELL: "1"
7042
7072
  };
7043
- const child = (0, import_child_process12.spawn)(targetShell, [], {
7073
+ const child = (0, import_child_process13.spawn)(targetShell, [], {
7044
7074
  stdio: "inherit",
7045
7075
  env: mergedEnv
7046
7076
  });
@@ -7313,10 +7343,10 @@ async function promptForValue(key) {
7313
7343
  }
7314
7344
 
7315
7345
  // src/commands/migrations.ts
7316
- var import_child_process13 = require("child_process");
7346
+ var import_child_process14 = require("child_process");
7317
7347
  var import_util = require("util");
7318
7348
  var import_path = __toESM(require("path"));
7319
- var exec = (0, import_util.promisify)(import_child_process13.exec);
7349
+ var exec = (0, import_util.promisify)(import_child_process14.exec);
7320
7350
  function getDefaultMigrationDir() {
7321
7351
  return process.env.EPISODA_MIGRATION_DIR || "supabase/migrations";
7322
7352
  }