beast-agent 1.5.0 → 1.5.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 +1 -1
- package/src/main.js +31 -14
- package/src/renderer/renderer.js +1 -1
- package/src/renderer/style.css +3 -0
package/package.json
CHANGED
package/src/main.js
CHANGED
|
@@ -2747,8 +2747,7 @@ function falloutResume() {
|
|
|
2747
2747
|
if (!f.enabled || f.autoResume === false) return;
|
|
2748
2748
|
const st = JSON.parse(fs.readFileSync(FALLOUT_CRASH_FILE, 'utf8'));
|
|
2749
2749
|
if (!st || !st.sessionId) return;
|
|
2750
|
-
const
|
|
2751
|
-
const sid = exists ? st.sessionId : engine.createSession().id;
|
|
2750
|
+
const sid = reuseOrLatestSession(st.sessionId);
|
|
2752
2751
|
const when = st.at ? new Date(st.at).toLocaleString('tr-TR') : '?';
|
|
2753
2752
|
setTimeout(() => {
|
|
2754
2753
|
try {
|
|
@@ -2795,7 +2794,8 @@ function whereWasISummary() {
|
|
|
2795
2794
|
function maybeRunWhereWasI() {
|
|
2796
2795
|
try {
|
|
2797
2796
|
const cfg = settings.whereWasI || {};
|
|
2798
|
-
|
|
2797
|
+
/* DEFAULT KAPALI: yalnız Ayarlar → Maliyet · Limit'ten açıldıysa göster */
|
|
2798
|
+
if (cfg.enabled !== true) return;
|
|
2799
2799
|
const sum = whereWasISummary();
|
|
2800
2800
|
if (!sum) return;
|
|
2801
2801
|
settingsLog(`nerede-kaldım: ${String(sum.text).split('\n')[0]}`);
|
|
@@ -4922,8 +4922,12 @@ ipcMain.handle('setup:skip', () => {
|
|
|
4922
4922
|
return { ok: true };
|
|
4923
4923
|
});
|
|
4924
4924
|
|
|
4925
|
-
/* #5 "nerede kaldım" */
|
|
4926
|
-
ipcMain.handle('wherewasi:get', () =>
|
|
4925
|
+
/* #5 "nerede kaldım": get → gerçek ayar durumu (checkbox doğru görünsün) */
|
|
4926
|
+
ipcMain.handle('wherewasi:get', () => {
|
|
4927
|
+
const cfg = settings.whereWasI || {};
|
|
4928
|
+
const sum = whereWasISummary();
|
|
4929
|
+
return { enabled: cfg.enabled === true, ...(sum || {}) };
|
|
4930
|
+
});
|
|
4927
4931
|
ipcMain.handle('wherewasi:set', (_e, cfg) => {
|
|
4928
4932
|
settings.whereWasI = { enabled: !!(cfg && cfg.enabled) };
|
|
4929
4933
|
saveSettings();
|
|
@@ -5208,6 +5212,24 @@ function cronEmit() {
|
|
|
5208
5212
|
hangi kanaldan ajanla iletişimde belli değil). */
|
|
5209
5213
|
const cronAnswerPending = new Map();
|
|
5210
5214
|
|
|
5215
|
+
/* OTOMATİK YENİ SOHBET YOK: cron/izleyici/fallout tetiklendiğinde oturum
|
|
5216
|
+
seçimi — kayıtlı id geçerliyse O, değilse EN GÜNCEL oturum kullanılır.
|
|
5217
|
+
Hiç oturum yoksa (ilk kurulum) yeni açılır. Böylece soldaki sohbet
|
|
5218
|
+
geçmişine "+ Yeni Sohbet" olmadan hayalet sohbetler düşmez. */
|
|
5219
|
+
function reuseOrLatestSession(preferredId) {
|
|
5220
|
+
const sid = String(preferredId || '');
|
|
5221
|
+
if (sid) {
|
|
5222
|
+
try {
|
|
5223
|
+
if (engine._load(sid)) return sid;
|
|
5224
|
+
} catch {}
|
|
5225
|
+
}
|
|
5226
|
+
try {
|
|
5227
|
+
const list = engine.listSessions(); // updatedAt'e göre yeni→eski sıralı
|
|
5228
|
+
if (list.length) return String(list[0].id);
|
|
5229
|
+
} catch {}
|
|
5230
|
+
return engine.createSession().id;
|
|
5231
|
+
}
|
|
5232
|
+
|
|
5211
5233
|
/* Yansıtma hedefleri: bağlı WA (owner numarası), Telegram ve Discord
|
|
5212
5234
|
(owner işaretli kayıt; tek kayıt varsa o). Cron oturumunun KENDİ
|
|
5213
5235
|
kanalına yansıtmayız — cevabı zaten kendi akışından alır (çift yok). */
|
|
@@ -5256,11 +5278,8 @@ function cronMirrorTargets(cronSid) {
|
|
|
5256
5278
|
|
|
5257
5279
|
function cronFire(job) {
|
|
5258
5280
|
try {
|
|
5259
|
-
|
|
5260
|
-
|
|
5261
|
-
if (!exists) {
|
|
5262
|
-
const s = engine.createSession();
|
|
5263
|
-
sid = s.id;
|
|
5281
|
+
const sid = reuseOrLatestSession(job.sessionId);
|
|
5282
|
+
if (sid !== String(job.sessionId || '')) {
|
|
5264
5283
|
cron.update(job.id, { sessionId: sid });
|
|
5265
5284
|
}
|
|
5266
5285
|
cronAnswerPending.set(String(sid), job);
|
|
@@ -5276,10 +5295,8 @@ function cronFire(job) {
|
|
|
5276
5295
|
function watcherFire(w, value) {
|
|
5277
5296
|
try {
|
|
5278
5297
|
watcherLog(`tetiklendi id=${w.id} name="${w.name}" kind=${w.kind} op=${w.op} value=${value}`);
|
|
5279
|
-
|
|
5280
|
-
|
|
5281
|
-
if (!exists) {
|
|
5282
|
-
sid = engine.createSession().id;
|
|
5298
|
+
const sid = reuseOrLatestSession(w.sessionId);
|
|
5299
|
+
if (sid !== String(w.sessionId || '')) {
|
|
5283
5300
|
watchers.patch(w.id, { sessionId: sid });
|
|
5284
5301
|
}
|
|
5285
5302
|
const target =
|
package/src/renderer/renderer.js
CHANGED
|
@@ -1059,7 +1059,7 @@ async function renderUsagePane() {
|
|
|
1059
1059
|
} catch {
|
|
1060
1060
|
rep = { today: { total: {}, models: [] }, month: { total: {}, models: [] } };
|
|
1061
1061
|
}
|
|
1062
|
-
const wwi = await beast.whereWasIGet().catch(() => ({ enabled:
|
|
1062
|
+
const wwi = await beast.whereWasIGet().catch(() => ({ enabled: false }));
|
|
1063
1063
|
const t = rep.today.total || {};
|
|
1064
1064
|
const mo = rep.month.total || {};
|
|
1065
1065
|
const card = (label, v) =>
|
package/src/renderer/style.css
CHANGED
|
@@ -1495,6 +1495,9 @@ body.browser-open #settingsDialog { width: min(70vw, calc(100vw - var(--bw, 480p
|
|
|
1495
1495
|
margin-bottom: 8px;
|
|
1496
1496
|
cursor: pointer;
|
|
1497
1497
|
background: var(--panel);
|
|
1498
|
+
/* button elementleri body'den renk miras almaz — dark modda siyah kalmasın */
|
|
1499
|
+
color: var(--text);
|
|
1500
|
+
font-family: inherit;
|
|
1498
1501
|
}
|
|
1499
1502
|
.prov-row:hover { border-color: var(--accent); }
|
|
1500
1503
|
/* dil kartları: aktif seçim vurgusu */
|