Skip to content

armgit / ruflo

Public Imported from GitHub
0

🌊 The original agent harness. Deploy intelligent multi-player swarms, coordinate autonomous workflows, and build conversational AI systems. Features adaptive memory, self-learning intelligence, federation, vector RAG integration, and native Claude Code / Codex / Hermes and many more Integrated

fix(release): spawn npm.cmd with shell:true on Windows (#3346)

rUvfcee45bc1d82
diff --git a/scripts/stage-internal-runtime-bundles.mjs b/scripts/stage-internal-runtime-bundles.mjs
index eb5ffa5bd5..34ca29ae31 100644
--- a/scripts/stage-internal-runtime-bundles.mjs
+++ b/scripts/stage-internal-runtime-bundles.mjs
@@ -47,11 +47,21 @@ const INTERNAL_RUNTIME_PACKAGES = [
const BUILD_PREREQUISITES = ['shared'];
function runBuild(packageDirectory) {
- const command = process.platform === 'win32' ? 'npm.cmd' : 'npm';
- const result = spawnSync(command, ['run', 'build'], {
- cwd: packageDirectory,
- stdio: 'inherit',
- });
+ // CreateProcess cannot launch a .cmd directly, and Node has refused to
+ // since CVE-2024-27980 — spawnSync('npm.cmd', ...) without shell:true
+ // throws EINVAL on Windows. `command`/args here are constant literals,
+ // never hook-derived or user-controlled, so shell:true carries no
+ // injection risk (contrast plugins/ruflo-core/scripts/ruflo-hook.cjs,
+ // which resolves a real .js entrypoint instead because its argv IS
+ // externally derived).
+ // Node's DEP0190 warns when shell:true is combined with an args array
+ // (args are concatenated, not escaped) — harmless here since nothing is
+ // interpolated, but the single-string form below is what Node itself
+ // recommends to avoid the warning while keeping shell:true.
+ const win32 = process.platform === 'win32';
+ const result = win32
+ ? spawnSync('npm.cmd run build', { cwd: packageDirectory, stdio: 'inherit', shell: true })
+ : spawnSync('npm', ['run', 'build'], { cwd: packageDirectory, stdio: 'inherit' });
if (result.error) throw result.error;
if (result.status !== 0) {
throw new Error(