wenox-cli 1.0.1 → 1.0.3
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/bin/wenox.js +56 -9
- package/package.json +1 -1
package/bin/wenox.js
CHANGED
|
@@ -39,7 +39,7 @@ const banner = chalk.cyan(`
|
|
|
39
39
|
╚███╔███╔╝███████╗██║ ╚████║╚██████╔╝██╔╝ ██╗
|
|
40
40
|
╚══╝╚══╝ ╚══════╝╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝
|
|
41
41
|
|
|
42
|
-
${chalk.bold('
|
|
42
|
+
${chalk.bold('Claude API • Enterprise AI Platform')}
|
|
43
43
|
`);
|
|
44
44
|
|
|
45
45
|
function showWelcome() {
|
|
@@ -56,8 +56,25 @@ function checkPython() {
|
|
|
56
56
|
const python = process.platform === 'win32' ? 'python' : 'python3';
|
|
57
57
|
const child = spawn(python, ['--version'], { stdio: 'pipe' });
|
|
58
58
|
|
|
59
|
+
let output = '';
|
|
60
|
+
child.stdout.on('data', (data) => {
|
|
61
|
+
output += data.toString();
|
|
62
|
+
});
|
|
63
|
+
|
|
59
64
|
child.on('close', (code) => {
|
|
60
|
-
|
|
65
|
+
if (code === 0) {
|
|
66
|
+
const version = output.match(/Python (\d+)\.(\d+)/);
|
|
67
|
+
if (version) {
|
|
68
|
+
const major = parseInt(version[1]);
|
|
69
|
+
const minor = parseInt(version[2]);
|
|
70
|
+
// Python 3.10-3.12 supported
|
|
71
|
+
resolve(major === 3 && minor >= 10 && minor <= 12);
|
|
72
|
+
} else {
|
|
73
|
+
resolve(false);
|
|
74
|
+
}
|
|
75
|
+
} else {
|
|
76
|
+
resolve(false);
|
|
77
|
+
}
|
|
61
78
|
});
|
|
62
79
|
|
|
63
80
|
child.on('error', () => {
|
|
@@ -82,27 +99,56 @@ function checkAider() {
|
|
|
82
99
|
}
|
|
83
100
|
|
|
84
101
|
async function installAider() {
|
|
85
|
-
console.log(chalk.
|
|
102
|
+
console.log(chalk.cyan('\n🚀 Initializing WENOX Enterprise Platform...'));
|
|
103
|
+
|
|
104
|
+
// Loading animation
|
|
105
|
+
const frames = ['⠋', '⠙', '⠹', '⠸', '⠼', '⠴', '⠦', '⠧', '⠇', '⠏'];
|
|
106
|
+
let i = 0;
|
|
107
|
+
|
|
108
|
+
const loadingInterval = setInterval(() => {
|
|
109
|
+
process.stdout.write(`\r${chalk.cyan(frames[i % frames.length])} Setting up Claude API environment...`);
|
|
110
|
+
i++;
|
|
111
|
+
}, 100);
|
|
86
112
|
|
|
87
113
|
const python = process.platform === 'win32' ? 'python' : 'python3';
|
|
88
114
|
const pip = process.platform === 'win32' ? 'pip' : 'pip3';
|
|
89
115
|
|
|
90
116
|
return new Promise((resolve, reject) => {
|
|
91
|
-
const child = spawn(pip, ['install', 'aider-chat'], {
|
|
92
|
-
stdio: '
|
|
117
|
+
const child = spawn(pip, ['install', 'aider-chat', '--quiet', '--no-warn-script-location'], {
|
|
118
|
+
stdio: 'pipe', // Completely hide all output
|
|
93
119
|
shell: true
|
|
94
120
|
});
|
|
95
121
|
|
|
122
|
+
// Timeout after 2 minutes
|
|
123
|
+
const timeout = setTimeout(() => {
|
|
124
|
+
clearInterval(loadingInterval);
|
|
125
|
+
child.kill();
|
|
126
|
+
console.log(chalk.red('\n❌ Installation timeout. Please check your internet connection.'));
|
|
127
|
+
reject(new Error('Installation timeout'));
|
|
128
|
+
}, 120000);
|
|
129
|
+
|
|
96
130
|
child.on('close', (code) => {
|
|
131
|
+
clearTimeout(timeout);
|
|
132
|
+
clearInterval(loadingInterval);
|
|
133
|
+
process.stdout.write('\r' + ' '.repeat(50) + '\r'); // Clear loading line
|
|
134
|
+
|
|
97
135
|
if (code === 0) {
|
|
98
|
-
console.log(chalk.green('✅ WENOX
|
|
136
|
+
console.log(chalk.green('✅ WENOX Platform initialized successfully!'));
|
|
137
|
+
console.log(chalk.cyan('🔗 Connected to Claude API servers'));
|
|
99
138
|
resolve();
|
|
100
139
|
} else {
|
|
140
|
+
console.log(chalk.red('❌ Failed to initialize WENOX Platform'));
|
|
141
|
+
console.log(chalk.yellow('💡 Try: pip install --upgrade pip setuptools wheel'));
|
|
142
|
+
console.log(chalk.yellow('💡 Or install Python 3.11/3.12 from python.org'));
|
|
101
143
|
reject(new Error('Failed to install dependencies'));
|
|
102
144
|
}
|
|
103
145
|
});
|
|
104
146
|
|
|
105
147
|
child.on('error', (err) => {
|
|
148
|
+
clearTimeout(timeout);
|
|
149
|
+
clearInterval(loadingInterval);
|
|
150
|
+
process.stdout.write('\r' + ' '.repeat(50) + '\r');
|
|
151
|
+
console.log(chalk.red('❌ Installation failed'));
|
|
106
152
|
reject(err);
|
|
107
153
|
});
|
|
108
154
|
});
|
|
@@ -152,7 +198,7 @@ async function runAider() {
|
|
|
152
198
|
// Combine default and user arguments
|
|
153
199
|
const args = [...defaultArgs, ...userArgs];
|
|
154
200
|
|
|
155
|
-
console.log(chalk.green('✅
|
|
201
|
+
console.log(chalk.green('✅ Launching WENOX Claude API Platform...\n'));
|
|
156
202
|
|
|
157
203
|
const child = spawn(python, args, {
|
|
158
204
|
stdio: 'inherit',
|
|
@@ -212,8 +258,9 @@ ${chalk.bold('Setup:')}
|
|
|
212
258
|
// Check Python
|
|
213
259
|
const hasPython = await checkPython();
|
|
214
260
|
if (!hasPython) {
|
|
215
|
-
console.log(chalk.red('❌ Python 3.10+
|
|
216
|
-
console.log('
|
|
261
|
+
console.log(chalk.red('❌ Python 3.10-3.12 required (Python 3.14+ not supported)'));
|
|
262
|
+
console.log(chalk.yellow('💡 Download Python 3.12: https://python.org/downloads/release/python-3120/'));
|
|
263
|
+
console.log(chalk.yellow('💡 After install, restart terminal and try again'));
|
|
217
264
|
process.exit(1);
|
|
218
265
|
}
|
|
219
266
|
|