| 75 | // Resolve the launcher from the installed per-platform optionalDependency. |
| 76 | // Returns {command, args} or null if the package isn't installed. |
| 77 | function resolveInstalledBundle() { |
| 78 | try { |
| 79 | if (isWindows) { |
| 80 | // Modern Node refuses to spawn the bundle's .cmd directly (EINVAL, the |
| 81 | // CVE-2024-27980 hardening on Node 24), so invoke the bundled node.exe |
| 82 | // against the app entry point and pass --liftoff-only here. |
| 83 | var nodeExe = require.resolve(pkg + '/node.exe'); |
| 84 | var entry = require.resolve(pkg + '/lib/dist/bin/codegraph.js'); |
| 85 | return { command: nodeExe, args: liftoff(entry) }; |
| 86 | } |
| 87 | return { command: require.resolve(pkg + '/bin/codegraph'), args: process.argv.slice(2) }; |
| 88 | } catch (e) { |
| 89 | return null; |
| 90 | } |
| 91 | } |
| 92 | |
| 93 | // Locate the launcher inside an extracted GitHub bundle directory (same |
| 94 | // node/lib/bin layout as the npm platform package). Returns {command, args} or |