88// resolves; without the stream error listeners the unhandled errors would
99// terminate the process.
1010
11- import { createRequire } from "node:module" ;
1211import fs from "node:fs/promises" ;
12+ import { createRequire } from "node:module" ;
1313import os from "node:os" ;
1414import path from "node:path" ;
1515import { fileURLToPath } from "node:url" ;
1616
1717const repoRoot = path . dirname ( path . dirname ( path . dirname ( fileURLToPath ( import . meta. url ) ) ) ) ;
1818
1919const require = createRequire ( import . meta. url ) ;
20- const childProcess = require ( "node:child_process" ) ;
20+ const childProcess = require ( "node:child_process" ) as typeof import ( "node:child_process" ) ;
2121const originalSpawn = childProcess . spawn ;
2222
2323const tmpDir = await fs . mkdtemp ( path . join ( os . tmpdir ( ) , "openclaw-proof-secrets-" ) ) ;
@@ -37,7 +37,7 @@ await fs.chmod(fakeSecret, 0o755);
3737// emit error events after runExecResolver attaches listeners.
3838childProcess . spawn = ( ...args : Parameters < typeof originalSpawn > ) => {
3939 const child = originalSpawn . apply ( childProcess , args ) ;
40- const cmd = String ( args [ 0 ] ?? "" ) ;
40+ const cmd = args [ 0 ] ?? "" ;
4141 if ( cmd === fakeSecret ) {
4242 setTimeout ( ( ) => {
4343 child . stdout ?. emit ( "error" , new Error ( "stdout read failed" ) ) ;
0 commit comments