4runr-os 2.1.42 → 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 +31 -16
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "4runr-os",
3
- "version": "2.1.42",
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
@@ -316,21 +316,31 @@ if (isWindows && rustInstalled && rustNeedsGNU) {
316
316
  }
317
317
 
318
318
  // Continue with rest of setup (outside Windows-specific block)
319
- try {
320
- execSync('4r --version', { stdio: 'ignore' });
319
+ console.log('\nšŸ“¦ Checking 4runr-os installation...');
320
+ try {
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)) {
321
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');
322
338
  } catch {
323
- console.log('āš ļø 4runr-os not found in PATH');
324
- console.log(' Installing 4runr-os...');
325
- try {
326
- execSync('npm install -g 4runr-os@latest', { stdio: 'inherit' });
327
- console.log('āœ… 4runr-os installed');
328
- } catch {
329
- console.error('āŒ Failed to install 4runr-os');
330
- console.error(' Run manually: npm install -g 4runr-os@latest');
331
- process.exit(1);
332
- }
339
+ console.error('āŒ Failed to install 4runr-os');
340
+ console.error(' Run manually: npm install -g 4runr-os@latest');
341
+ process.exit(1);
333
342
  }
343
+ }
334
344
 
335
345
  // Verify mk3-tui binary (check global install location)
336
346
  let mk3Dir = null;
@@ -376,8 +386,13 @@ if (isWindows && rustInstalled && rustNeedsGNU) {
376
386
  }
377
387
 
378
388
  // Run the setup
379
- runSetup().catch((error) => {
380
- console.error('\nāŒ Setup failed:', error);
381
- process.exit(1);
382
- });
389
+ runSetup()
390
+ .then(() => {
391
+ // Setup completed successfully
392
+ process.exit(0);
393
+ })
394
+ .catch((error) => {
395
+ console.error('\nāŒ Setup failed:', error);
396
+ process.exit(1);
397
+ });
383
398