neoagent 2.4.1-beta.37 → 2.4.1-beta.39

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.37",
3
+ "version": "2.4.1-beta.39",
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
- 63ce7c2ea80de28857e3b28e2f06864b
1
+ 1636c605494dd3c6974f0d4eab186b24
@@ -37,6 +37,6 @@ _flutter.buildConfig = {"engineRevision":"c416acfeb8126e097f758c664aaa3da929e27d
37
37
 
38
38
  _flutter.loader.load({
39
39
  serviceWorkerSettings: {
40
- serviceWorkerVersion: "2365760185" /* Flutter's service worker is deprecated and will be removed in a future Flutter release. */
40
+ serviceWorkerVersion: "2734177113" /* Flutter's service worker is deprecated and will be removed in a future Flutter release. */
41
41
  }
42
42
  });
@@ -134211,7 +134211,7 @@ r===$&&A.b()
134211
134211
  o.push(A.jR(p,A.jd(!1,new A.a4(B.uo,A.dr(new A.cy(B.hq,new A.a7x(r,p),p),p,p),p),!1,B.H,!0),p,p,0,0,0,p))}r=!1
134212
134212
  if(!s.ay)if(!s.ch){r=s.e
134213
134213
  r===$&&A.b()
134214
- r=B.b.t("mq44l4tl-174aa08").length!==0&&r.b}if(r){r=s.d
134214
+ r=B.b.t("mq47upa5-1fc5165").length!==0&&r.b}if(r){r=s.d
134215
134215
  r===$&&A.b()
134216
134216
  r=r.av&&!r.aQ?84:0
134217
134217
  q=s.e
@@ -139705,7 +139705,7 @@ $S:0}
139705
139705
  A.ZT.prototype={}
139706
139706
  A.Sy.prototype={
139707
139707
  nc(a){var s=this
139708
- if(B.b.t("mq44l4tl-174aa08").length===0||s.a!=null)return
139708
+ if(B.b.t("mq47upa5-1fc5165").length===0||s.a!=null)return
139709
139709
  s.AR()
139710
139710
  s.a=A.qh(B.Rc,new A.bag(s))},
139711
139711
  AR(){var s=0,r=A.l(t.H),q,p=2,o=[],n=this,m,l,k,j,i,h,g,f
@@ -139723,7 +139723,7 @@ if(!t.f.b(k)){s=1
139723
139723
  break}i=J.T(k,"buildId")
139724
139724
  h=i==null?null:B.b.t(J.p(i))
139725
139725
  j=h==null?"":h
139726
- if(J.bf(j)===0||J.d(j,"mq44l4tl-174aa08")){s=1
139726
+ if(J.bf(j)===0||J.d(j,"mq47upa5-1fc5165")){s=1
139727
139727
  break}n.b=!0
139728
139728
  n.D()
139729
139729
  p=2
@@ -139740,7 +139740,7 @@ case 2:return A.i(o.at(-1),r)}})
139740
139740
  return A.k($async$AR,r)},
139741
139741
  vy(){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
139742
139742
  var $async$vy=A.h(function(a2,a3){if(a2===1){o.push(a3)
139743
- s=p}for(;;)switch(s){case 0:if(B.b.t("mq44l4tl-174aa08").length===0||n.c){s=1
139743
+ s=p}for(;;)switch(s){case 0:if(B.b.t("mq47upa5-1fc5165").length===0||n.c){s=1
139744
139744
  break}n.c=!0
139745
139745
  n.D()
139746
139746
  p=4
@@ -161,6 +161,12 @@ const STATIC_MODELS = [
161
161
  provider: 'google',
162
162
  purpose: 'general'
163
163
  },
164
+ {
165
+ id: 'gemini-3.1-pro',
166
+ label: 'Gemini 3.1 Pro (High)',
167
+ provider: 'google',
168
+ purpose: 'general'
169
+ },
164
170
  {
165
171
  id: 'MiniMax-M2.7',
166
172
  label: 'MiniMax M2.7 (Coding Plan)',
@@ -10,14 +10,16 @@ class GoogleProvider extends BaseProvider {
10
10
  'gemini-2.0-pro',
11
11
  'gemini-1.5-pro',
12
12
  'gemini-1.5-flash',
13
- 'gemini-3.1-flash-lite-preview'
13
+ 'gemini-3.1-flash-lite-preview',
14
+ 'gemini-3.1-pro'
14
15
  ];
15
16
  this.contextWindows = {
16
17
  'gemini-2.0-flash': 1048576,
17
18
  'gemini-2.0-pro': 2097152,
18
19
  'gemini-1.5-pro': 2097152,
19
20
  'gemini-1.5-flash': 1048576,
20
- 'gemini-3.1-flash-lite-preview': 1048576
21
+ 'gemini-3.1-flash-lite-preview': 1048576,
22
+ 'gemini-3.1-pro': 2097152
21
23
  };
22
24
  this.genAI = new GoogleGenerativeAI(config.apiKey || process.env.GOOGLE_AI_KEY);
23
25
  }
@@ -177,14 +179,12 @@ class GoogleProvider extends BaseProvider {
177
179
  const toolCalls = [];
178
180
 
179
181
  for await (const chunk of result.stream) {
180
- const text = chunk.text();
181
- if (text) {
182
- content += text;
183
- yield { type: 'content', content: text };
184
- }
185
-
186
182
  for (const candidate of chunk.candidates || []) {
187
183
  for (const part of candidate.content?.parts || []) {
184
+ if (part.text) {
185
+ content += part.text;
186
+ yield { type: 'content', content: part.text };
187
+ }
188
188
  if (part.functionCall) {
189
189
  toolCalls.push({
190
190
  id: `call_${Date.now()}_${Math.random().toString(36).slice(2, 8)}`,
@@ -84,12 +84,25 @@ class OllamaProvider extends BaseProvider {
84
84
  buildChatBody(messages, tools, options, stream) {
85
85
  const body = {
86
86
  model: options.model || this.config.model || 'llama3.1',
87
- messages: messages.map(m => ({
88
- role: m.role,
89
- content: m.content || '',
90
- ...(m.tool_calls ? { tool_calls: m.tool_calls } : {}),
91
- ...(m.tool_call_id ? { tool_call_id: m.tool_call_id } : {})
92
- })),
87
+ messages: messages.map(m => {
88
+ const msg = {
89
+ role: m.role,
90
+ content: m.content || '',
91
+ ...(m.tool_call_id ? { tool_call_id: m.tool_call_id } : {})
92
+ };
93
+ if (m.tool_calls) {
94
+ msg.tool_calls = m.tool_calls.map(tc => ({
95
+ ...tc,
96
+ function: {
97
+ ...tc.function,
98
+ arguments: typeof tc.function.arguments === 'string'
99
+ ? (function() { try { return JSON.parse(tc.function.arguments || '{}'); } catch(e) { return {}; } })()
100
+ : tc.function.arguments
101
+ }
102
+ }));
103
+ }
104
+ return msg;
105
+ }),
93
106
  stream,
94
107
  options: {
95
108
  temperature: options.temperature ?? 0.7,
@@ -184,6 +197,7 @@ class OllamaProvider extends BaseProvider {
184
197
  const decoder = new TextDecoder();
185
198
  let content = '';
186
199
  let buffer = '';
200
+ let accumulatedToolCalls = [];
187
201
 
188
202
  while (true) {
189
203
  const { done, value } = await reader.read();
@@ -201,20 +215,23 @@ class OllamaProvider extends BaseProvider {
201
215
  content += data.message.content;
202
216
  yield { type: 'content', content: data.message.content };
203
217
  }
204
- if (data.done) {
205
- const toolCalls = (data.message?.tool_calls || []).map((tc, i) => ({
218
+ if (data.message?.tool_calls && Array.isArray(data.message.tool_calls)) {
219
+ const mapped = data.message.tool_calls.map((tc, i) => ({
206
220
  id: `call_ollama_${Date.now()}_${i}`,
207
221
  type: 'function',
208
222
  function: {
209
223
  name: tc.function.name,
210
- arguments: JSON.stringify(tc.function.arguments || {})
224
+ arguments: typeof tc.function.arguments === 'string' ? tc.function.arguments : JSON.stringify(tc.function.arguments || {})
211
225
  }
212
226
  }));
227
+ accumulatedToolCalls = accumulatedToolCalls.concat(mapped);
228
+ }
229
+ if (data.done) {
213
230
  yield {
214
231
  type: 'done',
215
232
  content,
216
- toolCalls,
217
- finishReason: toolCalls.length > 0 ? 'tool_calls' : 'stop',
233
+ toolCalls: accumulatedToolCalls,
234
+ finishReason: accumulatedToolCalls.length > 0 ? 'tool_calls' : 'stop',
218
235
  usage: data.prompt_eval_count ? {
219
236
  promptTokens: data.prompt_eval_count || 0,
220
237
  completionTokens: data.eval_count || 0,