wenox-cli 3.1.2 ā 3.2.0
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 +110 -11
- package/package.json +1 -1
package/bin/wenox.js
CHANGED
|
@@ -60,6 +60,95 @@ function setupWenoxDefaults() {
|
|
|
60
60
|
}
|
|
61
61
|
}
|
|
62
62
|
|
|
63
|
+
async function autoFixDependencies() {
|
|
64
|
+
console.log(chalk.cyan('š§ WENOX Auto-Fix: Resolving Python dependencies...'));
|
|
65
|
+
|
|
66
|
+
const python = process.platform === 'win32' ? 'python' : 'python3';
|
|
67
|
+
|
|
68
|
+
const fixCommands = [
|
|
69
|
+
// Try to fix tree-sitter-languages issue
|
|
70
|
+
[python, '-m', 'pip', 'install', 'tree-sitter-languages', '--force-reinstall', '--no-cache-dir'],
|
|
71
|
+
[python, '-m', 'pip', 'install', 'py-tree-sitter-languages', '--force-reinstall', '--no-cache-dir'],
|
|
72
|
+
// Try older aider version
|
|
73
|
+
[python, '-m', 'pip', 'install', 'aider-chat==0.15.0', '--force-reinstall', '--no-cache-dir'],
|
|
74
|
+
// Last resort: minimal installation
|
|
75
|
+
[python, '-m', 'pip', 'install', 'aider-chat', '--no-deps', '--force-reinstall'],
|
|
76
|
+
];
|
|
77
|
+
|
|
78
|
+
for (let i = 0; i < fixCommands.length; i++) {
|
|
79
|
+
const cmd = fixCommands[i];
|
|
80
|
+
console.log(chalk.yellow(`ā³ Trying fix ${i + 1}/${fixCommands.length}: ${cmd.slice(2).join(' ')}`));
|
|
81
|
+
|
|
82
|
+
try {
|
|
83
|
+
const result = await new Promise((resolve) => {
|
|
84
|
+
const child = spawn(cmd[0], cmd.slice(1), {
|
|
85
|
+
stdio: 'pipe',
|
|
86
|
+
shell: true
|
|
87
|
+
});
|
|
88
|
+
|
|
89
|
+
let output = '';
|
|
90
|
+
child.stdout.on('data', (data) => output += data.toString());
|
|
91
|
+
child.stderr.on('data', (data) => output += data.toString());
|
|
92
|
+
|
|
93
|
+
child.on('close', (code) => {
|
|
94
|
+
resolve({ code, output });
|
|
95
|
+
});
|
|
96
|
+
|
|
97
|
+
child.on('error', () => {
|
|
98
|
+
resolve({ code: 1, output: 'Command failed' });
|
|
99
|
+
});
|
|
100
|
+
});
|
|
101
|
+
|
|
102
|
+
if (result.code === 0) {
|
|
103
|
+
console.log(chalk.green('ā
Dependency fixed successfully!'));
|
|
104
|
+
return true;
|
|
105
|
+
} else {
|
|
106
|
+
console.log(chalk.yellow(`ā ļø Fix ${i + 1} failed, trying next...`));
|
|
107
|
+
}
|
|
108
|
+
} catch (err) {
|
|
109
|
+
console.log(chalk.yellow(`ā ļø Fix ${i + 1} failed, trying next...`));
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
console.log(chalk.red('ā Auto-fix failed. Manual installation required.'));
|
|
114
|
+
console.log(chalk.cyan('š” Manual fix commands:'));
|
|
115
|
+
console.log(chalk.cyan(' pip install tree-sitter-languages'));
|
|
116
|
+
console.log(chalk.cyan(' pip install aider-chat==0.15.0 --force-reinstall'));
|
|
117
|
+
console.log(chalk.cyan(' pip install aider-chat --no-deps --force-reinstall'));
|
|
118
|
+
return false;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
async function checkAiderStatus() {
|
|
122
|
+
const python = process.platform === 'win32' ? 'python' : 'python3';
|
|
123
|
+
|
|
124
|
+
return new Promise((resolve) => {
|
|
125
|
+
// Test if aider works
|
|
126
|
+
const testChild = spawn(python, ['-c', 'import aider; print("OK")'], {
|
|
127
|
+
stdio: 'pipe',
|
|
128
|
+
shell: true
|
|
129
|
+
});
|
|
130
|
+
|
|
131
|
+
let output = '';
|
|
132
|
+
testChild.stdout.on('data', (data) => output += data.toString());
|
|
133
|
+
testChild.stderr.on('data', (data) => output += data.toString());
|
|
134
|
+
|
|
135
|
+
testChild.on('close', (code) => {
|
|
136
|
+
if (code === 0 && output.includes('OK')) {
|
|
137
|
+
console.log(chalk.green('ā
WENOX dependencies ready'));
|
|
138
|
+
resolve(true);
|
|
139
|
+
} else {
|
|
140
|
+
console.log(chalk.yellow('ā ļø Dependency issues detected'));
|
|
141
|
+
resolve(false);
|
|
142
|
+
}
|
|
143
|
+
});
|
|
144
|
+
|
|
145
|
+
testChild.on('error', () => {
|
|
146
|
+
console.log(chalk.yellow('ā ļø Aider not found'));
|
|
147
|
+
resolve(false);
|
|
148
|
+
});
|
|
149
|
+
});
|
|
150
|
+
}
|
|
151
|
+
|
|
63
152
|
async function runAider() {
|
|
64
153
|
// Default arguments for WENOX
|
|
65
154
|
const defaultArgs = [
|
|
@@ -76,7 +165,6 @@ async function runAider() {
|
|
|
76
165
|
const args = [...defaultArgs, ...userArgs];
|
|
77
166
|
|
|
78
167
|
console.log(chalk.green('ā
Starting WENOX Claude API Platform...\n'));
|
|
79
|
-
console.log(chalk.yellow('š” Make sure you have: pip install aider-chat --only-binary=all'));
|
|
80
168
|
|
|
81
169
|
const python = process.platform === 'win32' ? 'python' : 'python3';
|
|
82
170
|
const child = spawn(python, args, {
|
|
@@ -93,13 +181,9 @@ async function runAider() {
|
|
|
93
181
|
|
|
94
182
|
child.on('error', (err) => {
|
|
95
183
|
console.error(chalk.red('ā Error starting WENOX:'), err.message);
|
|
96
|
-
console.log(chalk.cyan('\nš”
|
|
97
|
-
console.log(chalk.cyan(' pip install --
|
|
98
|
-
console.log(chalk.cyan(' pip install
|
|
99
|
-
console.log(chalk.cyan('\nš” Alternative (if above fails):'));
|
|
100
|
-
console.log(chalk.cyan(' pip install aider-chat --no-deps'));
|
|
101
|
-
console.log(chalk.cyan(' pip install tree-sitter'));
|
|
102
|
-
console.log(chalk.cyan('\nš” Or use Python 3.12 instead of 3.14'));
|
|
184
|
+
console.log(chalk.cyan('\nš” Try manual installation:'));
|
|
185
|
+
console.log(chalk.cyan(' pip install aider-chat --force-reinstall'));
|
|
186
|
+
console.log(chalk.cyan(' pip install tree-sitter-languages'));
|
|
103
187
|
process.exit(1);
|
|
104
188
|
});
|
|
105
189
|
}
|
|
@@ -132,20 +216,23 @@ ${chalk.bold('Examples:')}
|
|
|
132
216
|
wenox --model gpt-4 # Use specific model
|
|
133
217
|
|
|
134
218
|
${chalk.bold('Setup:')}
|
|
135
|
-
1. Install Python dependency: ${chalk.cyan('pip install aider-chat
|
|
219
|
+
1. Install Python dependency: ${chalk.cyan('pip install aider-chat')}
|
|
136
220
|
2. Get API key: ${chalk.blue('https://wenox.ai/dashboard')}
|
|
137
221
|
3. Set environment variable:
|
|
138
222
|
${chalk.yellow('CMD:')} set WENOX_API_KEY=your_key
|
|
139
223
|
${chalk.yellow('PowerShell:')} $env:WENOX_API_KEY="your_key"
|
|
140
224
|
4. Run: ${chalk.cyan('wenox')}
|
|
141
225
|
|
|
226
|
+
${chalk.bold('Auto-Fix:')}
|
|
227
|
+
WENOX automatically detects and fixes Python dependency issues!
|
|
228
|
+
|
|
142
229
|
${chalk.bold('Troubleshooting:')}
|
|
143
230
|
⢠If 'wenox' command not found, try: ${chalk.cyan('npx wenox-cli')}
|
|
144
|
-
ā¢
|
|
231
|
+
⢠WENOX will auto-fix Python dependency conflicts
|
|
145
232
|
⢠Or restart your terminal after installation
|
|
146
233
|
|
|
147
234
|
${chalk.bold('System Requirements:')}
|
|
148
|
-
⢠Python 3.10+
|
|
235
|
+
⢠Python 3.10+ (auto-fixes dependency issues)
|
|
149
236
|
⢠Node.js 16+ for NPM installation
|
|
150
237
|
`);
|
|
151
238
|
return;
|
|
@@ -159,6 +246,18 @@ ${chalk.bold('System Requirements:')}
|
|
|
159
246
|
// Check API key
|
|
160
247
|
checkApiKey();
|
|
161
248
|
|
|
249
|
+
// Check and auto-fix dependencies
|
|
250
|
+
const dependenciesOk = await checkAiderStatus();
|
|
251
|
+
if (!dependenciesOk) {
|
|
252
|
+
console.log(chalk.cyan('š§ Auto-fixing Python dependencies...'));
|
|
253
|
+
const fixed = await autoFixDependencies();
|
|
254
|
+
if (!fixed) {
|
|
255
|
+
console.log(chalk.red('ā Could not resolve dependencies automatically'));
|
|
256
|
+
console.log(chalk.cyan('š” Please run manually: pip install aider-chat tree-sitter-languages'));
|
|
257
|
+
process.exit(1);
|
|
258
|
+
}
|
|
259
|
+
}
|
|
260
|
+
|
|
162
261
|
// Run aider with WENOX branding
|
|
163
262
|
await runAider();
|
|
164
263
|
}
|