From 11733918e55c594c42762b1a3f8705f145e37cc7 Mon Sep 17 00:00:00 2001 From: Haileyesus Date: Fri, 10 Apr 2026 16:37:47 +0300 Subject: [PATCH] fix: replace child_process with cross-spawn --- server/cursor-cli.js | 2 +- server/gemini-cli.js | 2 +- server/index.js | 2 +- server/routes/agent.js | 2 +- server/routes/cli-auth.js | 2 +- server/routes/codex.js | 2 +- server/routes/cursor.js | 4 ++-- server/routes/git.js | 2 +- server/routes/mcp.js | 4 ++-- server/routes/projects.js | 2 +- server/routes/taskmaster.js | 2 +- server/routes/user.js | 2 +- server/utils/gitConfig.js | 2 +- server/utils/plugin-loader.js | 2 +- server/utils/plugin-process-manager.js | 2 +- 15 files changed, 17 insertions(+), 17 deletions(-) diff --git a/server/cursor-cli.js b/server/cursor-cli.js index aedd7e0b..b86facb5 100644 --- a/server/cursor-cli.js +++ b/server/cursor-cli.js @@ -1,4 +1,4 @@ -import { spawn } from 'child_process'; +import { spawn } from 'cross-spawn'; import crossSpawn from 'cross-spawn'; import { notifyRunFailed, notifyRunStopped } from './services/notification-orchestrator.js'; import { cursorAdapter } from './providers/cursor/adapter.js'; diff --git a/server/gemini-cli.js b/server/gemini-cli.js index 86472707..8d679e56 100644 --- a/server/gemini-cli.js +++ b/server/gemini-cli.js @@ -1,4 +1,4 @@ -import { spawn } from 'child_process'; +import { spawn } from 'cross-spawn'; import crossSpawn from 'cross-spawn'; // Use cross-spawn on Windows for correct .cmd resolution (same pattern as cursor-cli.js) diff --git a/server/index.js b/server/index.js index 235f143b..5e7fd605 100755 --- a/server/index.js +++ b/server/index.js @@ -39,7 +39,7 @@ import os from 'os'; import http from 'http'; import cors from 'cors'; import { promises as fsPromises } from 'fs'; -import { spawn } from 'child_process'; +import { spawn } from 'cross-spawn'; import pty from 'node-pty'; import fetch from 'node-fetch'; import mime from 'mime-types'; diff --git a/server/routes/agent.js b/server/routes/agent.js index d027b91c..6c97e2fb 100644 --- a/server/routes/agent.js +++ b/server/routes/agent.js @@ -1,5 +1,5 @@ import express from 'express'; -import { spawn } from 'child_process'; +import { spawn } from 'cross-spawn'; import path from 'path'; import os from 'os'; import { promises as fs } from 'fs'; diff --git a/server/routes/cli-auth.js b/server/routes/cli-auth.js index 78ffa30b..265c5ac4 100644 --- a/server/routes/cli-auth.js +++ b/server/routes/cli-auth.js @@ -1,5 +1,5 @@ import express from 'express'; -import { spawn } from 'child_process'; +import { spawn } from 'cross-spawn'; import fs from 'fs/promises'; import path from 'path'; import os from 'os'; diff --git a/server/routes/codex.js b/server/routes/codex.js index 3855548e..5e61d524 100644 --- a/server/routes/codex.js +++ b/server/routes/codex.js @@ -1,5 +1,5 @@ import express from 'express'; -import { spawn } from 'child_process'; +import { spawn } from 'cross-spawn'; import { promises as fs } from 'fs'; import path from 'path'; import os from 'os'; diff --git a/server/routes/cursor.js b/server/routes/cursor.js index 02269e45..8dc89b06 100644 --- a/server/routes/cursor.js +++ b/server/routes/cursor.js @@ -2,7 +2,7 @@ import express from 'express'; import { promises as fs } from 'fs'; import path from 'path'; import os from 'os'; -import { spawn } from 'child_process'; +import { spawn } from 'cross-spawn'; import sqlite3 from 'sqlite3'; import { open } from 'sqlite'; import crypto from 'crypto'; @@ -795,4 +795,4 @@ router.get('/sessions/:sessionId', async (req, res) => { } }); -export default router; \ No newline at end of file +export default router; diff --git a/server/routes/git.js b/server/routes/git.js index a4395638..be390561 100755 --- a/server/routes/git.js +++ b/server/routes/git.js @@ -1,5 +1,5 @@ import express from 'express'; -import { spawn } from 'child_process'; +import { spawn } from 'cross-spawn'; import path from 'path'; import { promises as fs } from 'fs'; import { extractProjectDirectory } from '../projects.js'; diff --git a/server/routes/mcp.js b/server/routes/mcp.js index 080be6ab..dfb76d18 100644 --- a/server/routes/mcp.js +++ b/server/routes/mcp.js @@ -4,7 +4,7 @@ import path from 'path'; import os from 'os'; import { fileURLToPath } from 'url'; import { dirname } from 'path'; -import { spawn } from 'child_process'; +import { spawn } from 'cross-spawn'; const router = express.Router(); const __filename = fileURLToPath(import.meta.url); @@ -549,4 +549,4 @@ function parseClaudeGetOutput(output) { } } -export default router; \ No newline at end of file +export default router; diff --git a/server/routes/projects.js b/server/routes/projects.js index cf3a62e4..d74ab491 100644 --- a/server/routes/projects.js +++ b/server/routes/projects.js @@ -1,7 +1,7 @@ import express from 'express'; import { promises as fs } from 'fs'; import path from 'path'; -import { spawn } from 'child_process'; +import { spawn } from 'cross-spawn'; import os from 'os'; import { addProjectManually } from '../projects.js'; diff --git a/server/routes/taskmaster.js b/server/routes/taskmaster.js index 632d99d5..ca99e8d1 100644 --- a/server/routes/taskmaster.js +++ b/server/routes/taskmaster.js @@ -12,7 +12,7 @@ import express from 'express'; import fs from 'fs'; import path from 'path'; import { promises as fsPromises } from 'fs'; -import { spawn } from 'child_process'; +import { spawn } from 'cross-spawn'; import { fileURLToPath } from 'url'; import { dirname } from 'path'; import os from 'os'; diff --git a/server/routes/user.js b/server/routes/user.js index 877cd45b..49583e64 100644 --- a/server/routes/user.js +++ b/server/routes/user.js @@ -2,7 +2,7 @@ import express from 'express'; import { userDb } from '../database/db.js'; import { authenticateToken } from '../middleware/auth.js'; import { getSystemGitConfig } from '../utils/gitConfig.js'; -import { spawn } from 'child_process'; +import { spawn } from 'cross-spawn'; const router = express.Router(); diff --git a/server/utils/gitConfig.js b/server/utils/gitConfig.js index 586933a0..c52bdf99 100644 --- a/server/utils/gitConfig.js +++ b/server/utils/gitConfig.js @@ -1,4 +1,4 @@ -import { spawn } from 'child_process'; +import { spawn } from 'cross-spawn'; function spawnAsync(command, args) { return new Promise((resolve, reject) => { diff --git a/server/utils/plugin-loader.js b/server/utils/plugin-loader.js index 9d91068f..e5786f42 100644 --- a/server/utils/plugin-loader.js +++ b/server/utils/plugin-loader.js @@ -1,7 +1,7 @@ import fs from 'fs'; import path from 'path'; import os from 'os'; -import { spawn } from 'child_process'; +import { spawn } from 'cross-spawn'; const PLUGINS_DIR = path.join(os.homedir(), '.claude-code-ui', 'plugins'); const PLUGINS_CONFIG_PATH = path.join(os.homedir(), '.claude-code-ui', 'plugins.json'); diff --git a/server/utils/plugin-process-manager.js b/server/utils/plugin-process-manager.js index d5fa493e..87780b28 100644 --- a/server/utils/plugin-process-manager.js +++ b/server/utils/plugin-process-manager.js @@ -1,4 +1,4 @@ -import { spawn } from 'child_process'; +import { spawn } from 'cross-spawn'; import path from 'path'; import { scanPlugins, getPluginsConfig, getPluginDir } from './plugin-loader.js';