4runr-os 2.1.37 → 2.1.41

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 +99 -98
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "4runr-os",
3
- "version": "2.1.37",
3
+ "version": "2.1.41",
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
@@ -186,114 +186,114 @@ if (isWindows && rustInstalled && rustNeedsGNU) {
186
186
  'mingw-w64.mingw-w64', // Direct MinGW package
187
187
  'mingw-w64', // Alternative MinGW package name
188
188
  ];
189
-
190
- for (const pkg of wingetPackages) {
191
- try {
192
- console.log(` Trying: winget install ${pkg}...`);
193
- execSync(`winget install ${pkg} --accept-package-agreements --accept-source-agreements --silent`, {
194
- stdio: 'pipe',
195
- timeout: 120000 // 2 minutes for MSYS2
196
- });
197
- installed = true;
198
- console.log(` ✅ Installed via winget: ${pkg}`);
189
+
190
+ for (const pkg of wingetPackages) {
191
+ try {
192
+ console.log(` Trying: winget install ${pkg}...`);
193
+ execSync(`winget install ${pkg} --accept-package-agreements --accept-source-agreements --silent`, {
194
+ stdio: 'pipe',
195
+ timeout: 120000 // 2 minutes for MSYS2
196
+ });
197
+ installed = true;
198
+ console.log(` ✅ Installed via winget: ${pkg}`);
199
+
200
+ // If MSYS2 was just installed via winget, install MinGW inside it
201
+ if (pkg === 'msys2.msys2') {
202
+ // Wait a moment for MSYS2 installation to complete
203
+ console.log(' Waiting for MSYS2 installation to complete...');
204
+ const { setTimeout } = await import('timers/promises');
205
+ await setTimeout(5000);
199
206
 
200
- // If MSYS2 was just installed via winget, install MinGW inside it
201
- if (pkg === 'msys2.msys2') {
202
- // Wait a moment for MSYS2 installation to complete
203
- console.log(' Waiting for MSYS2 installation to complete...');
204
- const { setTimeout } = await import('timers/promises');
205
- await setTimeout(5000);
206
-
207
- // Check if MinGW is already installed
208
- if (fs.existsSync(path.join(msys2MingwPath, 'dlltool.exe'))) {
209
- console.log(` ✅ MinGW already installed in MSYS2`);
210
- mingwInstalled = true;
211
- mingwPath = msys2MingwPath;
212
- } else {
213
- // Automatically install MinGW toolchain via MSYS2
214
- console.log(' 🔨 Installing MinGW toolchain in MSYS2 (this may take 2-3 minutes)...');
215
- try {
216
- execSync(`"${msys2Bash}" -lc "pacman -S mingw-w64-x86_64-toolchain --noconfirm"`, {
217
- stdio: 'inherit',
218
- timeout: 300000 // 5 minutes for installation
219
- });
220
-
221
- // Verify installation
222
- if (fs.existsSync(path.join(msys2MingwPath, 'dlltool.exe'))) {
223
- console.log(' ✅ MinGW toolchain installed successfully');
224
- mingwInstalled = true;
225
- mingwPath = msys2MingwPath;
226
- } else {
227
- console.warn(' ⚠️ Installation completed but MinGW not found. Please restart terminal and run 4runr-setup again.');
228
- process.exit(0);
229
- }
230
- } catch (installError) {
231
- console.error(' ❌ Failed to install MinGW automatically');
232
- console.error(' Quick fix - run this command:');
233
- console.error(` "${msys2Bash}" -lc "pacman -S mingw-w64-x86_64-toolchain --noconfirm"`);
234
- console.error(' Then restart terminal and run: 4runr-setup\n');
235
- process.exit(1);
236
- }
237
- }
238
-
239
- // Add to PATH for current session
240
- if (mingwInstalled && mingwPath) {
241
- console.log(` ✅ Adding ${mingwPath} to PATH for this session...`);
242
- process.env.PATH = process.env.PATH ? `${mingwPath};${process.env.PATH}` : mingwPath;
243
- }
207
+ // Check if MinGW is already installed
208
+ if (fs.existsSync(path.join(msys2MingwPath, 'dlltool.exe'))) {
209
+ console.log(` ✅ MinGW already installed in MSYS2`);
210
+ mingwInstalled = true;
211
+ mingwPath = msys2MingwPath;
244
212
  } else {
245
- // Direct MinGW package - wait and check PATH
246
- const { setTimeout } = await import('timers/promises');
247
- await setTimeout(2000);
213
+ // Automatically install MinGW toolchain via MSYS2
214
+ console.log(' 🔨 Installing MinGW toolchain in MSYS2 (this may take 2-3 minutes)...');
248
215
  try {
249
- const dlltoolPath = execSync('where dlltool.exe', { encoding: 'utf-8', stdio: 'pipe' }).trim();
250
- mingwInstalled = true;
251
- mingwPath = path.dirname(dlltoolPath);
252
- } catch {
253
- // Not in PATH yet - user will need to restart terminal
254
- console.warn(' ⚠️ Installed but not in PATH - please restart terminal');
216
+ execSync(`"${msys2Bash}" -lc "pacman -S mingw-w64-x86_64-toolchain --noconfirm"`, {
217
+ stdio: 'inherit',
218
+ timeout: 300000 // 5 minutes for installation
219
+ });
220
+
221
+ // Verify installation
222
+ if (fs.existsSync(path.join(msys2MingwPath, 'dlltool.exe'))) {
223
+ console.log(' ✅ MinGW toolchain installed successfully');
224
+ mingwInstalled = true;
225
+ mingwPath = msys2MingwPath;
226
+ } else {
227
+ console.warn(' ⚠️ Installation completed but MinGW not found. Please restart terminal and run 4runr-setup again.');
228
+ process.exit(0);
229
+ }
230
+ } catch (installError) {
231
+ console.error(' ❌ Failed to install MinGW automatically');
232
+ console.error(' Quick fix - run this command:');
233
+ console.error(` "${msys2Bash}" -lc "pacman -S mingw-w64-x86_64-toolchain --noconfirm"`);
234
+ console.error(' Then restart terminal and run: 4runr-setup\n');
235
+ process.exit(1);
255
236
  }
256
237
  }
257
- break;
258
- } catch (err) {
259
- // Try next package
260
- continue;
238
+
239
+ // Add to PATH for current session
240
+ if (mingwInstalled && mingwPath) {
241
+ console.log(` ✅ Adding ${mingwPath} to PATH for this session...`);
242
+ process.env.PATH = process.env.PATH ? `${mingwPath};${process.env.PATH}` : mingwPath;
243
+ }
244
+ } else {
245
+ // Direct MinGW package - wait and check PATH
246
+ const { setTimeout } = await import('timers/promises');
247
+ await setTimeout(2000);
248
+ try {
249
+ const dlltoolPath = execSync('where dlltool.exe', { encoding: 'utf-8', stdio: 'pipe' }).trim();
250
+ mingwInstalled = true;
251
+ mingwPath = path.dirname(dlltoolPath);
252
+ } catch {
253
+ // Not in PATH yet - user will need to restart terminal
254
+ console.warn(' ⚠️ Installed but not in PATH - please restart terminal');
255
+ }
261
256
  }
257
+ break;
258
+ } catch (err) {
259
+ // Try next package
260
+ continue;
262
261
  }
263
-
264
- if (!installed) {
265
- console.error('\n❌ Failed to install MinGW automatically via winget');
266
- console.error('\n Please install MinGW-w64 manually using one of these methods:\n');
267
- console.error(' Option 1: MSYS2 via winget (Easiest)');
268
- console.error(' Run: winget install msys2.msys2');
269
- console.error(' Then:');
270
- console.error(' 1. Open MSYS2 terminal (search for "MSYS2 MSYS" in Start menu)');
271
- console.error(' 2. Run: pacman -S mingw-w64-x86_64-toolchain --noconfirm');
272
- console.error(' 3. Add C:\\msys64\\mingw64\\bin to your PATH');
273
- console.error(' 4. Restart terminal and run: 4runr-setup\n');
274
- console.error(' Option 1b: MSYS2 Manual Download');
275
- console.error(' 1. Download: https://www.msys2.org/');
276
- console.error(' 2. Install MSYS2');
277
- console.error(' 3. Open MSYS2 terminal and run: pacman -S mingw-w64-x86_64-toolchain --noconfirm');
278
- console.error(' 4. Add C:\\msys64\\mingw64\\bin to your PATH');
279
- console.error(' 5. Restart terminal and run: 4runr-setup\n');
280
- console.error(' Option 2: WinLibs (Direct Download)');
281
- console.error(' 1. Download: https://winlibs.com/');
282
- console.error(' 2. Extract to C:\\mingw64');
283
- console.error(' 3. Add C:\\mingw64\\bin to your PATH');
284
- console.error(' 4. Restart terminal and run: 4runr-setup\n');
285
- console.error(' Option 3: Chocolatey (if installed)');
286
- console.error(' choco install mingw\n');
287
- process.exit(1);
288
- } else {
289
- console.log('\n✅ MinGW-w64 installed!');
290
- console.log(' IMPORTANT: Please restart your terminal to update PATH');
291
- console.log(' Then run: 4runr-setup\n');
292
- process.exit(0);
293
- }
262
+ }
263
+
264
+ if (!installed) {
265
+ console.error('\n Failed to install MinGW automatically via winget');
266
+ console.error('\n Please install MinGW-w64 manually using one of these methods:\n');
267
+ console.error(' Option 1: MSYS2 via winget (Easiest)');
268
+ console.error(' Run: winget install msys2.msys2');
269
+ console.error(' Then:');
270
+ console.error(' 1. Open MSYS2 terminal (search for "MSYS2 MSYS" in Start menu)');
271
+ console.error(' 2. Run: pacman -S mingw-w64-x86_64-toolchain --noconfirm');
272
+ console.error(' 3. Add C:\\msys64\\mingw64\\bin to your PATH');
273
+ console.error(' 4. Restart terminal and run: 4runr-setup\n');
274
+ console.error(' Option 1b: MSYS2 Manual Download');
275
+ console.error(' 1. Download: https://www.msys2.org/');
276
+ console.error(' 2. Install MSYS2');
277
+ console.error(' 3. Open MSYS2 terminal and run: pacman -S mingw-w64-x86_64-toolchain --noconfirm');
278
+ console.error(' 4. Add C:\\msys64\\mingw64\\bin to your PATH');
279
+ console.error(' 5. Restart terminal and run: 4runr-setup\n');
280
+ console.error(' Option 2: WinLibs (Direct Download)');
281
+ console.error(' 1. Download: https://winlibs.com/');
282
+ console.error(' 2. Extract to C:\\mingw64');
283
+ console.error(' 3. Add C:\\mingw64\\bin to your PATH');
284
+ console.error(' 4. Restart terminal and run: 4runr-setup\n');
285
+ console.error(' Option 3: Chocolatey (if installed)');
286
+ console.error(' choco install mingw\n');
287
+ process.exit(1);
288
+ } else {
289
+ console.log('\n✅ MinGW-w64 installed!');
290
+ console.log(' IMPORTANT: Please restart your terminal to update PATH');
291
+ console.log(' Then run: 4runr-setup\n');
292
+ process.exit(0);
294
293
  }
295
294
  }
296
295
 
296
+ // Configure Rust to use GNU toolchain if MinGW is installed
297
297
  if (mingwInstalled) {
298
298
  // Make sure MinGW is in PATH for cargo
299
299
  if (mingwPath && process.env.PATH && !process.env.PATH.includes(mingwPath)) {
@@ -313,6 +313,7 @@ if (isWindows && rustInstalled && rustNeedsGNU) {
313
313
  console.warn(' rustup default stable-x86_64-pc-windows-gnu');
314
314
  }
315
315
  }
316
+ }
316
317
 
317
318
  // Check if 4runr-os is installed
318
319
  try {