4runr-os 2.1.34 → 2.1.37

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 +54 -49
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "4runr-os",
3
- "version": "2.1.34",
3
+ "version": "2.1.37",
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
@@ -313,65 +313,70 @@ if (isWindows && rustInstalled && rustNeedsGNU) {
313
313
  console.warn(' rustup default stable-x86_64-pc-windows-gnu');
314
314
  }
315
315
  }
316
- }
317
316
 
318
- // Check if 4runr-os is installed
319
- try {
320
- execSync('4r --version', { stdio: 'ignore' });
321
- console.log('✅ 4runr-os is installed');
322
- } catch {
323
- console.log('⚠️ 4runr-os not found in PATH');
324
- console.log(' Installing 4runr-os...');
317
+ // Check if 4runr-os is installed
325
318
  try {
326
- execSync('npm install -g 4runr-os@latest', { stdio: 'inherit' });
327
- console.log('✅ 4runr-os installed');
319
+ execSync('4r --version', { stdio: 'ignore' });
320
+ console.log('✅ 4runr-os is installed');
328
321
  } catch {
329
- console.error(' Failed to install 4runr-os');
330
- console.error(' Run manually: npm install -g 4runr-os@latest');
331
- process.exit(1);
322
+ console.log('⚠️ 4runr-os not found in PATH');
323
+ console.log(' Installing 4runr-os...');
324
+ try {
325
+ execSync('npm install -g 4runr-os@latest', { stdio: 'inherit' });
326
+ console.log('✅ 4runr-os installed');
327
+ } catch {
328
+ console.error('❌ Failed to install 4runr-os');
329
+ console.error(' Run manually: npm install -g 4runr-os@latest');
330
+ process.exit(1);
331
+ }
332
332
  }
333
- }
334
333
 
335
- // Verify mk3-tui binary (check global install location)
336
- let mk3Dir = null;
337
- try {
338
- // Try to find global install location
339
- const npmPrefix = execSync('npm config get prefix', { encoding: 'utf-8' }).trim();
340
- const globalPath = isWindows
341
- ? path.join(npmPrefix, 'node_modules', '4runr-os', 'mk3-tui')
342
- : path.join(npmPrefix, 'lib', 'node_modules', '4runr-os', 'mk3-tui');
343
-
344
- if (fs.existsSync(globalPath)) {
345
- mk3Dir = globalPath;
334
+ // Verify mk3-tui binary (check global install location)
335
+ let mk3Dir = null;
336
+ try {
337
+ // Try to find global install location
338
+ const npmPrefix = execSync('npm config get prefix', { encoding: 'utf-8' }).trim();
339
+ const globalPath = isWindows
340
+ ? path.join(npmPrefix, 'node_modules', '4runr-os', 'mk3-tui')
341
+ : path.join(npmPrefix, 'lib', 'node_modules', '4runr-os', 'mk3-tui');
342
+
343
+ if (fs.existsSync(globalPath)) {
344
+ mk3Dir = globalPath;
345
+ }
346
+ } catch {
347
+ // Fallback to local
348
+ mk3Dir = path.join(__dirname, '..', 'mk3-tui');
346
349
  }
347
- } catch {
348
- // Fallback to local
349
- mk3Dir = path.join(__dirname, '..', 'mk3-tui');
350
- }
351
350
 
352
- if (mk3Dir && fs.existsSync(mk3Dir)) {
353
- const binaryName = isWindows ? 'mk3-tui.exe' : 'mk3-tui';
354
- const binaryPath = path.join(mk3Dir, 'target', 'release', binaryName);
355
-
356
- if (!fs.existsSync(binaryPath)) {
357
- console.log('\n🔨 Building mk3-tui binary...');
358
- try {
359
- execSync('cargo build --release', {
360
- cwd: mk3Dir,
361
- stdio: 'inherit',
362
- });
363
- console.log('✅ mk3-tui built successfully');
364
- } catch (error) {
365
- console.warn('⚠️ Failed to build mk3-tui');
366
- console.warn(' The binary will be built automatically on first run of 4r');
351
+ if (mk3Dir && fs.existsSync(mk3Dir)) {
352
+ const binaryName = isWindows ? 'mk3-tui.exe' : 'mk3-tui';
353
+ const binaryPath = path.join(mk3Dir, 'target', 'release', binaryName);
354
+
355
+ if (!fs.existsSync(binaryPath)) {
356
+ console.log('\n🔨 Building mk3-tui binary...');
357
+ try {
358
+ execSync('cargo build --release', {
359
+ cwd: mk3Dir,
360
+ stdio: 'inherit',
361
+ });
362
+ console.log('✅ mk3-tui built successfully');
363
+ } catch (error) {
364
+ console.warn('⚠️ Failed to build mk3-tui');
365
+ console.warn(' The binary will be built automatically on first run of 4r');
366
+ }
367
+ } else {
368
+ console.log('✅ mk3-tui binary found');
367
369
  }
368
370
  } else {
369
- console.log('mk3-tui binary found');
371
+ console.log('⚠️ mk3-tui source not found - will build on first run of 4r');
370
372
  }
371
- } else {
372
- console.log('⚠️ mk3-tui source not found - will build on first run of 4r');
373
+
374
+ console.log('\n✅ Setup complete! You can now run: 4r\n');
373
375
  }
374
376
 
375
- console.log('\n✅ Setup complete! You can now run: 4r\n');
376
- })();
377
+ // Run the setup
378
+ runSetup().catch((error) => {
379
+ console.error('\n❌ Setup failed:', error);
380
+ process.exit(1);
381
+ });
377
382