neoagent 2.3.1-beta.100 → 2.3.1-beta.101

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/.env.example CHANGED
@@ -122,6 +122,9 @@ GITHUB_COPILOT_ACCESS_TOKEN=
122
122
  OPENAI_CODEX_ACCESS_TOKEN=
123
123
  # Optional refresh token if your login flow returns it.
124
124
  OPENAI_CODEX_REFRESH_TOKEN=
125
+ # Optional: ChatGPT account ID for the chatgpt-account-id header.
126
+ # If not set, it is auto-decoded from the JWT in OPENAI_CODEX_ACCESS_TOKEN.
127
+ # OPENAI_CODEX_ACCOUNT_ID=
125
128
 
126
129
  ########################################
127
130
  # Provider endpoint overrides
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "neoagent",
3
- "version": "2.3.1-beta.100",
3
+ "version": "2.3.1-beta.101",
4
4
  "description": "Proactive personal AI agent with no limits",
5
5
  "license": "MIT",
6
6
  "main": "server/index.js",
@@ -1 +1 @@
1
- 51cb9ffd08a8fe2902020a967552ae98
1
+ 8b0dc1b848bc67887f399a80a15258e6
@@ -37,6 +37,6 @@ _flutter.buildConfig = {"engineRevision":"42d3d75a56efe1a2e9902f52dc8006099c45d9
37
37
 
38
38
  _flutter.loader.load({
39
39
  serviceWorkerSettings: {
40
- serviceWorkerVersion: "1593928718" /* Flutter's service worker is deprecated and will be removed in a future Flutter release. */
40
+ serviceWorkerVersion: "3696925671" /* Flutter's service worker is deprecated and will be removed in a future Flutter release. */
41
41
  }
42
42
  });
@@ -129338,7 +129338,7 @@ r===$&&A.b()
129338
129338
  o.push(A.ii(p,A.iY(!1,new A.a3(B.tM,A.dT(new A.cI(B.he,new A.a5V(r,p),p),p,p),p),!1,B.I,!0),p,p,0,0,0,p))}r=!1
129339
129339
  if(!s.ay)if(!s.ch){r=s.e
129340
129340
  r===$&&A.b()
129341
- r=B.b.t("mp9zxm4k-cfb96ba").length!==0&&r.b}if(r){r=s.d
129341
+ r=B.b.t("mpa5woez-bed15cd").length!==0&&r.b}if(r){r=s.d
129342
129342
  r===$&&A.b()
129343
129343
  r=r.ag&&!r.V?84:0
129344
129344
  q=s.e
@@ -134146,7 +134146,7 @@ $S:236}
134146
134146
  A.Ys.prototype={}
134147
134147
  A.Rr.prototype={
134148
134148
  mT(a){var s=this
134149
- if(B.b.t("mp9zxm4k-cfb96ba").length===0||s.a!=null)return
134149
+ if(B.b.t("mpa5woez-bed15cd").length===0||s.a!=null)return
134150
134150
  s.A5()
134151
134151
  s.a=A.q1(B.PP,new A.b58(s))},
134152
134152
  A5(){var s=0,r=A.l(t.H),q,p=2,o=[],n=this,m,l,k,j,i,h,g,f
@@ -134164,7 +134164,7 @@ if(!t.f.b(k)){s=1
134164
134164
  break}i=J.Z(k,"buildId")
134165
134165
  h=i==null?null:B.b.t(J.r(i))
134166
134166
  j=h==null?"":h
134167
- if(J.bm(j)===0||J.d(j,"mp9zxm4k-cfb96ba")){s=1
134167
+ if(J.bm(j)===0||J.d(j,"mpa5woez-bed15cd")){s=1
134168
134168
  break}n.b=!0
134169
134169
  n.D()
134170
134170
  p=2
@@ -134181,7 +134181,7 @@ case 2:return A.i(o.at(-1),r)}})
134181
134181
  return A.k($async$A5,r)},
134182
134182
  vb(){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
134183
134183
  var $async$vb=A.h(function(a2,a3){if(a2===1){o.push(a3)
134184
- s=p}for(;;)switch(s){case 0:if(B.b.t("mp9zxm4k-cfb96ba").length===0||n.c){s=1
134184
+ s=p}for(;;)switch(s){case 0:if(B.b.t("mpa5woez-bed15cd").length===0||n.c){s=1
134185
134185
  break}n.c=!0
134186
134186
  n.D()
134187
134187
  p=4
@@ -1,6 +1,17 @@
1
1
  const OpenAI = require('openai');
2
2
  const { BaseProvider } = require('./base');
3
3
 
4
+ function decodeJwtPayload(token) {
5
+ try {
6
+ const parts = String(token || '').split('.');
7
+ if (parts.length < 2) return null;
8
+ const payload = Buffer.from(parts[1], 'base64url').toString('utf8');
9
+ return JSON.parse(payload);
10
+ } catch {
11
+ return null;
12
+ }
13
+ }
14
+
4
15
  const DEFAULT_BASE_URL = 'https://chatgpt.com/backend-api/codex';
5
16
 
6
17
  function isCodexBackendBaseUrl(baseURL) {
@@ -183,11 +194,20 @@ class OpenAICodexProvider extends BaseProvider {
183
194
  'gpt-5.4',
184
195
  'gpt-5.4-mini',
185
196
  ]);
197
+ let accountId = process.env.OPENAI_CODEX_ACCOUNT_ID || '';
198
+ if (!accountId && this.usesCodexBackend) {
199
+ const accessToken = config.apiKey || process.env.OPENAI_CODEX_ACCESS_TOKEN || '';
200
+ const payload = decodeJwtPayload(accessToken);
201
+ accountId = payload?.chatgpt_account_id || payload?.['https://api.openai.com/auth']?.chatgpt_account_id || '';
202
+ }
203
+
186
204
  const defaultHeaders = this.usesCodexBackend
187
205
  ? {
188
206
  'Editor-Version': process.env.OPENAI_CODEX_EDITOR_VERSION || 'vscode/1.99.0',
189
207
  'Editor-Plugin-Version': process.env.OPENAI_CODEX_EDITOR_PLUGIN_VERSION || 'neoagent/1.0.0',
190
208
  'User-Agent': process.env.OPENAI_CODEX_USER_AGENT || 'NeoAgent/1.0.0',
209
+ 'OpenAI-Beta': 'responses=experimental',
210
+ ...(accountId ? { 'chatgpt-account-id': accountId } : {}),
191
211
  }
192
212
  : undefined;
193
213
 
@@ -265,7 +285,9 @@ class OpenAICodexProvider extends BaseProvider {
265
285
  input,
266
286
  };
267
287
 
268
- if (instructions.length > 0) {
288
+ if (this.usesCodexBackend) {
289
+ request.instructions = instructions.join('\n\n');
290
+ } else if (instructions.length > 0) {
269
291
  request.instructions = instructions.join('\n\n');
270
292
  }
271
293