@xaidenlabs/uso 1.1.45 β 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 +7 -1
- package/package.json +2 -2
- package/src/platforms/wsl.js +98 -13
- package/src/utils/wsl-bridge.js +8 -5
package/README.md
CHANGED
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
# Universal Solana Orchestrator (USO)
|
|
2
2
|
|
|
3
|
-
The
|
|
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.
|
|
4
|
-
"description": "Universal Solana
|
|
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
|
},
|
package/src/platforms/wsl.js
CHANGED
|
@@ -5,6 +5,7 @@ const path = require('path');
|
|
|
5
5
|
const fs = require('fs');
|
|
6
6
|
const os = require('os');
|
|
7
7
|
const { spawnSync } = require('child_process');
|
|
8
|
+
const chalk = require('chalk');
|
|
8
9
|
|
|
9
10
|
const installWsl = async () => {
|
|
10
11
|
log.header("π§ Configuring Stealth WSL Environment...");
|
|
@@ -17,30 +18,61 @@ const installWsl = async () => {
|
|
|
17
18
|
return false;
|
|
18
19
|
}
|
|
19
20
|
|
|
20
|
-
// 2. Install Ubuntu silently
|
|
21
|
-
// We
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
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)...");
|
|
25
29
|
log.warn("β³ This may take a few minutes (Downloading ~500MB)...");
|
|
26
30
|
|
|
27
|
-
//
|
|
28
|
-
const
|
|
31
|
+
// Helper to try install commands
|
|
32
|
+
const tryInstall = (args, description) => {
|
|
33
|
+
log.info(`π Attempting: ${description}...`);
|
|
34
|
+
// Fix Deprecation: shell: false is safer and prevents warning
|
|
35
|
+
const proc = spawnSync('wsl', args, { stdio: 'inherit', shell: false });
|
|
36
|
+
return proc.status === 0;
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
// Attempt 1: Standard Install
|
|
40
|
+
let success = tryInstall(['--install', '-d', 'Ubuntu'], 'Standard Install');
|
|
41
|
+
|
|
42
|
+
// Attempt 2: Update WSL Kernel (Fixes network/protocol issues)
|
|
43
|
+
if (!success) {
|
|
44
|
+
log.warn("β οΈ Standard install failed. Attempting to update WSL kernel...");
|
|
45
|
+
spawnSync('wsl', ['--update'], { stdio: 'inherit', shell: false });
|
|
46
|
+
success = tryInstall(['--install', '-d', 'Ubuntu'], 'Install after Update');
|
|
47
|
+
}
|
|
29
48
|
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
log.warn("
|
|
49
|
+
// Attempt 3: Web Download (Bypasses Microsoft Store blocks)
|
|
50
|
+
if (!success) {
|
|
51
|
+
log.warn("β οΈ Still failing. Trying --web-download (Bypasses Store)...");
|
|
52
|
+
success = tryInstall(['--install', '-d', 'Ubuntu', '--web-download'], 'Web Download Install');
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
// Final Failure Handler
|
|
56
|
+
if (!success) {
|
|
57
|
+
log.error("β Failed to configure Uso Engine.");
|
|
58
|
+
log.error("π Possible Causes: Internet Timeout, Firewall, or VPN.");
|
|
59
|
+
log.warn("\nπ ACTION REQUIRED: Run this command manually in PowerShell as Administrator:");
|
|
60
|
+
console.log(chalk.bold.yellow(" wsl --install -d Ubuntu --web-download"));
|
|
61
|
+
log.warn("\nOnce that completes successfully, run 'uso setup --wsl' again.");
|
|
33
62
|
return false;
|
|
34
63
|
}
|
|
35
|
-
log.success("β
|
|
64
|
+
log.success("β
Uso Engine configured.");
|
|
36
65
|
} else {
|
|
37
|
-
log.success("β
|
|
66
|
+
log.success("β
Uso Engine is ready.");
|
|
38
67
|
}
|
|
39
68
|
|
|
69
|
+
// 2.5 Hide from Windows Terminal (Stealth Mode)
|
|
70
|
+
hideFromWindowsTerminal();
|
|
71
|
+
|
|
40
72
|
// 3. Configure Internal Environment (Rust + Solana + Anchor)
|
|
41
73
|
// We create a shell script and run it inside WSL.
|
|
42
74
|
|
|
43
|
-
log.info("βοΈ
|
|
75
|
+
log.info("βοΈ Initializing Uso Engine environment...");
|
|
44
76
|
|
|
45
77
|
const setupScript = `
|
|
46
78
|
#!/bin/bash
|
|
@@ -120,4 +152,57 @@ const installWsl = async () => {
|
|
|
120
152
|
}
|
|
121
153
|
};
|
|
122
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
|
+
|
|
123
208
|
module.exports = { installWsl };
|
package/src/utils/wsl-bridge.js
CHANGED
|
@@ -30,11 +30,14 @@ const isDistroInstalled = (distro = 'Ubuntu') => {
|
|
|
30
30
|
*/
|
|
31
31
|
const toWslPath = (windowsPath) => {
|
|
32
32
|
if (!windowsPath) return '';
|
|
33
|
-
//
|
|
34
|
-
let
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
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
|
/**
|