beast-agent 0.25.9 → 0.25.10
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/renderer/renderer.js +9 -14
package/package.json
CHANGED
package/src/renderer/renderer.js
CHANGED
|
@@ -472,20 +472,17 @@ async function renderSessions(list) {
|
|
|
472
472
|
} catch {}
|
|
473
473
|
els.sessList.innerHTML = '';
|
|
474
474
|
/* aktif botun oturumları — botlar arası geçişte liste de o bota göre değişir.
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
oturum KALICI olarak o bota bağlanır (agent:send auto-bind; notlar dahil).
|
|
478
|
-
Başka bir bota AÇIKÇA bağlı olanlar yalnız o botun listesinde. */
|
|
475
|
+
KATI KURAL: her oturum yalnız BAĞLI OLDUĞU botun listesinde görünür;
|
|
476
|
+
bot kaydı olmayan (eski) oturumlar Beast (varsayılan sahip) altında görünür. */
|
|
479
477
|
for (const s of list) {
|
|
480
|
-
if (s.botId
|
|
481
|
-
const unbound = !s.botId && activeBotId !== 'beast';
|
|
478
|
+
if ((s.botId || 'beast') !== activeBotId) continue;
|
|
482
479
|
const row = document.createElement('div');
|
|
483
480
|
row.className = 'sess' + (s.id === activeId ? ' active' : '');
|
|
484
481
|
row.innerHTML =
|
|
485
482
|
(waSet.has(s.id) ? '<span class="sess-wa" title="WhatsApp">W</span>' : '') +
|
|
486
483
|
(tgSet.has(s.id) ? '<span class="sess-tg" title="Telegram">T</span>' : '') +
|
|
487
484
|
`<span class="sess-title">${escapeHtml(s.title || 'Yeni Sohbet')}</span>` +
|
|
488
|
-
`<span class="sess-code" title="
|
|
485
|
+
`<span class="sess-code" title="Oturum kodu">${escapeHtml(s.code || '')}</span>` +
|
|
489
486
|
`<button class="sess-del" title="Sil">×</button>`;
|
|
490
487
|
row.addEventListener('click', () => openSession(s.id));
|
|
491
488
|
row.querySelector('.sess-del').addEventListener('click', async (e) => {
|
|
@@ -2784,10 +2781,9 @@ async function switchBot(id) {
|
|
|
2784
2781
|
}
|
|
2785
2782
|
} catch {}
|
|
2786
2783
|
try { localStorage.setItem('beast.activeBot', id); } catch {}
|
|
2787
|
-
/* o botun en son oturumuna geç; hiç yoksa o bot için yeni sohbet
|
|
2788
|
-
(bot kaydı olmayan eski oturumlar da sayılır — ilk mesajda bağlanır) */
|
|
2784
|
+
/* o botun en son oturumuna geç; hiç yoksa o bot için yeni sohbet aç */
|
|
2789
2785
|
try {
|
|
2790
|
-
const list = (await beast.listSessions()).filter((s) =>
|
|
2786
|
+
const list = (await beast.listSessions()).filter((s) => (s.botId || 'beast') === id);
|
|
2791
2787
|
if (list.length) await openSession(list[0].id);
|
|
2792
2788
|
else { const v = await beast.createSession(); await openSession(v.id); }
|
|
2793
2789
|
} catch {}
|
|
@@ -2894,7 +2890,7 @@ async function renderBotNotes(pane, b) {
|
|
|
2894
2890
|
pane.innerHTML = `<h2>${_t('notes_h2')}</h2><div class="sub">${_t('notes_sub')}</div>`;
|
|
2895
2891
|
let all = [];
|
|
2896
2892
|
try { all = await beast.listNotes(); } catch {}
|
|
2897
|
-
const list = (b.admin ? all : all.filter((n) =>
|
|
2893
|
+
const list = (b.admin ? all : all.filter((n) => (n.botId || 'beast') === b.id))
|
|
2898
2894
|
.slice()
|
|
2899
2895
|
.sort((x, y) => String(y.updatedAt).localeCompare(String(x.updatedAt)));
|
|
2900
2896
|
if (!list.length) {
|
|
@@ -2955,8 +2951,7 @@ async function renderBotChats(b) {
|
|
|
2955
2951
|
const sessions = [];
|
|
2956
2952
|
try {
|
|
2957
2953
|
for (const s of await beast.listSessions()) {
|
|
2958
|
-
|
|
2959
|
-
if (!s.botId || s.botId === b.id) sessions.push(s);
|
|
2954
|
+
if ((s.botId || 'beast') === b.id) sessions.push(s);
|
|
2960
2955
|
}
|
|
2961
2956
|
} catch {}
|
|
2962
2957
|
sessions.sort((x, y) => String(y.updatedAt).localeCompare(String(x.updatedAt)));
|
|
@@ -3192,7 +3187,7 @@ async function renderBotWatcher(pane, b) {
|
|
|
3192
3187
|
try { items = (await beast.watchersList()) || []; } catch {}
|
|
3193
3188
|
let botSessions = new Set();
|
|
3194
3189
|
try {
|
|
3195
|
-
for (const s of await beast.listSessions()) if (
|
|
3190
|
+
for (const s of await beast.listSessions()) if ((s.botId || 'beast') === b.id) botSessions.add(s.id);
|
|
3196
3191
|
} catch {}
|
|
3197
3192
|
const mine = items.filter((w) => botSessions.has(w.sessionId));
|
|
3198
3193
|
if (!mine.length) {
|