neoagent 2.4.1-beta.25 → 2.4.1-beta.26

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": "neoagent",
3
- "version": "2.4.1-beta.25",
3
+ "version": "2.4.1-beta.26",
4
4
  "description": "Proactive personal AI agent with no limits",
5
5
  "license": "AGPL-3.0-only",
6
6
  "main": "server/index.js",
@@ -1 +1 @@
1
- 8dc61e46ee4d65f471fe1043daa166c4
1
+ 1d4acb4ab8222124f88b6c18b5b8e9e3
@@ -37,6 +37,6 @@ _flutter.buildConfig = {"engineRevision":"c416acfeb8126e097f758c664aaa3da929e27d
37
37
 
38
38
  _flutter.loader.load({
39
39
  serviceWorkerSettings: {
40
- serviceWorkerVersion: "1575216533" /* Flutter's service worker is deprecated and will be removed in a future Flutter release. */
40
+ serviceWorkerVersion: "1380510725" /* Flutter's service worker is deprecated and will be removed in a future Flutter release. */
41
41
  }
42
42
  });
@@ -132757,7 +132757,7 @@ r===$&&A.b()
132757
132757
  o.push(A.jJ(p,A.j7(!1,new A.a3(B.uk,A.e1(new A.cJ(B.ho,new A.a7e(r,p),p),p,p),p),!1,B.H,!0),p,p,0,0,0,p))}r=!1
132758
132758
  if(!s.ay)if(!s.ch){r=s.e
132759
132759
  r===$&&A.b()
132760
- r=B.b.t("mpviiyy0-f2e62ff").length!==0&&r.b}if(r){r=s.d
132760
+ r=B.b.t("mpvkc7c5-07242aa").length!==0&&r.b}if(r){r=s.d
132761
132761
  r===$&&A.b()
132762
132762
  r=r.ad&&!r.Z?84:0
132763
132763
  q=s.e
@@ -138212,7 +138212,7 @@ $S:0}
138212
138212
  A.ZH.prototype={}
138213
138213
  A.Sw.prototype={
138214
138214
  nc(a){var s=this
138215
- if(B.b.t("mpviiyy0-f2e62ff").length===0||s.a!=null)return
138215
+ if(B.b.t("mpvkc7c5-07242aa").length===0||s.a!=null)return
138216
138216
  s.AH()
138217
138217
  s.a=A.qf(B.R3,new A.b9B(s))},
138218
138218
  AH(){var s=0,r=A.l(t.H),q,p=2,o=[],n=this,m,l,k,j,i,h,g,f
@@ -138230,7 +138230,7 @@ if(!t.f.b(k)){s=1
138230
138230
  break}i=J.U(k,"buildId")
138231
138231
  h=i==null?null:B.b.t(J.p(i))
138232
138232
  j=h==null?"":h
138233
- if(J.bj(j)===0||J.d(j,"mpviiyy0-f2e62ff")){s=1
138233
+ if(J.bj(j)===0||J.d(j,"mpvkc7c5-07242aa")){s=1
138234
138234
  break}n.b=!0
138235
138235
  n.F()
138236
138236
  p=2
@@ -138247,7 +138247,7 @@ case 2:return A.i(o.at(-1),r)}})
138247
138247
  return A.k($async$AH,r)},
138248
138248
  vs(){var s=0,r=A.l(t.H),q,p=2,o=[],n=this,m,l,k,j,i,h,g,f,e,d,c,b,a,a0,a1
138249
138249
  var $async$vs=A.h(function(a2,a3){if(a2===1){o.push(a3)
138250
- s=p}for(;;)switch(s){case 0:if(B.b.t("mpviiyy0-f2e62ff").length===0||n.c){s=1
138250
+ s=p}for(;;)switch(s){case 0:if(B.b.t("mpvkc7c5-07242aa").length===0||n.c){s=1
138251
138251
  break}n.c=!0
138252
138252
  n.F()
138253
138253
  p=4
@@ -317,6 +317,9 @@ class MessagingManager extends EventEmitter {
317
317
  config.userId = userId;
318
318
  config.agentId = agentId;
319
319
  config.accessPolicy = this._loadAccessPolicy(userId, agentId, platformName);
320
+ const existingConnection = db
321
+ .prepare('SELECT id, status FROM platform_connections WHERE user_id = ? AND agent_id = ? AND platform = ?')
322
+ .get(userId, agentId, platformName);
320
323
  const PlatformClass = this.platformTypes[platformName];
321
324
  if (!PlatformClass) throw new Error(`Unknown platform: ${platformName}`);
322
325
  if (platformName === 'meshtastic' && !readMeshtasticEnabled()) {
@@ -325,7 +328,18 @@ class MessagingManager extends EventEmitter {
325
328
 
326
329
  if (platformName === 'whatsapp' && !config.authDir) {
327
330
  config.authDir = this._scopedPlatformAuthDir(userId, agentId, platformName);
328
- this._maybeMigrateLegacyWhatsAppAuth(config.authDir);
331
+ let shouldMigrateLegacyAuth = true;
332
+ if (
333
+ existingConnection &&
334
+ existingConnection.status !== 'connected' &&
335
+ existingConnection.status !== 'awaiting_qr'
336
+ ) {
337
+ fs.rmSync(config.authDir, { recursive: true, force: true });
338
+ shouldMigrateLegacyAuth = false;
339
+ }
340
+ if (shouldMigrateLegacyAuth) {
341
+ this._maybeMigrateLegacyWhatsAppAuth(config.authDir);
342
+ }
329
343
  }
330
344
 
331
345
  // For Telnyx, inject saved whitelist and voice secret into config before constructing
@@ -443,8 +457,7 @@ class MessagingManager extends EventEmitter {
443
457
  await this.ingestMessage(userId, platformName, msg, { agentId });
444
458
  });
445
459
 
446
- const existing = db.prepare('SELECT id FROM platform_connections WHERE user_id = ? AND agent_id = ? AND platform = ?').get(userId, agentId, platformName);
447
- if (!existing) {
460
+ if (!existingConnection) {
448
461
  db.prepare('INSERT INTO platform_connections (user_id, agent_id, platform, config, status) VALUES (?, ?, ?, ?, ?)')
449
462
  .run(userId, agentId, platformName, storedConfig, 'connecting');
450
463
  } else {