beast-agent 2.36.1 → 2.37.0
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 -3
- package/src/main.js +12 -1
- package/src/renderer/index.html +10 -1
- package/src/renderer/renderer.js +49 -1
- package/src/renderer/style.css +10 -2
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "beast-agent",
|
|
3
3
|
"productName": "Beast Agent",
|
|
4
|
-
"version": "2.
|
|
4
|
+
"version": "2.37.0",
|
|
5
5
|
"description": "Ultra-fast local agent shell for Windows.",
|
|
6
6
|
"author": "algokodcom (AlgoKod)",
|
|
7
7
|
"license": "MIT",
|
|
@@ -40,8 +40,6 @@
|
|
|
40
40
|
"dist": "electron-builder --win nsis portable",
|
|
41
41
|
"test": "node --test \"tests/**/*.test.js\"",
|
|
42
42
|
"release": "node scripts/release.js",
|
|
43
|
-
"skillsweb:sync": "node skillsweb/sync-builtins.js",
|
|
44
|
-
"skillsweb:deploy": "node skillsweb/sync-builtins.js && cd skillsweb && firebase deploy --only hosting:skills",
|
|
45
43
|
"postinstall": "node scripts/fix-electron.js --soft",
|
|
46
44
|
"prepublishOnly": "node scripts/swap-electron.js deps",
|
|
47
45
|
"postpublish": "node scripts/swap-electron.js devdeps"
|
package/src/main.js
CHANGED
|
@@ -8498,6 +8498,11 @@ function finCfg() {
|
|
|
8498
8498
|
if (typeof f.notifyTarget !== 'string') f.notifyTarget = 'auto';
|
|
8499
8499
|
if (typeof f.notifyTrades !== 'boolean') f.notifyTrades = true;
|
|
8500
8500
|
if (typeof f.notifyWatchdog !== 'boolean') f.notifyWatchdog = true;
|
|
8501
|
+
/* KANAL OLAY FİLTRESİ: varsayılan true — WhatsApp/Telegram/Discord'a yalnız
|
|
8502
|
+
emir/işlem olayları (açılış, kapanış, bekleyen emir, iptal) düşer; fiyat
|
|
8503
|
+
alarmı, koruma (BE/trailing/kısmi TP), günlük limit ve rapor bildirimleri
|
|
8504
|
+
panelde kalır. false = tüm olaylar kanallara gider (eski davranış). */
|
|
8505
|
+
if (typeof f.notifyTradeOnly !== 'boolean') f.notifyTradeOnly = true;
|
|
8501
8506
|
if (!Number.isFinite(Number(f.maxDailyLossPct))) f.maxDailyLossPct = 3;
|
|
8502
8507
|
/* GÜNLÜK LİMİT AKSİYONU: warn = yalnız uyarı; stop = tüm finance ajanlarını
|
|
8503
8508
|
durdur; flatten = durdur + tüm pozisyonları kapat */
|
|
@@ -8617,6 +8622,11 @@ function financeNotify(text, kind, panel) {
|
|
|
8617
8622
|
try { cfg = finCfg(); } catch { cfg = {}; }
|
|
8618
8623
|
const target = String((cfg && cfg.notifyTarget) || 'auto');
|
|
8619
8624
|
if (target === 'off') return;
|
|
8625
|
+
/* KANAL FİLTRESİ: varsayılan olarak kanallara SADECE emir/işlem olayları
|
|
8626
|
+
gider (emir açılış/kapanış, bekleyen emir, iptal). Alarm/koruma/risk/rapor
|
|
8627
|
+
bildirimleri yalnız panelde görünür. */
|
|
8628
|
+
const kindStr = String(kind || '');
|
|
8629
|
+
if (cfg.notifyTradeOnly !== false && !['trade', 'close', 'pending', 'cancel'].includes(kindStr)) return;
|
|
8620
8630
|
const body = '💼 *Beast Finance*\n' + line;
|
|
8621
8631
|
const senders = [];
|
|
8622
8632
|
try {
|
|
@@ -9396,7 +9406,7 @@ function finTraderBrief(agent) {
|
|
|
9396
9406
|
roleDef
|
|
9397
9407
|
? 'Bulgularını agent_dm ile ANA TRADER\u2019a bildir (to: "Trader" ya da ajan başlığı anahtarı); teknik/öneri çelişkisi varsa gerekçenle yaz.'
|
|
9398
9408
|
: f.strategy ? `Sahibinin strateji notu: ${f.strategy}` : 'Strateji notu yok: trend + destek/direnç + momentum ile temel okuma yap.',
|
|
9399
|
-
|
|
9409
|
+
roleDef && f.strategy ? `Sahibinin strateji notu (bu çerçevede analiz et): ${f.strategy}` : '',
|
|
9400
9410
|
'Bu turda: mt5_status → hesap/pozisyon/fiyat verisi → mt5_rates/mt5_indicators ile teknik okuma → değerlendirme → kararlar (veya BEKLE: sebep) → kısa rapor.',
|
|
9401
9411
|
'Önemli kararların gerekçesini mt5_note ile günlüğe yaz (haftalık performans raporu bu notları kullanır).',
|
|
9402
9412
|
'Risk otomasyonu main süreçte 5 sn döngüyle çalışır (+R BE, trailing, kısmi TP) — sen yine de SL/TP seviyelerini aktif yönet.',
|
|
@@ -9678,6 +9688,7 @@ ipcMain.handle('finance:settings', async (_e, patch) => {
|
|
|
9678
9688
|
}
|
|
9679
9689
|
if (p.notifyTrades !== undefined) f.notifyTrades = !!p.notifyTrades;
|
|
9680
9690
|
if (p.notifyWatchdog !== undefined) f.notifyWatchdog = !!p.notifyWatchdog;
|
|
9691
|
+
if (p.notifyTradeOnly !== undefined) f.notifyTradeOnly = !!p.notifyTradeOnly;
|
|
9681
9692
|
if (p.maxDailyLossPct !== undefined) f.maxDailyLossPct = Math.max(0, Math.min(50, Number(p.maxDailyLossPct) || 0));
|
|
9682
9693
|
if (p.dailyLossAction !== undefined) {
|
|
9683
9694
|
const v = String(p.dailyLossAction || 'warn').toLowerCase();
|
package/src/renderer/index.html
CHANGED
|
@@ -186,6 +186,10 @@
|
|
|
186
186
|
<span>Analiz ekibi <i class="fin-hint">— sadece sayı seç, rolleri sistem otomatik atar</i></span>
|
|
187
187
|
<div id="finRoles" class="fin-roles" title="Trader'ın yanında koşacak uzman ajan SAYISI — roller otomatik atanır (Teknik → Risk → Haber); işlem açmazlar"></div>
|
|
188
188
|
</div>
|
|
189
|
+
<div class="fin-field">
|
|
190
|
+
<span>Ajan talimatı <i class="fin-hint">— 1-2 cümle; trader + tüm paralel ajanlara iletilir</i></span>
|
|
191
|
+
<textarea id="finStrategy" rows="2" maxlength="2000" placeholder="örn. Her türde scalp yap — M1/M5 hızlı gir-çık, günlük kâr hedefine ulaşınca dur" title="Buraya yazdığın talimat trade ajanına ve koşan tüm paralel ajanlara (ekip + sembol işçileri) sistem promptunda öncelikli strateji notu olarak gider; kaydetmek için alandan çık"></textarea>
|
|
192
|
+
</div>
|
|
189
193
|
<div class="fin-row fin-btn-row">
|
|
190
194
|
<button id="finTraderBtn" class="fin-start">▶︎ Ajanı Başlat</button>
|
|
191
195
|
</div>
|
|
@@ -222,7 +226,7 @@
|
|
|
222
226
|
</div>
|
|
223
227
|
<div class="fin-field">
|
|
224
228
|
<span>Bildirim kanalı</span>
|
|
225
|
-
<select id="finNotifyTarget" title="
|
|
229
|
+
<select id="finNotifyTarget" title="Emir/işlem bildirimleri bu kanala gider; panel ve masaüstü toast her zaman çalışır">
|
|
226
230
|
<option value="auto">Otomatik (bağlı olan kanallar)</option>
|
|
227
231
|
<option value="telegram">Telegram</option>
|
|
228
232
|
<option value="whatsapp">WhatsApp</option>
|
|
@@ -230,6 +234,11 @@
|
|
|
230
234
|
<option value="off">Kapalı (yalnız panel)</option>
|
|
231
235
|
</select>
|
|
232
236
|
</div>
|
|
237
|
+
<div class="fin-field fin-check">
|
|
238
|
+
<label title="İşaretliyken kanala YALNIZ emir olayları düşer: açılış, kapanış, bekleyen emir, iptal. Fiyat alarmı, BE/trailing/kısmi TP, günlük limit ve rapor bildirimleri gelmez — onlar panelde kalır">
|
|
239
|
+
<input id="finNotifyTradeOnly" type="checkbox" checked /> Kanala sadece emir/işlem olayları gelsin (alarm gelmez)
|
|
240
|
+
</label>
|
|
241
|
+
</div>
|
|
233
242
|
<div id="finAlertList" class="fin-alerts"><div class="fin-empty">Aktif fiyat alarmı yok</div></div>
|
|
234
243
|
</div>
|
|
235
244
|
<div class="fin-card" id="finPerfCard" hidden>
|
package/src/renderer/renderer.js
CHANGED
|
@@ -182,6 +182,7 @@ const els = {
|
|
|
182
182
|
finModelRefreshBtn: $('#finModelRefreshBtn'),
|
|
183
183
|
finInterval: $('#finInterval'),
|
|
184
184
|
finMaxLot: $('#finMaxLot'),
|
|
185
|
+
finStrategy: $('#finStrategy'),
|
|
185
186
|
finSymBtn: $('#finSymBtn'),
|
|
186
187
|
finRoles: $('#finRoles'),
|
|
187
188
|
finWatchClear: $('#finWatchClear'),
|
|
@@ -217,6 +218,7 @@ const els = {
|
|
|
217
218
|
finMinMarginLevel: $('#finMinMarginLevel'),
|
|
218
219
|
finDailyLossAction: $('#finDailyLossAction'),
|
|
219
220
|
finNotifyTarget: $('#finNotifyTarget'),
|
|
221
|
+
finNotifyTradeOnly: $('#finNotifyTradeOnly'),
|
|
220
222
|
finWatchDot: $('#finWatchDot'),
|
|
221
223
|
finWatchInfo: $('#finWatchInfo'),
|
|
222
224
|
finAlertList: $('#finAlertList'),
|
|
@@ -9128,6 +9130,7 @@ let finPollTimer = null;
|
|
|
9128
9130
|
let finModelsFilled = false;
|
|
9129
9131
|
let finLastPrices = new Map(); /* sembol → son bid (renk için) */
|
|
9130
9132
|
let finCfgCache = null; /* son snapshot cfg — rol→skill modalı bundan okur */
|
|
9133
|
+
let finStrategyDirty = false; /* textarea'da kaydedilmeyi bekleyen ajan talimatı var */
|
|
9131
9134
|
const FIN_COLOR_UP = 'fs-up';
|
|
9132
9135
|
const FIN_COLOR_DOWN = 'fs-down';
|
|
9133
9136
|
|
|
@@ -9316,6 +9319,7 @@ function finTraderInputsSet(cfg) {
|
|
|
9316
9319
|
const ae = document.activeElement;
|
|
9317
9320
|
if (els.finInterval && ae !== els.finInterval) els.finInterval.value = cfg.intervalSec || 120;
|
|
9318
9321
|
if (els.finMaxLot && ae !== els.finMaxLot) els.finMaxLot.value = cfg.maxLot || 0.1;
|
|
9322
|
+
if (els.finStrategy && ae !== els.finStrategy && !finStrategyDirty) els.finStrategy.value = cfg.strategy || '';
|
|
9319
9323
|
finSymBtnUpdate();
|
|
9320
9324
|
if (els.finTraderModel && ae !== els.finTraderModel && cfg.traderSel) els.finTraderModel.value = cfg.traderSel;
|
|
9321
9325
|
}
|
|
@@ -9431,6 +9435,7 @@ function finRenderAutomation(cfg, watch) {
|
|
|
9431
9435
|
setNum(els.finMinMarginLevel, cfg.minMarginLevel != null ? cfg.minMarginLevel : 150);
|
|
9432
9436
|
if (els.finDailyLossAction && ae !== els.finDailyLossAction) els.finDailyLossAction.value = cfg.dailyLossAction || 'stop';
|
|
9433
9437
|
if (els.finNotifyTarget && ae !== els.finNotifyTarget) els.finNotifyTarget.value = cfg.notifyTarget || 'auto';
|
|
9438
|
+
if (els.finNotifyTradeOnly && ae !== els.finNotifyTradeOnly) els.finNotifyTradeOnly.checked = cfg.notifyTradeOnly !== false;
|
|
9434
9439
|
if (els.finWatchDot) {
|
|
9435
9440
|
els.finWatchDot.classList.remove('on', 'off', 'busy');
|
|
9436
9441
|
els.finWatchDot.classList.add(watch && watch.on ? 'on' : 'off');
|
|
@@ -9658,12 +9663,33 @@ let finCfgTimer = null;
|
|
|
9658
9663
|
let finWatchDirty = false; /* picker/input değişikliği kaydedilmeyi bekliyor */
|
|
9659
9664
|
function finSaveCfg(patch) {
|
|
9660
9665
|
if (patch && patch.symbols !== undefined) finWatchDirty = true;
|
|
9666
|
+
if (patch && patch.strategy !== undefined) finStrategyDirty = true;
|
|
9661
9667
|
clearTimeout(finCfgTimer);
|
|
9668
|
+
const wasStrategy = !!(patch && patch.strategy !== undefined);
|
|
9662
9669
|
finCfgTimer = setTimeout(() => {
|
|
9663
|
-
beast.financeSettings(patch)
|
|
9670
|
+
beast.financeSettings(patch)
|
|
9671
|
+
.then(() => {
|
|
9672
|
+
if (wasStrategy) {
|
|
9673
|
+
finStrategyDirty = false;
|
|
9674
|
+
if (finCfgCache) finCfgCache.strategy = patch.strategy;
|
|
9675
|
+
}
|
|
9676
|
+
finWatchDirty = false;
|
|
9677
|
+
})
|
|
9678
|
+
.catch(() => { finWatchDirty = false; });
|
|
9664
9679
|
}, 400);
|
|
9665
9680
|
}
|
|
9666
9681
|
|
|
9682
|
+
/* Ajan talimatı: Ajanı Başlat'tan önce bekleyen değişiklik hemen yazılır ki
|
|
9683
|
+
ilk tur brief'i talimatı görsün (debounce beklemeden). */
|
|
9684
|
+
function finStrategyFlush() {
|
|
9685
|
+
if (!els.finStrategy || !finStrategyDirty) return Promise.resolve();
|
|
9686
|
+
const v = els.finStrategy.value;
|
|
9687
|
+
finStrategyDirty = false;
|
|
9688
|
+
return beast.financeSettings({ strategy: v })
|
|
9689
|
+
.then(() => { if (finCfgCache) finCfgCache.strategy = v; })
|
|
9690
|
+
.catch(() => { finStrategyDirty = true; });
|
|
9691
|
+
}
|
|
9692
|
+
|
|
9667
9693
|
/* ---------- GÖRÜNÜM AYARLARI (isteğe bağlı bölümler) ----------
|
|
9668
9694
|
RİSK OTOMASYONU + PERFORMANS + AKIŞ varsayılan GİZLİ; açmak isteğe bağlı.
|
|
9669
9695
|
Seçim localStorage'da hatırlanır. Risk otomasyonu gizliyken watchdog
|
|
@@ -9789,6 +9815,14 @@ if (els.finNotifyTarget) {
|
|
|
9789
9815
|
toast('Bildirim kanalı: ' + els.finNotifyTarget.options[els.finNotifyTarget.selectedIndex].textContent);
|
|
9790
9816
|
});
|
|
9791
9817
|
}
|
|
9818
|
+
if (els.finNotifyTradeOnly) {
|
|
9819
|
+
els.finNotifyTradeOnly.addEventListener('change', () => {
|
|
9820
|
+
finSaveCfg({ notifyTradeOnly: els.finNotifyTradeOnly.checked });
|
|
9821
|
+
toast(els.finNotifyTradeOnly.checked
|
|
9822
|
+
? 'Kanala yalnız emir/işlem olayları gidecek — alarm/koruma bildirimleri panelde kalır'
|
|
9823
|
+
: 'Tüm finance bildirimleri (alarm/koruma dahil) kanala gidecek');
|
|
9824
|
+
});
|
|
9825
|
+
}
|
|
9792
9826
|
if (els.finReportBtn) {
|
|
9793
9827
|
els.finReportBtn.addEventListener('click', async () => {
|
|
9794
9828
|
els.finReportBtn.disabled = true;
|
|
@@ -9809,6 +9843,19 @@ if (els.finTraderModel) {
|
|
|
9809
9843
|
toast('Trade ajanı modeli: ' + (els.finTraderModel.value || 'genel aktif model'));
|
|
9810
9844
|
});
|
|
9811
9845
|
}
|
|
9846
|
+
/* AJAN TALİMATI: trader + ekip + sembol işçileri sistem promptunda
|
|
9847
|
+
"öncelikli strateji notu" olarak okur; yazarken (debounce) kaydedilir */
|
|
9848
|
+
if (els.finStrategy) {
|
|
9849
|
+
els.finStrategy.addEventListener('input', () => {
|
|
9850
|
+
finSaveCfg({ strategy: els.finStrategy.value });
|
|
9851
|
+
});
|
|
9852
|
+
els.finStrategy.addEventListener('change', () => {
|
|
9853
|
+
const v = els.finStrategy.value;
|
|
9854
|
+
if (finCfgCache && String(finCfgCache.strategy || '') === v) return;
|
|
9855
|
+
finSaveCfg({ strategy: v });
|
|
9856
|
+
toast(v.trim() ? 'Ajan talimatı kaydedildi — tüm ajanlar sonraki turda uygular' : 'Ajan talimatı temizlendi');
|
|
9857
|
+
});
|
|
9858
|
+
}
|
|
9812
9859
|
/* TRADE AJANI: modelleri yeniden çek — üstteki ⟳ ile aynı mantık
|
|
9813
9860
|
(models:refresh). Eksik/yeni modeller listeye girer, seçim korunur. */
|
|
9814
9861
|
if (els.finModelRefreshBtn) {
|
|
@@ -9831,6 +9878,7 @@ if (els.finTraderBtn) {
|
|
|
9831
9878
|
if (els.finTraderBtn.classList.contains('stop')) {
|
|
9832
9879
|
await beast.financeTraderStop().catch(() => {});
|
|
9833
9880
|
} else {
|
|
9881
|
+
await finStrategyFlush(); /* yazılan talimat ilk turdan önce kaydedilsin */
|
|
9834
9882
|
const r = await beast.financeTraderStart().catch((e) => ({ ok: false, error: String((e && e.message) || e) }));
|
|
9835
9883
|
if (r && !r.ok) toast(r.error || 'Trader başlatılamadı');
|
|
9836
9884
|
else if (r && r.ok) {
|
package/src/renderer/style.css
CHANGED
|
@@ -4846,7 +4846,7 @@ body.finance-mode #composerWrap { margin-right: var(--finW, 400px); }
|
|
|
4846
4846
|
/* TRADE AJANI formu — etiket üstte, kontrol altta; tur/max lot 2 kolon */
|
|
4847
4847
|
.fin-field { display: flex; flex-direction: column; gap: 3px; min-width: 0; margin-bottom: 8px; }
|
|
4848
4848
|
.fin-field > span { font-size: 10px; color: var(--muted); }
|
|
4849
|
-
.fin-field input, .fin-field select {
|
|
4849
|
+
.fin-field input, .fin-field select, .fin-field textarea {
|
|
4850
4850
|
width: 100%;
|
|
4851
4851
|
min-width: 0;
|
|
4852
4852
|
background: var(--panel2);
|
|
@@ -4856,7 +4856,15 @@ body.finance-mode #composerWrap { margin-right: var(--finW, 400px); }
|
|
|
4856
4856
|
padding: 4px 7px;
|
|
4857
4857
|
border-radius: 6px;
|
|
4858
4858
|
}
|
|
4859
|
-
.fin-field input:focus, .fin-field select:focus { border-color: var(--accent); outline: none; }
|
|
4859
|
+
.fin-field input:focus, .fin-field select:focus, .fin-field textarea:focus { border-color: var(--accent); outline: none; }
|
|
4860
|
+
/* Ajan talimatı: çok satırlı not alanı (dikey büyütülebilir) */
|
|
4861
|
+
.fin-field textarea {
|
|
4862
|
+
resize: vertical;
|
|
4863
|
+
min-height: 46px;
|
|
4864
|
+
max-height: 140px;
|
|
4865
|
+
line-height: 1.35;
|
|
4866
|
+
font-family: inherit;
|
|
4867
|
+
}
|
|
4860
4868
|
.fin-field .fin-sym-select { width: 100%; }
|
|
4861
4869
|
.fin-grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
|
|
4862
4870
|
.fin-grid2 .fin-field { margin-bottom: 8px; }
|