wenox-cli 1.0.3 ā 1.0.6
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 +68 -66
- package/package.json +1 -1
package/bin/wenox.js
CHANGED
|
@@ -56,25 +56,8 @@ 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
|
-
|
|
64
59
|
child.on('close', (code) => {
|
|
65
|
-
|
|
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
|
-
}
|
|
60
|
+
resolve(code === 0);
|
|
78
61
|
});
|
|
79
62
|
|
|
80
63
|
child.on('error', () => {
|
|
@@ -99,57 +82,77 @@ function checkAider() {
|
|
|
99
82
|
}
|
|
100
83
|
|
|
101
84
|
async function installAider() {
|
|
102
|
-
console.log(chalk.cyan('
|
|
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);
|
|
85
|
+
console.log(chalk.cyan('š¦ Installing WENOX dependencies...'));
|
|
112
86
|
|
|
113
87
|
const python = process.platform === 'win32' ? 'python' : 'python3';
|
|
114
88
|
const pip = process.platform === 'win32' ? 'pip' : 'pip3';
|
|
115
89
|
|
|
116
90
|
return new Promise((resolve, reject) => {
|
|
117
|
-
|
|
118
|
-
|
|
91
|
+
// First upgrade pip and setuptools to handle Python 3.14
|
|
92
|
+
console.log(chalk.yellow('š§ Upgrading pip and setuptools...'));
|
|
93
|
+
const upgradeChild = spawn(pip, ['install', '--upgrade', 'pip', 'setuptools', 'wheel'], {
|
|
94
|
+
stdio: 'inherit',
|
|
119
95
|
shell: true
|
|
120
96
|
});
|
|
121
97
|
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
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
|
-
|
|
130
|
-
child.on('close', (code) => {
|
|
131
|
-
clearTimeout(timeout);
|
|
132
|
-
clearInterval(loadingInterval);
|
|
133
|
-
process.stdout.write('\r' + ' '.repeat(50) + '\r'); // Clear loading line
|
|
134
|
-
|
|
135
|
-
if (code === 0) {
|
|
136
|
-
console.log(chalk.green('ā
WENOX Platform initialized successfully!'));
|
|
137
|
-
console.log(chalk.cyan('š Connected to Claude API servers'));
|
|
138
|
-
resolve();
|
|
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'));
|
|
143
|
-
reject(new Error('Failed to install dependencies'));
|
|
98
|
+
upgradeChild.on('close', (upgradeCode) => {
|
|
99
|
+
if (upgradeCode !== 0) {
|
|
100
|
+
console.log(chalk.yellow('ā ļø Pip upgrade failed, continuing anyway...'));
|
|
144
101
|
}
|
|
102
|
+
|
|
103
|
+
// Now install aider with fallback options
|
|
104
|
+
console.log(chalk.cyan('š¦ Installing aider-chat...'));
|
|
105
|
+
const child = spawn(pip, [
|
|
106
|
+
'install',
|
|
107
|
+
'aider-chat',
|
|
108
|
+
'--no-build-isolation', // Skip build isolation for Python 3.14
|
|
109
|
+
'--force-reinstall' // Force reinstall to avoid cache issues
|
|
110
|
+
], {
|
|
111
|
+
stdio: 'inherit',
|
|
112
|
+
shell: true
|
|
113
|
+
});
|
|
114
|
+
|
|
115
|
+
child.on('close', (code) => {
|
|
116
|
+
if (code === 0) {
|
|
117
|
+
console.log(chalk.green('ā
WENOX dependencies installed successfully!'));
|
|
118
|
+
resolve();
|
|
119
|
+
} else {
|
|
120
|
+
console.log(chalk.red('ā Installation failed. Trying alternative method...'));
|
|
121
|
+
|
|
122
|
+
// Fallback: try with --no-deps and install manually
|
|
123
|
+
const fallbackChild = spawn(pip, [
|
|
124
|
+
'install',
|
|
125
|
+
'aider-chat',
|
|
126
|
+
'--no-deps',
|
|
127
|
+
'--force-reinstall'
|
|
128
|
+
], {
|
|
129
|
+
stdio: 'inherit',
|
|
130
|
+
shell: true
|
|
131
|
+
});
|
|
132
|
+
|
|
133
|
+
fallbackChild.on('close', (fallbackCode) => {
|
|
134
|
+
if (fallbackCode === 0) {
|
|
135
|
+
console.log(chalk.green('ā
WENOX installed with fallback method!'));
|
|
136
|
+
resolve();
|
|
137
|
+
} else {
|
|
138
|
+
reject(new Error('Failed to install dependencies'));
|
|
139
|
+
}
|
|
140
|
+
});
|
|
141
|
+
|
|
142
|
+
fallbackChild.on('error', (err) => {
|
|
143
|
+
reject(err);
|
|
144
|
+
});
|
|
145
|
+
}
|
|
146
|
+
});
|
|
147
|
+
|
|
148
|
+
child.on('error', (err) => {
|
|
149
|
+
reject(err);
|
|
150
|
+
});
|
|
145
151
|
});
|
|
146
152
|
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
process.stdout.write('\r' + ' '.repeat(50) + '\r');
|
|
151
|
-
console.log(chalk.red('ā Installation failed'));
|
|
152
|
-
reject(err);
|
|
153
|
+
upgradeChild.on('error', (err) => {
|
|
154
|
+
console.log(chalk.yellow('ā ļø Pip upgrade error, continuing...'));
|
|
155
|
+
// Continue with installation even if upgrade fails
|
|
153
156
|
});
|
|
154
157
|
});
|
|
155
158
|
}
|
|
@@ -162,9 +165,9 @@ function checkApiKey() {
|
|
|
162
165
|
console.log('\nTo get started with WENOX:');
|
|
163
166
|
console.log('1. Get your API key from: ' + chalk.blue('https://wenox.ai/dashboard'));
|
|
164
167
|
console.log('2. Set your API key:');
|
|
165
|
-
console.log(' ' + chalk.bold('
|
|
168
|
+
console.log(' ' + chalk.bold('$env:WENOX_API_KEY="your_api_key_here"'));
|
|
166
169
|
console.log(' or');
|
|
167
|
-
console.log(' ' + chalk.bold('
|
|
170
|
+
console.log(' ' + chalk.bold('$env:OPENAI_API_KEY="your_wenox_api_key"'));
|
|
168
171
|
console.log('\n3. Run ' + chalk.cyan('wenox') + ' again');
|
|
169
172
|
process.exit(1);
|
|
170
173
|
}
|
|
@@ -198,7 +201,7 @@ async function runAider() {
|
|
|
198
201
|
// Combine default and user arguments
|
|
199
202
|
const args = [...defaultArgs, ...userArgs];
|
|
200
203
|
|
|
201
|
-
console.log(chalk.green('ā
|
|
204
|
+
console.log(chalk.green('ā
Starting WENOX Claude API Platform...\n'));
|
|
202
205
|
|
|
203
206
|
const child = spawn(python, args, {
|
|
204
207
|
stdio: 'inherit',
|
|
@@ -229,7 +232,7 @@ async function main() {
|
|
|
229
232
|
// Handle help flag
|
|
230
233
|
if (process.argv.includes('--help') || process.argv.includes('-h')) {
|
|
231
234
|
console.log(`
|
|
232
|
-
${chalk.cyan.bold('WENOX CLI')} -
|
|
235
|
+
${chalk.cyan.bold('WENOX CLI')} - Claude API Enterprise Platform
|
|
233
236
|
|
|
234
237
|
${chalk.bold('Usage:')}
|
|
235
238
|
wenox [options] [files...]
|
|
@@ -247,7 +250,7 @@ ${chalk.bold('Examples:')}
|
|
|
247
250
|
|
|
248
251
|
${chalk.bold('Setup:')}
|
|
249
252
|
1. Get API key: ${chalk.blue('https://wenox.ai/dashboard')}
|
|
250
|
-
2. Set environment: ${chalk.yellow('
|
|
253
|
+
2. Set environment: ${chalk.yellow('$env:WENOX_API_KEY="your_key"')}
|
|
251
254
|
3. Run: ${chalk.cyan('wenox')}
|
|
252
255
|
`);
|
|
253
256
|
return;
|
|
@@ -258,9 +261,8 @@ ${chalk.bold('Setup:')}
|
|
|
258
261
|
// Check Python
|
|
259
262
|
const hasPython = await checkPython();
|
|
260
263
|
if (!hasPython) {
|
|
261
|
-
console.log(chalk.red('ā Python 3.10
|
|
262
|
-
console.log(
|
|
263
|
-
console.log(chalk.yellow('š” After install, restart terminal and try again'));
|
|
264
|
+
console.log(chalk.red('ā Python 3.10+ is required'));
|
|
265
|
+
console.log('Please install Python from: https://python.org');
|
|
264
266
|
process.exit(1);
|
|
265
267
|
}
|
|
266
268
|
|