beast-agent 0.18.0 → 0.19.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/README.md CHANGED
@@ -92,6 +92,16 @@ All app data lives under `%APPDATA%\beast` (sessions, memory, WhatsApp pairing,
92
92
 
93
93
  Type `/help` in the chat to see every command.
94
94
 
95
+ ## 🗑️ Uninstall
96
+
97
+ ```bash
98
+ beast-agent uninstall
99
+ ```
100
+
101
+ This removes the app (package, startup registration, desktop shortcut) but **keeps all your personal data** — `config.yaml`, `.env`, sessions, memory, WhatsApp pairing and encrypted backups stay in `%APPDATA%\beast`. Reinstall later with `npm install -g beast-agent` and everything is exactly where you left it.
102
+
103
+ To wipe everything instead, delete the `%APPDATA%\beast` folder after uninstalling.
104
+
95
105
  ## 🔒 Security & Privacy
96
106
 
97
107
  - Everything runs **locally**: sessions, memory and logs stay on your disk
@@ -8,6 +8,45 @@
8
8
  const { spawn, spawnSync } = require('child_process');
9
9
  const path = require('path');
10
10
 
11
+ /* kaldırma modu: uygulamayı kaldırır ama KİŞİSEL VERİLERİ korur
12
+ (%APPDATA%\beast: config.yaml, .env, oturumlar, hafıza, WhatsApp eşlemesi, yedekler) */
13
+ if (process.argv[2] === 'uninstall') {
14
+ const isWin = process.platform === 'win32';
15
+ console.log('Beast Agent kald\u0131r\u0131l\u0131yor\u2026');
16
+ if (isWin) {
17
+ /* çalışan örnekleri kapat */
18
+ try {
19
+ spawnSync('powershell.exe', ['-NoProfile', '-Command',
20
+ "Get-Process electron -ErrorAction SilentlyContinue | Where-Object { $_.Path -like '*node_modules*beast-agent*' } | Stop-Process -Force"],
21
+ { stdio: 'ignore' });
22
+ console.log('\u2022 \u00E7al\u0131\u015Fan Beast kapat\u0131ld\u0131 (varsa)');
23
+ } catch {}
24
+ /* startup kaydını sil — yalnız verisi beast-agent'a işaret ediyorsa */
25
+ try {
26
+ spawnSync('powershell.exe', ['-NoProfile', '-Command',
27
+ "$k='HKCU:\\Software\\Microsoft\\Windows\\CurrentVersion\\Run';" +
28
+ "foreach($n in (Get-Item $k -ErrorAction SilentlyContinue).GetValueNames()){" +
29
+ "$v=(Get-ItemProperty $k).$n; if($v -like '*node_modules*beast-agent*'){ Remove-ItemProperty -Path $k -Name $n; Write-Host '• startup kayd\u0131 silindi' } }"],
30
+ { stdio: 'inherit' });
31
+ } catch {}
32
+ /* masaüstü kısayolunu sil (gerçek Masaüstü yolu: OneDrive olabilir) */
33
+ try {
34
+ spawnSync('powershell.exe', ['-NoProfile', '-Command',
35
+ "$d=[Environment]::GetFolderPath('Desktop'); if(Test-Path \"$d\\Beast Agent.lnk\"){ Remove-Item \"$d\\Beast Agent.lnk\" -Force; Write-Host '\u2022 masa\u00FCst\u00FC k\u0131sayolu silindi' }"],
36
+ { stdio: 'inherit' });
37
+ } catch {}
38
+ } else {
39
+ try { spawnSync('pkill', ['-f', 'node_modules/beast-agent'], { stdio: 'ignore' }); } catch {}
40
+ }
41
+ console.log('\u2022 npm paketi kald\u0131r\u0131l\u0131yor\u2026');
42
+ const ur = spawnSync('npm', ['uninstall', '-g', 'beast-agent'], { stdio: 'inherit', shell: isWin });
43
+ console.log('\n\u2713 Beast Agent kald\u0131r\u0131ld\u0131.');
44
+ console.log('\u2139 Ki\u015Fisel verilerin korundu \u2014 %APPDATA%\\beast');
45
+ console.log(' (config.yaml, .env, oturumlar, haf\u0131za, WhatsApp e\u015Flemesi, \u015Fifreli yedekler)');
46
+ console.log(' Tekrar kurmak i\u00E7in: npm install -g beast-agent');
47
+ process.exit(ur.status || 0);
48
+ }
49
+
11
50
  /* güncelleme modu: çalışan Beast'i kapat (dosya kilidi EBUSY vermesin) → npm güncelle → yeniden başlat */
12
51
  if (process.argv[2] === 'update') {
13
52
  const isWin = process.platform === 'win32';
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "beast-agent",
3
3
  "productName": "Beast Agent",
4
- "version": "0.18.0",
4
+ "version": "0.19.0",
5
5
  "description": "Ultra-fast local agent shell for Windows.",
6
6
  "author": "algokodcom (AlgoKod)",
7
7
  "license": "MIT",
package/src/main.js CHANGED
@@ -3258,7 +3258,7 @@ function npmSelfUpdate() {
3258
3258
 
3259
3259
  ipcMain.handle('update:install', () => {
3260
3260
  if (isNpmMode()) { npmSelfUpdate(); return { ok: true, npm: true }; }
3261
- if (!autoUpdater) return { ok: false, error: 'updater kullanılamıyor' };
3261
+ if (!app.isPackaged) return { ok: false, error: 'Geliştirme modu — güncelleme npm / GitHub Releases üzerinden yapılır' };
3262
3262
  if (!updateState.downloaded) return { ok: false, error: 'indirilmiş sürüm yok — önce /update' };
3263
3263
  try { autoUpdater.quitAndInstall(); return { ok: true }; } catch (e) {
3264
3264
  return { ok: false, error: String((e && e.message) || e) };
@@ -74,6 +74,7 @@
74
74
  up_downloaded: 'İndirildi — kurulum için hazır',
75
75
  up_npm_mode: 'npm kurulumu — güncellemeler otomatik kontrol edilir',
76
76
  up_npm_note: 'Yeni sürüm algılanınca buton aktifleşir: uygulama kapanır, güncellenir ve kendiliğinden yeniden açılır. Terminal komutu: beast-agent update',
77
+ up_dev_note: 'Geliştirme modu — güncelleme buradan yapılmaz; dağıtım npm ve GitHub Releases üzerinden. Kaynak kod için: git pull',
77
78
  up_auto_check: 'Otomatik sürüm kontrolü (açılış + 6 saatte bir)',
78
79
  up_auto_dl: 'Yeni sürümü otomatik indir (kapanışta kurulur)',
79
80
  up_check_now: 'Şimdi Kontrol Et',
@@ -425,6 +426,7 @@
425
426
  up_downloaded: 'Downloaded — ready to install',
426
427
  up_npm_mode: 'npm install — updates are checked automatically',
427
428
  up_npm_note: 'The button activates when a new version is detected: the app closes, updates and relaunches by itself. Terminal command: beast-agent update',
429
+ up_dev_note: 'Development mode — updates are distributed via npm and GitHub Releases. For source code: git pull',
428
430
  up_auto_check: 'Automatic version check (on startup + every 6 hours)',
429
431
  up_auto_dl: 'Auto-download new versions (installed on quit)',
430
432
  up_check_now: 'Check Now',
@@ -527,7 +527,7 @@ function switchTab(name) {
527
527
  if (name === 'dash') renderDashboardPane();
528
528
  if (name === 'limits') renderLimitsPane();
529
529
  if (name === 'sec') renderSecurityPane();
530
- if (name === 'update') renderUpdatePane();
530
+ if (name === 'update') renderUpdatePane(true);
531
531
  if (name === 'agents') refreshAgentsPane();
532
532
  if (name === 'websearch') renderWebSearchPane();
533
533
  /* Fallout: her açılışta güncel provider zincirini çek */
@@ -1562,13 +1562,34 @@ function renderUpdateStateHtml(st) {
1562
1562
  return `<div class="usage-stat" id="upStatusBox"><div class="us-label">${_t('up_status')}</div><div class="us-value" style="font-size:14px">${escapeHtml(status)}</div></div>`;
1563
1563
  }
1564
1564
 
1565
- async function renderUpdatePane() {
1565
+ async function renderUpdatePane(autoCheck) {
1566
1566
  const pane = $('#tab-update');
1567
1567
  if (!pane) return;
1568
1568
  const st = await beast.updateStatus().catch(() => null);
1569
1569
  if (!st) return;
1570
1570
  clearInterval(updatePaneTimer);
1571
1571
 
1572
+ /* mod bazlı butonlar: npm → available, installer → downloaded, dev → sadece kontrol */
1573
+ const isDev = !st.packaged && !st.npm;
1574
+ let actions;
1575
+ if (st.npm) {
1576
+ actions = `<div class="form-grid" style="grid-template-columns:auto auto;gap:8px;margin-top:12px">
1577
+ <button id="upInstall" class="btn ghost" ${st.available ? '' : 'disabled style="opacity:.45;cursor:default"'}>${_t('up_install_now')}</button>
1578
+ </div>
1579
+ <div class="sub" style="margin-top:8px">${_t('up_npm_note')}</div>`;
1580
+ } else if (isDev) {
1581
+ actions = `<div class="form-grid" style="grid-template-columns:auto auto;gap:8px;margin-top:12px">
1582
+ <button id="upCheck" class="btn ghost">${_t('up_check_now')}</button>
1583
+ </div>
1584
+ <div class="sub" style="margin-top:8px">${_t('up_dev_note')}</div>`;
1585
+ } else {
1586
+ actions = `<div class="form-grid" style="grid-template-columns:auto auto;gap:8px;margin-top:12px">
1587
+ <button id="upCheck" class="btn ghost">${_t('up_check_now')}</button>
1588
+ <button id="upInstall" class="btn ghost" ${st.downloaded ? '' : 'disabled style="opacity:.45;cursor:default"'}>${_t('up_install_now')}</button>
1589
+ </div>
1590
+ <div class="sub" style="margin-top:8px">${_t('up_note')}</div>`;
1591
+ }
1592
+
1572
1593
  pane.innerHTML =
1573
1594
  '<h2>' + _t('up_h2') + '</h2>' +
1574
1595
  '<div class="sub">' + _t('up_sub') + '</div>' +
@@ -1581,16 +1602,7 @@ async function renderUpdatePane() {
1581
1602
  <label class="lock-row"><input type="checkbox" id="upAutoCheck" ${st.autoCheck ? 'checked' : ''}/><span>${_t('up_auto_check')}</span></label>
1582
1603
  <label class="lock-row"><input type="checkbox" id="upAutoDl" ${st.autoDownload ? 'checked' : ''}/><span>${_t('up_auto_dl')}</span></label>
1583
1604
  </div>` +
1584
- (st.npm
1585
- ? `<div class="form-grid" style="grid-template-columns:auto auto;gap:8px;margin-top:12px">
1586
- <button id="upInstall" class="btn ghost" ${st.available ? '' : 'disabled style="opacity:.45;cursor:default"'}>${_t('up_install_now')}</button>
1587
- </div>
1588
- <div class="sub" style="margin-top:8px">${_t('up_npm_note')}</div>`
1589
- : `<div class="form-grid" style="grid-template-columns:auto auto;gap:8px;margin-top:12px">
1590
- <button id="upCheck" class="btn ghost">${_t('up_check_now')}</button>
1591
- <button id="upInstall" class="btn ghost" ${st.downloaded ? '' : 'disabled style="opacity:.45;cursor:default"'}>${_t('up_install_now')}</button>
1592
- </div>
1593
- <div class="sub" style="margin-top:8px">${_t('up_note')}</div>`);
1605
+ actions;
1594
1606
 
1595
1607
  const chk = pane.querySelector('#upAutoCheck');
1596
1608
  if (chk) chk.addEventListener('change', async (e) => { await beast.updateSetAuto({ autoCheck: e.target.checked }); });
@@ -1620,6 +1632,9 @@ async function renderUpdatePane() {
1620
1632
  if (box) box.outerHTML = renderUpdateStateHtml(s);
1621
1633
  }).catch(() => {});
1622
1634
  }, 1000);
1635
+
1636
+ /* sekme açılırken otomatik sürüm kontrolü */
1637
+ if (autoCheck) beast.updateCheck().catch(() => {});
1623
1638
  }
1624
1639
 
1625
1640
  /* Sohbete onay kartı düşürür — Onayla / Her zaman / Reddet */function showApprovalCard(ev) {