hedgequantx 2.6.0 → 2.6.1

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": "hedgequantx",
3
- "version": "2.6.0",
3
+ "version": "2.6.1",
4
4
  "description": "HedgeQuantX - Prop Futures Trading CLI",
5
5
  "main": "src/app.js",
6
6
  "bin": {
@@ -141,9 +141,15 @@ const connections = {
141
141
 
142
142
  /**
143
143
  * Saves all sessions to encrypted storage
144
+ * IMPORTANT: Preserves AI agent sessions when saving trading connections
144
145
  */
145
146
  saveToStorage() {
146
- const sessions = this.services.map(conn => {
147
+ // Load existing sessions to preserve AI settings
148
+ const existingSessions = storage.load();
149
+ const aiSession = existingSessions.find(s => s.type === 'ai');
150
+
151
+ // Build trading sessions
152
+ const tradingSessions = this.services.map(conn => {
147
153
  const session = {
148
154
  type: conn.type,
149
155
  propfirm: conn.propfirm,
@@ -163,7 +169,12 @@ const connections = {
163
169
  return session;
164
170
  });
165
171
 
166
- storage.save(sessions);
172
+ // Combine: trading sessions + preserved AI session
173
+ const allSessions = aiSession
174
+ ? [...tradingSessions, aiSession]
175
+ : tradingSessions;
176
+
177
+ storage.save(allSessions);
167
178
  },
168
179
 
169
180
  /**
@@ -360,9 +371,13 @@ const connections = {
360
371
  },
361
372
 
362
373
  /**
363
- * Disconnects all connections and clears sessions
374
+ * Disconnects all trading connections (preserves AI agents)
364
375
  */
365
376
  disconnectAll() {
377
+ // Preserve AI session before clearing
378
+ const existingSessions = storage.load();
379
+ const aiSession = existingSessions.find(s => s.type === 'ai');
380
+
366
381
  for (const conn of this.services) {
367
382
  try {
368
383
  if (conn.service?.logout) {
@@ -381,8 +396,15 @@ const connections = {
381
396
  }
382
397
 
383
398
  this.services = [];
384
- storage.clear();
385
- log.info('All connections disconnected');
399
+
400
+ // Save with preserved AI session (don't use storage.clear())
401
+ if (aiSession) {
402
+ storage.save([aiSession]);
403
+ log.info('Trading connections disconnected (AI agents preserved)');
404
+ } else {
405
+ storage.clear();
406
+ log.info('All connections disconnected');
407
+ }
386
408
  },
387
409
 
388
410
  /**