create-walle 0.6.0 → 0.6.1
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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-walle",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.1",
|
|
4
4
|
"description": "Wall-E — your personal digital twin. AI agent that learns from Slack, email & calendar. Includes dashboard, chat, and 7 bundled skills.",
|
|
5
5
|
"bin": {
|
|
6
6
|
"create-walle": "bin/create-walle.js"
|
|
@@ -301,19 +301,17 @@ function handleApi(req, res, url) {
|
|
|
301
301
|
probeModel(apiKey, baseUrl, customHeadersB64, probeOrder).then(({ model, authError }) => {
|
|
302
302
|
res.writeHead(200, { 'Content-Type': 'application/json' });
|
|
303
303
|
if (model) {
|
|
304
|
-
//
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
} catch {}
|
|
316
|
-
}
|
|
304
|
+
// Persist the working model to .env (whether it's the configured one or a fallback)
|
|
305
|
+
try {
|
|
306
|
+
const envPath = path.resolve(__dirname, '..', '.env');
|
|
307
|
+
let envContent = '';
|
|
308
|
+
try { envContent = fs.readFileSync(envPath, 'utf8'); } catch {}
|
|
309
|
+
const lines = envContent.split('\n').filter(l => !/^\s*WALLE_MODEL\s*=/.test(l));
|
|
310
|
+
while (lines.length && lines[lines.length - 1].trim() === '') lines.pop();
|
|
311
|
+
lines.push('', `WALLE_MODEL=${model}`);
|
|
312
|
+
fs.writeFileSync(envPath, lines.join('\n') + '\n', { mode: 0o600 });
|
|
313
|
+
process.env.WALLE_MODEL = model;
|
|
314
|
+
} catch {}
|
|
317
315
|
res.end(JSON.stringify({ ok: true, model }));
|
|
318
316
|
} else if (authError) {
|
|
319
317
|
res.end(JSON.stringify({ ok: false, error: 'Invalid API key — double-check the key and try again.' }));
|