add github token to codex

This commit is contained in:
Shawn Morreau
2025-11-13 14:29:53 -05:00
parent 3e547693ae
commit 7685d9ba49
4 changed files with 5921 additions and 6773 deletions
+6 -4
View File
@@ -28177,7 +28177,7 @@ var schema = ark.schema;
var define2 = ark.define;
var declare = ark.declare;
// ../node_modules/.pnpm/@anthropic-ai+claude-agent-sdk@0.1.37_zod@4.1.12/node_modules/@anthropic-ai/claude-agent-sdk/sdk.mjs
// ../node_modules/.pnpm/@anthropic-ai+claude-agent-sdk@0.1.37_zod@3.25.76/node_modules/@anthropic-ai/claude-agent-sdk/sdk.mjs
import { join as join3 } from "path";
import { fileURLToPath } from "url";
import { setMaxListeners } from "events";
@@ -41425,7 +41425,7 @@ var messageHandlers = {
// agents/codex.ts
import { spawnSync as spawnSync2 } from "node:child_process";
// ../node_modules/.pnpm/@openai+codex-sdk@0.58.0/node_modules/@openai/codex-sdk/dist/index.js
// ../node_modules/.pnpm/@openai+codex-sdk@0.57.0/node_modules/@openai/codex-sdk/dist/index.js
import { promises as fs2 } from "fs";
import os from "os";
import path2 from "path";
@@ -41759,8 +41759,9 @@ var codex = agent({
executablePath: "bin/codex.js"
});
},
run: async ({ prompt, mcpServers, apiKey, cliPath }) => {
run: async ({ prompt, mcpServers, apiKey, cliPath, githubInstallationToken }) => {
process.env.OPENAI_API_KEY = apiKey;
process.env.GITHUB_INSTALLATION_TOKEN = githubInstallationToken;
if (mcpServers && Object.keys(mcpServers).length > 0) {
configureMcpServers({ mcpServers, apiKey, cliPath });
}
@@ -41902,10 +41903,11 @@ function configureMcpServers({
const command = serverConfig.command;
const args2 = serverConfig.args || [];
const envVars = serverConfig.env || {};
const addArgs = ["mcp", "add", serverName, "--", command, ...args2];
const addArgs = ["mcp", "add", serverName];
for (const [key, value2] of Object.entries(envVars)) {
addArgs.push("--env", `${key}=${value2}`);
}
addArgs.push("--", command, ...args2);
log.info(`Adding MCP server '${serverName}'...`);
const addResult = spawnSync2("node", [cliPath, ...addArgs], {
stdio: "pipe",