beast-agent 2.23.0 → 2.23.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "beast-agent",
3
3
  "productName": "Beast Agent",
4
- "version": "2.23.0",
4
+ "version": "2.23.2",
5
5
  "description": "Ultra-fast local agent shell for Windows.",
6
6
  "author": "algokodcom (AlgoKod)",
7
7
  "license": "MIT",
@@ -2718,7 +2718,13 @@ class Engine {
2718
2718
  }
2719
2719
  this.emit({ type: 'message', sessionId: s.id, message: msg });
2720
2720
  this.emit({ type: 'sessions' });
2721
- this._run(s).catch(() => {});
2721
+ /* sessiz catch YOK: tur kurulumu patlarsa hata UI'ya düşsün —
2722
+ "ajan cvp vermiyor, hata görünmüyor" bu yüzdendi */
2723
+ this._run(s).catch((e) => {
2724
+ try {
2725
+ this.emit({ type: 'error', sessionId: s.id, error: String((e && e.message) || e) });
2726
+ } catch {}
2727
+ });
2722
2728
  return true;
2723
2729
  }
2724
2730
 
@@ -3074,6 +3080,19 @@ class Engine {
3074
3080
 
3075
3081
  /* #17 iş kayıtlarını diske yaz — uygulama kapansa da geçmiş dursun.
3076
3082
  Oturum dosyası silinmiş işler (elle silinmiş) geri yazılmaz. */
3083
+ /* ATOMİK YAZIM: önce .tmp sonra rename — iki instance çakışsın ya da
3084
+ proses yazım ortasında ölse bile dosya ASLA 0 bayt bozulmaz
3085
+ (bg-jobs.json 0 bayt olunca tüm ajanlar kayboluyordu) */
3086
+ _atomicWrite(file, data) {
3087
+ try {
3088
+ const tmp = file + '.tmp';
3089
+ fs.writeFileSync(tmp, data);
3090
+ fs.renameSync(tmp, file);
3091
+ } catch {
3092
+ try { fs.writeFileSync(file, data); } catch {}
3093
+ }
3094
+ }
3095
+
3077
3096
  _saveBgJobs() {
3078
3097
  try {
3079
3098
  const jobs = [];
@@ -3083,7 +3102,7 @@ class Engine {
3083
3102
  delete c._persisted;
3084
3103
  jobs.push(c);
3085
3104
  }
3086
- fs.writeFileSync(this._bgJobsFile, JSON.stringify({ v: 1, jobs }) + '\n');
3105
+ this._atomicWrite(this._bgJobsFile, JSON.stringify({ v: 1, jobs }) + '\n');
3087
3106
  } catch {}
3088
3107
  }
3089
3108
 
@@ -6229,7 +6248,11 @@ Engine.prototype._agentDmSend = function (fromSid, args) {
6229
6248
  if (sid === String(fromSid)) continue;
6230
6249
  if (!s || s.bgJob || s.isBotDm) continue;
6231
6250
  if (s.botId && s.botId !== 'beast') continue;
6232
- const hay = [s.bgTitle, s.title, s.code].map((x) => String(x || '').toLowerCase());
6251
+ /* tam başlık da eşleşir: ajan DM'den gelen "Beast · KOD" başlığıyla
6252
+ cevap verir — fromTitle formatı birebir tanınmalı */
6253
+ const hay = [s.bgTitle, s.title, s.code, s.code ? 'beast · ' + s.code : ''].map((x) =>
6254
+ String(x || '').toLowerCase()
6255
+ );
6233
6256
  if (hay.some((x) => x && x.includes(q))) {
6234
6257
  target = sid;
6235
6258
  break;
@@ -6356,7 +6379,7 @@ Engine.prototype._persistAgentDms = function () {
6356
6379
  try {
6357
6380
  const groups = {};
6358
6381
  for (const [, g] of this._agentGroups || new Map()) groups[g.id] = g;
6359
- fs.writeFileSync(this._agentDmsFile, JSON.stringify({ dms: this._agentDms, groups }, null, 2));
6382
+ this._atomicWrite(this._agentDmsFile, JSON.stringify({ dms: this._agentDms, groups }, null, 2));
6360
6383
  } catch {}
6361
6384
  };
6362
6385
 
@@ -2088,7 +2088,9 @@ body.browser-open #settingsDialog { width: min(70vw, calc(100vw - var(--bw, 480p
2088
2088
  #dmRail.dm-hidden { display: none; }
2089
2089
 
2090
2090
  #dmRailHead {
2091
- padding: 12px 12px 10px 16px;
2091
+ /* railHead ile BİREBİR AYNI: sağ 148px = pencere butonları (min/kapat)
2092
+ alanı — çöp ikonu asla pencere butonlarının altına girmez */
2093
+ padding: 12px 148px 10px 16px;
2092
2094
  font-weight: 800;
2093
2095
  letter-spacing: 1px;
2094
2096
  font-size: 13px;
@@ -2097,8 +2099,6 @@ body.browser-open #settingsDialog { width: min(70vw, calc(100vw - var(--bw, 480p
2097
2099
  align-items: center;
2098
2100
  gap: 8px;
2099
2101
  }
2100
- /* rail gizliyken DM sütunu sağ kenara yaslanır — pencere butonları alanı */
2101
- body.rail-hidden #dmRailHead { padding-right: 148px; }
2102
2102
  #dmRailTitle { flex: 1; text-align: left; }
2103
2103
  #dmClear {
2104
2104
  flex: none;