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.0",
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
- // Only update .env if the configured model was inaccessible and a fallback was found
305
- if (model !== configuredModel) {
306
- try {
307
- const envPath = path.resolve(__dirname, '..', '.env');
308
- let envContent = '';
309
- try { envContent = fs.readFileSync(envPath, 'utf8'); } catch {}
310
- const lines = envContent.split('\n').filter(l => !/^\s*WALLE_MODEL\s*=/.test(l));
311
- while (lines.length && lines[lines.length - 1].trim() === '') lines.pop();
312
- lines.push('', `WALLE_MODEL=${model}`);
313
- fs.writeFileSync(envPath, lines.join('\n') + '\n', { mode: 0o600 });
314
- process.env.WALLE_MODEL = model;
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.' }));
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "walle",
3
- "version": "0.6.0",
3
+ "version": "0.6.1",
4
4
  "private": true,
5
5
  "description": "Wall-E — your personal digital twin",
6
6
  "scripts": {