neoagent 3.1.1-beta.6 → 3.1.1-beta.7

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": "3.1.1-beta.6",
3
+ "version": "3.1.1-beta.7",
4
4
  "description": "Self-hosted AI agent for long-running tasks, automation, messaging, device control, and local memory",
5
5
  "license": "AGPL-3.0-only",
6
6
  "main": "server/index.js",
@@ -1 +1 @@
1
- 1f3c8d49376edaea381fffac366d6f2d
1
+ 66d8a64f104d72faf757b6613debe081
@@ -37,6 +37,6 @@ _flutter.buildConfig = {"engineRevision":"a10d8ac38de835021c8d2f920dbf50a920ccc0
37
37
 
38
38
  _flutter.loader.load({
39
39
  serviceWorkerSettings: {
40
- serviceWorkerVersion: "3722046936" /* Flutter's service worker is deprecated and will be removed in a future Flutter release. */
40
+ serviceWorkerVersion: "2653428156" /* Flutter's service worker is deprecated and will be removed in a future Flutter release. */
41
41
  }
42
42
  });
@@ -142207,7 +142207,7 @@ r===$&&A.b()
142207
142207
  p.push(A.jo(q,A.jr(!1,new A.X(B.wy,A.cX(new A.cI(B.kg,new A.acv(r,q),q),q,q),q),!1,B.I,!0),q,q,0,0,0,q))}r=!1
142208
142208
  if(!s.ay)if(!s.ch){r=s.e
142209
142209
  r===$&&A.b()
142210
- r=B.b.t("mr53o14m-76343d7").length!==0&&r.b}if(r){r=s.d
142210
+ r=B.b.t("mr5ccfi2-3984ade").length!==0&&r.b}if(r){r=s.d
142211
142211
  r===$&&A.b()
142212
142212
  r=r.aF&&!r.aA?84:0
142213
142213
  s=s.e
@@ -148860,7 +148860,7 @@ $S:0}
148860
148860
  A.a3_.prototype={}
148861
148861
  A.Wq.prototype={
148862
148862
  nP(a){var s=this
148863
- if(B.b.t("mr53o14m-76343d7").length===0||s.a!=null)return
148863
+ if(B.b.t("mr5ccfi2-3984ade").length===0||s.a!=null)return
148864
148864
  s.Ch()
148865
148865
  s.a=A.mM(B.Xi,new A.bmg(s))},
148866
148866
  Ch(){var s=0,r=A.l(t.H),q,p=2,o=[],n=this,m,l,k,j,i,h,g,f
@@ -148878,7 +148878,7 @@ if(!t.f.b(k)){s=1
148878
148878
  break}i=J.a1(k,"buildId")
148879
148879
  h=i==null?null:B.b.t(J.q(i))
148880
148880
  j=h==null?"":h
148881
- if(J.bk(j)===0||J.f(j,"mr53o14m-76343d7")){s=1
148881
+ if(J.bk(j)===0||J.f(j,"mr5ccfi2-3984ade")){s=1
148882
148882
  break}n.b=!0
148883
148883
  n.F()
148884
148884
  p=2
@@ -148895,7 +148895,7 @@ case 2:return A.i(o.at(-1),r)}})
148895
148895
  return A.k($async$Ch,r)},
148896
148896
  wI(){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
148897
148897
  var $async$wI=A.h(function(a2,a3){if(a2===1){o.push(a3)
148898
- s=p}for(;;)switch(s){case 0:if(B.b.t("mr53o14m-76343d7").length===0||n.c){s=1
148898
+ s=p}for(;;)switch(s){case 0:if(B.b.t("mr5ccfi2-3984ade").length===0||n.c){s=1
148899
148899
  break}n.c=!0
148900
148900
  n.F()
148901
148901
  p=4
@@ -2,7 +2,8 @@
2
2
 
3
3
  const { SocialReachChannel } = require('./base');
4
4
  const { getPlatformDefinition } = require('../platforms');
5
- const { assertHttpUrl, compactText, fetchJson } = require('../utils');
5
+ const { cookieHeaderForPlatform, getCookieSummary } = require('../store');
6
+ const { DEFAULT_UA, assertHttpUrl, compactText, fetchJson } = require('../utils');
6
7
 
7
8
  function extractStatusId(url) {
8
9
  const parsed = assertHttpUrl(url);
@@ -21,15 +22,28 @@ class XChannel extends SocialReachChannel {
21
22
  return Boolean(extractStatusId(url));
22
23
  }
23
24
 
24
- async check() {
25
+ #headers(userId) {
26
+ const cookie = cookieHeaderForPlatform(userId, this.id);
27
+ return {
28
+ 'user-agent': DEFAULT_UA,
29
+ referer: 'https://x.com/',
30
+ ...(cookie ? { cookie } : {}),
31
+ };
32
+ }
33
+
34
+ async check({ userId } = {}) {
35
+ const cookies = getCookieSummary(userId, this.id);
25
36
  return {
26
37
  ...(await super.check()),
27
- activeBackend: 'x_syndication_public',
28
- message: 'Reads public X post links when X allows anonymous access.',
38
+ cookie: cookies,
39
+ activeBackend: cookies.configured ? 'x_syndication_cookies' : 'x_syndication_public',
40
+ message: cookies.configured
41
+ ? 'Reads X post links using imported cookies for better reliability.'
42
+ : 'Reads public X post links when X allows anonymous access. Import cookies from the Chrome extension for better reliability.',
29
43
  };
30
44
  }
31
45
 
32
- async read({ url }) {
46
+ async read({ userId, url }) {
33
47
  const id = extractStatusId(url);
34
48
  if (!id) {
35
49
  const error = new Error('A public X post URL is required.');
@@ -37,7 +51,11 @@ class XChannel extends SocialReachChannel {
37
51
  throw error;
38
52
  }
39
53
 
40
- const data = await fetchJson(`https://cdn.syndication.twimg.com/tweet-result?id=${encodeURIComponent(id)}&lang=en`);
54
+ const source = cookieHeaderForPlatform(userId, this.id) ? 'x_syndication_cookies' : 'x_syndication_public';
55
+ const data = await fetchJson(
56
+ `https://cdn.syndication.twimg.com/tweet-result?id=${encodeURIComponent(id)}&lang=en`,
57
+ { headers: this.#headers(userId) },
58
+ );
41
59
  return {
42
60
  platform: this.id,
43
61
  id,
@@ -60,7 +78,7 @@ class XChannel extends SocialReachChannel {
60
78
  bitrate: video.bitrate || null,
61
79
  })),
62
80
  url: `https://x.com/i/web/status/${id}`,
63
- source: 'x_syndication_public',
81
+ source,
64
82
  };
65
83
  }
66
84
  }
@@ -58,7 +58,7 @@ const PLATFORM_DEFINITIONS = Object.freeze({
58
58
  id: 'x',
59
59
  label: 'X / Twitter',
60
60
  tier: 2,
61
- setupKind: 'none',
61
+ setupKind: 'cookies',
62
62
  hosts: ['x.com', 'twitter.com', 'www.x.com', 'www.twitter.com'],
63
63
  domains: ['x.com', 'twitter.com'],
64
64
  },
@@ -6,7 +6,7 @@ const { deleteCookieBundle, getCookieSummary, writeCookieBundle } = require('./s
6
6
  const { domainsForPlatform, getPlatformDefinition, normalizePlatformId } = require('./platforms');
7
7
  const { assertHttpUrl } = require('./utils');
8
8
 
9
- const COOKIE_IMPORT_PLATFORMS = new Set(['xueqiu']);
9
+ const COOKIE_IMPORT_PLATFORMS = new Set(['xueqiu', 'x']);
10
10
  const MAX_IMPORTED_COOKIES = 80;
11
11
  const MAX_COOKIE_NAME_CHARS = 256;
12
12
  const MAX_COOKIE_VALUE_CHARS = 4096;