@xaidenlabs/uso 1.1.46 β†’ 1.1.48

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.
package/README.md CHANGED
@@ -1,6 +1,12 @@
1
1
  # Universal Solana Orchestrator (USO)
2
2
 
3
- The Universal Solana Orchestrator (USO) is a command-line interface designed to streamline the initialization and management of Solana development environments. By automating the installation of the Rust toolchain, Solana CLI, and Anchor framework, USO eliminates the complexity often associated with setting up a Web3 development workspace on Windows, macOS, and Linux.
3
+ **The fastest way to build on Solana.**
4
+
5
+ USO (Universal Solana Orchestrator) is a "Zero-Friction" toolchain that handles the complex setup of Rust, Anchor, and Solana CLIβ€”instantly.
6
+
7
+ **Native or Stealth Mode? Both.**
8
+ - **Universal:** Runs natively on macOS, Linux, and Windows.
9
+ - **Stealth WSL:** On Windows, USO can deploy a hidden "Uso Engine" (WSL2) to run your build, test, and validator commands in a rock-solid Linux environment, while you stay in PowerShell. No "Access Denied" errors. No friction.
4
10
 
5
11
  This tool is engineered to support developers at all levels, from beginners setting up their first environment to senior engineers managing multiple workstations.
6
12
 
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@xaidenlabs/uso",
3
- "version": "1.1.46",
4
- "description": "Universal Solana Orchestrator - A one-command setup tool for Solana and Anchor development environments on Windows, macOS, and Linux.",
3
+ "version": "1.1.48",
4
+ "description": "Universal Solana Development Toolchain. Native or Stealth WSL Mode. Build, test, and deploy without the friction.",
5
5
  "bin": {
6
6
  "uso": "bin/index.js"
7
7
  },
@@ -18,11 +18,14 @@ const installWsl = async () => {
18
18
  return false;
19
19
  }
20
20
 
21
- // 2. Install Ubuntu silently if missing
22
- // We target 'Ubuntu' as the standard distro.
23
- const checkDistro = shell.exec('wsl -l -v', { silent: true });
24
- if (!checkDistro.stdout.includes('Ubuntu')) {
25
- log.info("πŸ“¦ Installing Ubuntu (Please approve UAC prompt if asked)...");
21
+ // 2. Install Ubuntu silently (Branded as Uso Engine)
22
+ // We use 'wsl -d Ubuntu -e true' to check if it's installed and runnable.
23
+ // 'wsl -l -v' output is notoriously unreliable due to charset encoding (UTF-16) on Windows.
24
+ const checkDistro = shell.exec('wsl -d Ubuntu -e true', { silent: true });
25
+
26
+ // If exit code is 0, it's installed and working.
27
+ if (checkDistro.code !== 0) {
28
+ log.info("πŸ“¦ Configuring Uso Engine (Please approve UAC prompt if asked)...");
26
29
  log.warn("⏳ This may take a few minutes (Downloading ~500MB)...");
27
30
 
28
31
  // Helper to try install commands
@@ -51,22 +54,25 @@ const installWsl = async () => {
51
54
 
52
55
  // Final Failure Handler
53
56
  if (!success) {
54
- log.error("❌ Failed to install Ubuntu after multiple attempts.");
57
+ log.error("❌ Failed to configure Uso Engine.");
55
58
  log.error("πŸ›‘ Possible Causes: Internet Timeout, Firewall, or VPN.");
56
59
  log.warn("\nπŸ‘‰ ACTION REQUIRED: Run this command manually in PowerShell as Administrator:");
57
60
  console.log(chalk.bold.yellow(" wsl --install -d Ubuntu --web-download"));
58
61
  log.warn("\nOnce that completes successfully, run 'uso setup --wsl' again.");
59
62
  return false;
60
63
  }
61
- log.success("βœ… Ubuntu installed.");
64
+ log.success("βœ… Uso Engine configured.");
62
65
  } else {
63
- log.success("βœ… Ubuntu is already installed.");
66
+ log.success("βœ… Uso Engine is ready.");
64
67
  }
65
68
 
69
+ // 2.5 Hide from Windows Terminal (Stealth Mode)
70
+ hideFromWindowsTerminal();
71
+
66
72
  // 3. Configure Internal Environment (Rust + Solana + Anchor)
67
73
  // We create a shell script and run it inside WSL.
68
74
 
69
- log.info("βš™οΈ Configuring internal Linux environment...");
75
+ log.info("βš™οΈ Initializing Uso Engine environment...");
70
76
 
71
77
  const setupScript = `
72
78
  #!/bin/bash
@@ -146,4 +152,57 @@ const installWsl = async () => {
146
152
  }
147
153
  };
148
154
 
155
+ const hideFromWindowsTerminal = () => {
156
+ try {
157
+ const localAppData = process.env.LOCALAPPDATA;
158
+ const packagesPath = path.join(localAppData, 'Packages');
159
+
160
+ // Find Windows Terminal package folder (name varies slightly but starts with Microsoft.WindowsTerminal)
161
+ if (!fs.existsSync(packagesPath)) return;
162
+
163
+ const terminalDirs = fs.readdirSync(packagesPath).filter(name => name.startsWith('Microsoft.WindowsTerminal'));
164
+
165
+ if (terminalDirs.length === 0) return;
166
+
167
+ const settingsPath = path.join(packagesPath, terminalDirs[0], 'LocalState', 'settings.json');
168
+
169
+ if (fs.existsSync(settingsPath)) {
170
+ // Read settings
171
+ // Note: settings.json can contain comments which JSON.parse fails on.
172
+ // We'll use a simple regex to set hidden: true for Ubuntu if simpler parsing fails or just try.
173
+ // Actually, modifying this file safely without a robust comment-stripping parser is risky.
174
+ // A safer approach for "Stealth" might be just log that we configured it.
175
+ // BUT, if we want to do it, we should be careful.
176
+
177
+ // For now, let's just log a message that we would hide it,
178
+ // or maybe we skip the robust parsing complexity to avoid breaking their terminal settings.
179
+ // User requested "Programmatically edit".
180
+
181
+ const content = fs.readFileSync(settingsPath, 'utf8');
182
+ // Check if Ubuntu is already there
183
+ if (content.includes('"name": "Ubuntu"')) {
184
+ // Very naive replacement to inject hidden: true.
185
+ // We look for the Ubuntu profile block.
186
+ // This is brittle. Let's try to parse if valid JSON.
187
+ try {
188
+ const settings = JSON.parse(content);
189
+ if (settings.profiles && settings.profiles.list) {
190
+ const profile = settings.profiles.list.find(p => p.name === 'Ubuntu');
191
+ if (profile) {
192
+ profile.hidden = true;
193
+ fs.writeFileSync(settingsPath, JSON.stringify(settings, null, 4));
194
+ log.info("πŸ•΅οΈ Hid 'Ubuntu' from Windows Terminal (Stealth Mode Active).");
195
+ }
196
+ }
197
+ } catch (e) {
198
+ // JSON parse failed (likely due to comments in settings.json)
199
+ log.warn("⚠️ Could not automatically hide Ubuntu icon (Comments in settings.json).");
200
+ }
201
+ }
202
+ }
203
+ } catch (e) {
204
+ // Silently fail to avoid alarming user
205
+ }
206
+ };
207
+
149
208
  module.exports = { installWsl };
@@ -30,11 +30,14 @@ const isDistroInstalled = (distro = 'Ubuntu') => {
30
30
  */
31
31
  const toWslPath = (windowsPath) => {
32
32
  if (!windowsPath) return '';
33
- // Handle drive letter
34
- let wslPath = windowsPath.replace(/^([a-zA-Z]):/, (match, drive) => `/mnt/${drive.toLowerCase()}`);
35
- // Replace backslashes with forward slashes
36
- wslPath = wslPath.replace(/\\/g, '/');
37
- return wslPath;
33
+ // 1. Normalize the path to use forward slashes
34
+ let normalized = windowsPath.replace(/\\/g, '/');
35
+
36
+ // 2. Extract and replace the drive letter (e.g., 'C:') with '/mnt/c/'
37
+ // This regex ensures we only match the start of the string
38
+ normalized = normalized.replace(/^([a-zA-Z]):/, (match, drive) => `/mnt/${drive.toLowerCase()}`);
39
+
40
+ return normalized;
38
41
  };
39
42
 
40
43
  /**