beast-agent 2.38.1 → 2.38.2
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 +1 -1
- package/src/main.js +36 -5
package/package.json
CHANGED
package/src/main.js
CHANGED
|
@@ -5144,11 +5144,17 @@ ipcMain.handle('agent:send', (_e, { sessionId, text }) => {
|
|
|
5144
5144
|
const fsid = String(sessionId);
|
|
5145
5145
|
let fsess = engine.cache.get(fsid);
|
|
5146
5146
|
if (!fsess) { try { fsess = engine._load(fsid); } catch {} }
|
|
5147
|
-
if (fsess && !fsess.botId && !fsess.bgJob && financeState.mode
|
|
5148
|
-
|
|
5149
|
-
|
|
5150
|
-
|
|
5151
|
-
|
|
5147
|
+
if (fsess && !fsess.botId && !fsess.bgJob && financeState.mode) {
|
|
5148
|
+
if (!fsess.finance) {
|
|
5149
|
+
engine.markFinance(fsid, false);
|
|
5150
|
+
finApplyTraderFields(fsess);
|
|
5151
|
+
fsess.financeTrader = false; /* chat copilot'ı — trader değil */
|
|
5152
|
+
engine.cache.set(fsid, fsess);
|
|
5153
|
+
} else if (!financeState.agents.has(fsid)) {
|
|
5154
|
+
/* finance SOHBET botu: ajan talimatı/ayarlar HER MESAJDA tazelenir —
|
|
5155
|
+
asıl bot paralel ajanlardan geri kalmaz */
|
|
5156
|
+
finApplyChatFields(fsess);
|
|
5157
|
+
}
|
|
5152
5158
|
}
|
|
5153
5159
|
}
|
|
5154
5160
|
} catch {}
|
|
@@ -9353,6 +9359,19 @@ function finApplyTraderFields(s, symbolsOverride, role) {
|
|
|
9353
9359
|
engine.cache.set(String(s.id), s);
|
|
9354
9360
|
}
|
|
9355
9361
|
|
|
9362
|
+
/* Finance SOHBET oturumu (chat copilot) alanlarını tazele — trader bayrağı
|
|
9363
|
+
KORUNUR. Strateji/sembol/limit/rol-skill değişiklikleri "asıl bot"a da
|
|
9364
|
+
ulaşsın; paralel ajanlar tur başında zaten tazeleniyor. */
|
|
9365
|
+
function finApplyChatFields(s) {
|
|
9366
|
+
if (!s) return;
|
|
9367
|
+
const wasTrader = !!s.financeTrader;
|
|
9368
|
+
finApplyTraderFields(s);
|
|
9369
|
+
s.financeTrader = wasTrader;
|
|
9370
|
+
if (!wasTrader) s.financeAuto = false; /* sohbet copilot'ı — otonom trader değil */
|
|
9371
|
+
engine.cache.set(String(s.id), s);
|
|
9372
|
+
return s;
|
|
9373
|
+
}
|
|
9374
|
+
|
|
9356
9375
|
/* Yeni finance ajanı aç (ana trader YA DA sembol işçisi YA DA analiz ekibi rolü) */
|
|
9357
9376
|
function finAgentCreate(symbols, isMain, role) {
|
|
9358
9377
|
const f = finCfg();
|
|
@@ -9746,6 +9765,18 @@ ipcMain.handle('finance:settings', async (_e, patch) => {
|
|
|
9746
9765
|
if (ts) finApplyTraderFields(ts);
|
|
9747
9766
|
} catch {}
|
|
9748
9767
|
}
|
|
9768
|
+
/* finance SOHBET oturumları: strateji/sembol/limit/rol-skill değişince ANINDA
|
|
9769
|
+
tazelenir — "asıl bot" (Beast Finance sohbeti) de aynı ajan talimatını görür */
|
|
9770
|
+
if (engine) {
|
|
9771
|
+
try {
|
|
9772
|
+
for (const [ssid, ss] of engine.cache) {
|
|
9773
|
+
if (!ss || !ss.finance || ss.botId || ss.bgJob) continue;
|
|
9774
|
+
if (financeState.agents.has(String(ssid))) continue; /* ajanlar tur başında tazelenir */
|
|
9775
|
+
if (ssid === String(financeState.traderSid || '')) continue;
|
|
9776
|
+
finApplyChatFields(ss);
|
|
9777
|
+
}
|
|
9778
|
+
} catch {}
|
|
9779
|
+
}
|
|
9749
9780
|
return { ok: true, cfg: f };
|
|
9750
9781
|
});
|
|
9751
9782
|
|