create-walle 0.6.0 → 0.6.2

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.2",
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,19 @@ 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
+ // Restart Wall-E so it picks up the new model
315
+ _restartWalleQuiet();
316
+ } catch {}
317
317
  res.end(JSON.stringify({ ok: true, model }));
318
318
  } else if (authError) {
319
319
  res.end(JSON.stringify({ ok: false, error: 'Invalid API key — double-check the key and try again.' }));
@@ -503,8 +503,8 @@ function handleApi(req, res, url) {
503
503
  }
504
504
  fs.writeFileSync(envPath, lines.join('\n') + '\n', { mode: 0o600 });
505
505
  setup.clearSetupCache(); // so next / request goes to dashboard
506
- // Restart Wall-E so it picks up the new env vars from .env
507
- if (apiKey || gw) {
506
+ // Restart Wall-E so it picks up new env vars (key, gateway, or model change)
507
+ if (apiKey || gw || walleModel) {
508
508
  _restartWalleQuiet();
509
509
  }
510
510
  res.writeHead(200, { 'Content-Type': 'application/json' });
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "walle",
3
- "version": "0.6.0",
3
+ "version": "0.6.2",
4
4
  "private": true,
5
5
  "description": "Wall-E — your personal digital twin",
6
6
  "scripts": {