@gonzih/cc-discord 0.2.3 → 0.2.4
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/meta-agent-manager.js +17 -5
- package/package.json +1 -1
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
* 4. spawnSession: claude --continue -p "{message}" pipes stdout → wire.discord.publishOutgoing
|
|
9
9
|
*/
|
|
10
10
|
import { spawn, execSync } from "child_process";
|
|
11
|
-
import { existsSync, mkdirSync, writeFileSync } from "fs";
|
|
11
|
+
import { existsSync, mkdirSync, readFileSync, writeFileSync } from "fs";
|
|
12
12
|
import { join } from "path";
|
|
13
13
|
import { homedir } from "os";
|
|
14
14
|
import { CC_DISCORD_WORKSPACE_ROOT, TIMING, discordMetaInputKey, } from "@gonzih/cc-wire";
|
|
@@ -74,19 +74,31 @@ export function injectMcp(ns, wsPath, token) {
|
|
|
74
74
|
},
|
|
75
75
|
},
|
|
76
76
|
};
|
|
77
|
-
//
|
|
77
|
+
// Merge extra MCP servers from ~/.config/cc-discord-mcp.json (credentials file, not in source)
|
|
78
|
+
const extraMcpPath = join(homedir(), ".config", "cc-discord-mcp.json");
|
|
79
|
+
if (existsSync(extraMcpPath)) {
|
|
80
|
+
try {
|
|
81
|
+
const extra = JSON.parse(readFileSync(extraMcpPath, "utf8"));
|
|
82
|
+
Object.assign(servers, extra);
|
|
83
|
+
console.log(`[meta-agent-manager] merged extra MCP servers from ${extraMcpPath}: ${Object.keys(extra).join(", ")}`);
|
|
84
|
+
}
|
|
85
|
+
catch (err) {
|
|
86
|
+
const msg = err instanceof Error ? err.message : String(err);
|
|
87
|
+
console.warn(`[meta-agent-manager] failed to read extra MCP config: ${msg}`);
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
// Also check env vars as fallback for gmail and github
|
|
78
91
|
const gmailEmail = process.env.GMAIL_EMAIL;
|
|
79
92
|
const gmailPass = process.env.GMAIL_APP_PASSWORD;
|
|
80
|
-
if (gmailEmail && gmailPass) {
|
|
93
|
+
if (gmailEmail && gmailPass && !servers["gmail-personal"]) {
|
|
81
94
|
servers["gmail-personal"] = {
|
|
82
95
|
command: "/opt/homebrew/bin/npx",
|
|
83
96
|
args: ["-y", "gmail-mcp-imap"],
|
|
84
97
|
env: { GMAIL_EMAIL: gmailEmail, GMAIL_APP_PASSWORD: gmailPass, npm_config_cache: npmCache },
|
|
85
98
|
};
|
|
86
99
|
}
|
|
87
|
-
// github MCP — enabled when GITHUB_PERSONAL_ACCESS_TOKEN is in env
|
|
88
100
|
const ghToken = process.env.GITHUB_PERSONAL_ACCESS_TOKEN;
|
|
89
|
-
if (ghToken) {
|
|
101
|
+
if (ghToken && !servers["github"]) {
|
|
90
102
|
servers["github"] = {
|
|
91
103
|
command: "docker",
|
|
92
104
|
args: ["run", "-i", "--rm", "-e", "GITHUB_PERSONAL_ACCESS_TOKEN", "ghcr.io/github/github-mcp-server"],
|