patchcord 0.3.36 → 0.3.37
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/bin/patchcord.mjs +11 -1
- package/package.json +1 -1
package/bin/patchcord.mjs
CHANGED
|
@@ -547,7 +547,17 @@ if (!cmd || cmd === "install" || cmd === "agent") {
|
|
|
547
547
|
const configPath = join(codexDir, "config.toml");
|
|
548
548
|
let existing = existsSync(configPath) ? readFileSync(configPath, "utf-8") : "";
|
|
549
549
|
if (!existing.includes("[mcp_servers.patchcord]")) {
|
|
550
|
-
|
|
550
|
+
// Codex requires bearer_token via env var — http_headers not supported for auth
|
|
551
|
+
const envName = "PATCHCORD_TOKEN";
|
|
552
|
+
process.env[envName] = token;
|
|
553
|
+
// Write token to project .env for persistence
|
|
554
|
+
const envPath = join(cwd, ".env");
|
|
555
|
+
let envContent = existsSync(envPath) ? readFileSync(envPath, "utf-8") : "";
|
|
556
|
+
if (!envContent.includes(envName)) {
|
|
557
|
+
envContent = envContent.trimEnd() + `\n${envName}=${token}\n`;
|
|
558
|
+
writeFileSync(envPath, envContent);
|
|
559
|
+
}
|
|
560
|
+
existing = existing.trimEnd() + `\n\n[mcp_servers.patchcord]\nurl = "${serverUrl}/mcp/bearer"\nbearer_token_env_var = "${envName}"\n`;
|
|
551
561
|
writeFileSync(configPath, existing);
|
|
552
562
|
}
|
|
553
563
|
// Slash commands (.codex/prompts/)
|