neoagent 2.3.1-beta.37 → 2.3.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.3.1-beta.37",
3
+ "version": "2.3.1-beta.39",
4
4
  "description": "Proactive personal AI agent with no limits",
5
5
  "license": "MIT",
6
6
  "main": "server/index.js",
@@ -37,6 +37,6 @@ _flutter.buildConfig = {"engineRevision":"42d3d75a56efe1a2e9902f52dc8006099c45d9
37
37
 
38
38
  _flutter.loader.load({
39
39
  serviceWorkerSettings: {
40
- serviceWorkerVersion: "3530273712" /* Flutter's service worker is deprecated and will be removed in a future Flutter release. */
40
+ serviceWorkerVersion: "995641613" /* Flutter's service worker is deprecated and will be removed in a future Flutter release. */
41
41
  }
42
42
  });
@@ -33,7 +33,20 @@ function selectMcpTools(task, mcpTools = []) {
33
33
  }
34
34
 
35
35
  function selectToolsForTask(task, builtInTools = [], mcpTools = [], _options = {}) {
36
- return [...builtInTools, ...selectMcpTools(task, mcpTools)];
36
+ const MAX_TOOLS = 128; // Strict provider limit (e.g. Github Copilot / OpenAI)
37
+ const selectedMcp = selectMcpTools(task, mcpTools);
38
+
39
+ if (builtInTools.length + selectedMcp.length <= MAX_TOOLS) {
40
+ return [...builtInTools, ...selectedMcp];
41
+ }
42
+
43
+ // If we exceed the limit, prioritize base tools and take as many MCP tools as fit
44
+ const remainingSpace = MAX_TOOLS - builtInTools.length;
45
+ if (remainingSpace > 0) {
46
+ return [...builtInTools, ...selectedMcp.slice(0, remainingSpace)];
47
+ }
48
+
49
+ return builtInTools.slice(0, MAX_TOOLS);
37
50
  }
38
51
 
39
52
  module.exports = { selectToolsForTask, selectMcpTools };
@@ -75,6 +75,7 @@ class MeshtasticPlatform extends BasePlatform {
75
75
  this._transport = null;
76
76
  this._connectPromise = null;
77
77
  this._disconnecting = false;
78
+ this._reconnectTimer = null;
78
79
  }
79
80
 
80
81
  async connect() {
@@ -175,6 +176,7 @@ class MeshtasticPlatform extends BasePlatform {
175
176
  if (this._disconnecting) return;
176
177
  this.status = 'disconnected';
177
178
  this.emit('disconnected', { reason: info?.reason || 'device_disconnected' });
179
+ this._scheduleReconnect();
178
180
  });
179
181
 
180
182
  this.status = 'connected';
@@ -183,6 +185,19 @@ class MeshtasticPlatform extends BasePlatform {
183
185
  return { status: this.status };
184
186
  }
185
187
 
188
+ _scheduleReconnect() {
189
+ if (this._disconnecting || this._reconnectTimer) return;
190
+ console.log(`[Meshtastic] Connection lost. Reconnecting in 10 seconds...`);
191
+ this._reconnectTimer = setTimeout(() => {
192
+ this._reconnectTimer = null;
193
+ if (this._disconnecting) return;
194
+ this.connect().catch((err) => {
195
+ console.error(`[Meshtastic] Auto-reconnect failed:`, err.message);
196
+ this._scheduleReconnect();
197
+ });
198
+ }, 10000);
199
+ }
200
+
186
201
  _buildAuthInfo(conn) {
187
202
  const nodeNum = conn?.myNodeNum || 0;
188
203
  const user = conn?.nodeUsers.get(nodeNum) || {};
@@ -216,6 +231,10 @@ class MeshtasticPlatform extends BasePlatform {
216
231
  async disconnect() {
217
232
  this._disconnecting = true;
218
233
  this.status = 'disconnected';
234
+ if (this._reconnectTimer) {
235
+ clearTimeout(this._reconnectTimer);
236
+ this._reconnectTimer = null;
237
+ }
219
238
 
220
239
  const transport = this._transport;
221
240
  this._transport = null;