4runr-os 2.1.45 → 2.1.46

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/scripts/setup.js +20 -11
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "4runr-os",
3
- "version": "2.1.45",
3
+ "version": "2.1.46",
4
4
  "type": "module",
5
5
  "description": "4Runr AI Agent OS - Interactive terminal for managing AI agents",
6
6
  "main": "dist/index.js",
package/scripts/setup.js CHANGED
@@ -318,20 +318,29 @@ if (isWindows && rustInstalled && rustNeedsGNU) {
318
318
  // Continue with rest of setup (outside Windows-specific block)
319
319
  console.log('\nšŸ“¦ Checking 4runr-os installation...');
320
320
  try {
321
- execSync('4r --version', { stdio: 'ignore' });
321
+ // Check if 4r command exists by checking npm global bin
322
+ const npmPrefix = execSync('npm config get prefix', { encoding: 'utf-8' }).trim();
323
+ const globalBinPath = isWindows
324
+ ? path.join(npmPrefix, '4r.cmd')
325
+ : path.join(npmPrefix, 'bin', '4r');
326
+
327
+ if (fs.existsSync(globalBinPath)) {
322
328
  console.log('āœ… 4runr-os is installed');
329
+ } else {
330
+ throw new Error('4r not found');
331
+ }
332
+ } catch {
333
+ console.log('āš ļø 4runr-os not found in PATH');
334
+ console.log(' Installing 4runr-os...');
335
+ try {
336
+ execSync('npm install -g 4runr-os@latest', { stdio: 'inherit' });
337
+ console.log('āœ… 4runr-os installed');
323
338
  } catch {
324
- console.log('āš ļø 4runr-os not found in PATH');
325
- console.log(' Installing 4runr-os...');
326
- try {
327
- execSync('npm install -g 4runr-os@latest', { stdio: 'inherit' });
328
- console.log('āœ… 4runr-os installed');
329
- } catch {
330
- console.error('āŒ Failed to install 4runr-os');
331
- console.error(' Run manually: npm install -g 4runr-os@latest');
332
- process.exit(1);
333
- }
339
+ console.error('āŒ Failed to install 4runr-os');
340
+ console.error(' Run manually: npm install -g 4runr-os@latest');
341
+ process.exit(1);
334
342
  }
343
+ }
335
344
 
336
345
  // Verify mk3-tui binary (check global install location)
337
346
  let mk3Dir = null;