@episoda/cli 0.2.159 → 0.2.160
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/daemon/daemon-process.js +31 -14
- package/dist/daemon/daemon-process.js.map +1 -1
- package/dist/index.js +48 -18
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -2909,7 +2909,7 @@ var require_package = __commonJS({
|
|
|
2909
2909
|
"package.json"(exports2, module2) {
|
|
2910
2910
|
module2.exports = {
|
|
2911
2911
|
name: "@episoda/cli",
|
|
2912
|
-
version: "0.2.
|
|
2912
|
+
version: "0.2.160",
|
|
2913
2913
|
description: "CLI tool for Episoda local development workflow orchestration",
|
|
2914
2914
|
main: "dist/index.js",
|
|
2915
2915
|
types: "dist/index.d.ts",
|
|
@@ -6410,6 +6410,24 @@ var path10 = __toESM(require("path"));
|
|
|
6410
6410
|
var fs9 = __toESM(require("fs"));
|
|
6411
6411
|
var os4 = __toESM(require("os"));
|
|
6412
6412
|
var import_core8 = __toESM(require_dist());
|
|
6413
|
+
|
|
6414
|
+
// src/utils/github-token.ts
|
|
6415
|
+
var INVALID_GITHUB_TOKEN_LITERALS = /* @__PURE__ */ new Set([
|
|
6416
|
+
"${GITHUB_PERSONAL_ACCESS_TOKEN}",
|
|
6417
|
+
"undefined",
|
|
6418
|
+
"null",
|
|
6419
|
+
'""',
|
|
6420
|
+
"''"
|
|
6421
|
+
]);
|
|
6422
|
+
function sanitizeGithubToken(token) {
|
|
6423
|
+
if (token === void 0) return "";
|
|
6424
|
+
const trimmed = token.trim();
|
|
6425
|
+
if (!trimmed) return "";
|
|
6426
|
+
if (INVALID_GITHUB_TOKEN_LITERALS.has(trimmed)) return "";
|
|
6427
|
+
return trimmed;
|
|
6428
|
+
}
|
|
6429
|
+
|
|
6430
|
+
// src/agent/mcp-server-configurator.ts
|
|
6413
6431
|
var McpServerConfigurator = class {
|
|
6414
6432
|
// ---------------------------------------------------------------------------
|
|
6415
6433
|
// MCP Auth Resolution
|
|
@@ -6479,10 +6497,10 @@ var McpServerConfigurator = class {
|
|
|
6479
6497
|
}
|
|
6480
6498
|
servers.push({
|
|
6481
6499
|
name: "github",
|
|
6482
|
-
command: "
|
|
6500
|
+
command: "bash scripts/github-mcp-server.sh"
|
|
6483
6501
|
});
|
|
6484
|
-
if (!session.credentials.githubToken) {
|
|
6485
|
-
console.warn(
|
|
6502
|
+
if (!sanitizeGithubToken(session.credentials.githubToken)) {
|
|
6503
|
+
console.warn('[McpServerConfigurator] EP1377: GitHub MCP registered without token \u2014 GitHub tools may fail with "Requires authentication"');
|
|
6486
6504
|
} else {
|
|
6487
6505
|
console.log("[McpServerConfigurator] EP1251: GitHub MCP server registered");
|
|
6488
6506
|
}
|
|
@@ -7369,9 +7387,10 @@ ${message}`;
|
|
|
7369
7387
|
if (sessionToken) {
|
|
7370
7388
|
episodaMcpEnv.EPISODA_SESSION_TOKEN = sessionToken;
|
|
7371
7389
|
}
|
|
7390
|
+
const githubToken = sanitizeGithubToken(session.credentials.githubToken);
|
|
7372
7391
|
const githubMcpEnv = {
|
|
7373
7392
|
...baseEnv,
|
|
7374
|
-
GITHUB_PERSONAL_ACCESS_TOKEN:
|
|
7393
|
+
GITHUB_PERSONAL_ACCESS_TOKEN: githubToken
|
|
7375
7394
|
};
|
|
7376
7395
|
for (const mcpServer of mcpServersToRegister) {
|
|
7377
7396
|
const parts = mcpServer.command.split(" ");
|
|
@@ -7506,10 +7525,7 @@ ${message}`;
|
|
|
7506
7525
|
const args2 = parts.slice(1);
|
|
7507
7526
|
let env;
|
|
7508
7527
|
if (server.name === "github") {
|
|
7509
|
-
env = {
|
|
7510
|
-
...baseEnv,
|
|
7511
|
-
GITHUB_PERSONAL_ACCESS_TOKEN: session.credentials.githubToken || ""
|
|
7512
|
-
};
|
|
7528
|
+
env = { ...baseEnv };
|
|
7513
7529
|
} else {
|
|
7514
7530
|
env = {
|
|
7515
7531
|
...baseEnv,
|
|
@@ -7629,9 +7645,10 @@ ${message}`;
|
|
|
7629
7645
|
console.warn("[AgentManager] EP1287: No session token available for MCP servers");
|
|
7630
7646
|
}
|
|
7631
7647
|
}
|
|
7632
|
-
|
|
7633
|
-
|
|
7634
|
-
|
|
7648
|
+
const processGithubToken = sanitizeGithubToken(session.credentials.githubToken);
|
|
7649
|
+
if (processGithubToken) {
|
|
7650
|
+
envVars.GITHUB_PERSONAL_ACCESS_TOKEN = processGithubToken;
|
|
7651
|
+
console.log("[AgentManager] EP1377: Set GITHUB_PERSONAL_ACCESS_TOKEN for GitHub MCP");
|
|
7635
7652
|
}
|
|
7636
7653
|
if (useApiKey && session.credentials.apiKey) {
|
|
7637
7654
|
if (provider === "codex") {
|
|
@@ -14349,9 +14366,9 @@ var Daemon = class _Daemon {
|
|
|
14349
14366
|
});
|
|
14350
14367
|
if (!process.env.EPISODA_CONTAINER_ID) {
|
|
14351
14368
|
if (process.env.GITHUB_PERSONAL_ACCESS_TOKEN) {
|
|
14352
|
-
console.log("[Daemon]
|
|
14369
|
+
console.log("[Daemon] EP1377: GITHUB_PERSONAL_ACCESS_TOKEN is set in environment");
|
|
14353
14370
|
} else {
|
|
14354
|
-
console.
|
|
14371
|
+
console.log("[Daemon] EP1377: GITHUB_PERSONAL_ACCESS_TOKEN not set in daemon env (OK - daemon sessions inject token via credentials, local CLI uses scripts/github-mcp-server.sh)");
|
|
14355
14372
|
}
|
|
14356
14373
|
}
|
|
14357
14374
|
this.updateManager.checkOnStartup();
|