beast-agent 0.24.1 → 0.24.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/bin/beast-agent.js +30 -38
- package/package.json +1 -1
- package/src/main.js +32 -13
- package/src/renderer/i18n.js +2 -2
- package/src/renderer/renderer.js +3 -2
package/bin/beast-agent.js
CHANGED
|
@@ -49,11 +49,12 @@ if (process.argv[2] === 'uninstall') {
|
|
|
49
49
|
process.exit(ur.status || 0);
|
|
50
50
|
}
|
|
51
51
|
|
|
52
|
-
/* güncelleme modu: çalışan Beast'i kapat (dosya kilidi EBUSY vermesin) → npm güncelle → yeniden başlat.
|
|
53
|
-
|
|
52
|
+
/* güncelleme modu: çalışan Beast'i kapat (dosya kilidi EBUSY vermesin) → npm güncelle (görünür ilerleme) → yeniden başlat.
|
|
53
|
+
Bu komut güncelleme butonu tarafından GÖRÜNÜR bir cmd penceresi içinde çalıştırılır;
|
|
54
|
+
doğrudan terminalden de çalışır — npm install çıktısı ekranda akar. */
|
|
54
55
|
if (process.argv[2] === 'update') {
|
|
55
56
|
const isWin = process.platform === 'win32';
|
|
56
|
-
console.log('\u27F3 beast-agent g\u00FCncelleniyor\u2026
|
|
57
|
+
console.log('\u27F3 beast-agent g\u00FCncelleniyor\u2026');
|
|
57
58
|
if (isWin) {
|
|
58
59
|
try {
|
|
59
60
|
spawnSync('powershell.exe', ['-NoProfile', '-Command',
|
|
@@ -61,42 +62,33 @@ if (process.argv[2] === 'update') {
|
|
|
61
62
|
{ stdio: 'ignore' });
|
|
62
63
|
console.log('\u2022 \u00E7al\u0131\u015Fan Beast kapat\u0131ld\u0131 (varsa)');
|
|
63
64
|
} catch {}
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
"Start-Process -FilePath $exe -ArgumentList ('\"' + $appDir + '\"')",
|
|
83
|
-
"L '=== beast update bitti ==='",
|
|
84
|
-
].join('\r\n');
|
|
85
|
-
const os = require('os');
|
|
86
|
-
const psFile = path.join(os.tmpdir(), 'beast-update-helper.ps1');
|
|
87
|
-
fs.writeFileSync(psFile, ps, 'utf8');
|
|
88
|
-
spawn('powershell.exe', ['-NoProfile', '-ExecutionPolicy', 'Bypass', '-File', psFile],
|
|
89
|
-
{ detached: true, stdio: 'ignore', windowsHide: true }).unref();
|
|
90
|
-
console.log('\u2022 npm install arka planda s\u00FCr\u00FCyor (2-4 dk) \u2014 bitince uygulama kendili\u011Finden a\u00E7\u0131l\u0131r');
|
|
91
|
-
console.log(' durum: %APPDATA%\\beast\\update.log');
|
|
92
|
-
process.exit(0);
|
|
65
|
+
} else {
|
|
66
|
+
try { spawnSync('pkill', ['-f', 'node_modules/beast-agent'], { stdio: 'ignore' }); } catch {}
|
|
67
|
+
}
|
|
68
|
+
/* dosya kilidi (EBUSY) bazen ilk denemede patlar — 5 deneme hakkı */
|
|
69
|
+
let ok = false;
|
|
70
|
+
for (let i = 1; i <= 5 && !ok; i++) {
|
|
71
|
+
const r = spawnSync('npm', ['install', '-g', 'beast-agent@latest'], { stdio: 'inherit', shell: isWin });
|
|
72
|
+
ok = r.status === 0;
|
|
73
|
+
if (!ok && i < 5) {
|
|
74
|
+
console.log(` \u2022 deneme ${i}/5 ba\u015Far\u0131s\u0131z (dosya kilidi olabilir) \u2014 3 sn sonra tekrar\u2026`);
|
|
75
|
+
if (isWin) spawnSync('powershell.exe', ['-NoProfile', '-Command', 'Start-Sleep -Seconds 3'], { stdio: 'ignore' });
|
|
76
|
+
else spawnSync('sleep', ['3']);
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
if (!ok) {
|
|
80
|
+
console.log('\n\u2717 g\u00FCncelleme ba\u015Far\u0131s\u0131z \u2014 elle: npm install -g beast-agent@latest');
|
|
81
|
+
if (isWin) spawnSync('cmd.exe', ['/c', 'pause'], { stdio: 'inherit', shell: false });
|
|
82
|
+
process.exit(1);
|
|
93
83
|
}
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
84
|
+
console.log('\n\u2713 beast-agent g\u00FCncellendi \u2014 uygulama ba\u015Flat\u0131l\u0131yor\u2026');
|
|
85
|
+
try {
|
|
86
|
+
const electron = require('electron');
|
|
87
|
+
if (typeof electron === 'string') {
|
|
88
|
+
spawn(electron, [path.resolve(__dirname, '..')], { stdio: 'ignore', detached: true }).unref();
|
|
89
|
+
}
|
|
90
|
+
} catch {}
|
|
91
|
+
if (isWin) spawnSync('cmd.exe', ['/c', 'timeout /t 3'], { stdio: 'ignore' });
|
|
100
92
|
process.exit(0);
|
|
101
93
|
}
|
|
102
94
|
|
package/package.json
CHANGED
package/src/main.js
CHANGED
|
@@ -1015,9 +1015,10 @@ async function tryWaSlash(jid, rawText, senderNum) {
|
|
|
1015
1015
|
? `*${cmd === 'deny' ? 'Reddedildi' : 'Onaylandı'}:* ${r.tool}${always ? ' — bu araç için bir daha sorulmayacak' : ''}`
|
|
1016
1016
|
: 'Bekleyen onay yok.';
|
|
1017
1017
|
} else if (cmd === 'update') {
|
|
1018
|
-
/* /update — sürüm kontrol
|
|
1018
|
+
/* /update — sürüm kontrol; /update now — görünür cmd'de beast update */
|
|
1019
1019
|
if (String(arg || '').toLowerCase() === 'now') {
|
|
1020
|
-
|
|
1020
|
+
updateReplies.jids.add(jid);
|
|
1021
|
+
npmUpdateNow(async (text) => { out = text; });
|
|
1021
1022
|
} else {
|
|
1022
1023
|
updateReplies.jids.add(jid);
|
|
1023
1024
|
await runUpdateCommand(async (text) => { out = text; });
|
|
@@ -3325,7 +3326,7 @@ ipcMain.handle('agent:send', (_e, { sessionId, text }) => {
|
|
|
3325
3326
|
const a = t.slice(7).trim().toLowerCase();
|
|
3326
3327
|
updateReplies.sids.add(String(sessionId || ''));
|
|
3327
3328
|
if (a === 'now') {
|
|
3328
|
-
desktopEcho(sessionId, t,
|
|
3329
|
+
npmUpdateNow((text) => desktopEcho(sessionId, t, text));
|
|
3329
3330
|
} else {
|
|
3330
3331
|
runUpdateCommand((text) => desktopEcho(sessionId, t, text));
|
|
3331
3332
|
}
|
|
@@ -4075,10 +4076,12 @@ ipcMain.handle('update:check', async () => {
|
|
|
4075
4076
|
/* TEK DAĞITIM POLİTİKASI: uygulama içi self-update KALDIRILDI (v0.24.0).
|
|
4076
4077
|
Güncelleme yalnız: uygulamayı kapat → "npm i -g beast-agent@latest" → tekrar aç. */
|
|
4077
4078
|
|
|
4078
|
-
ipcMain.handle('update:install', () =>
|
|
4079
|
-
|
|
4080
|
-
error: NPM_ONLY_TEXT
|
|
4081
|
-
|
|
4079
|
+
ipcMain.handle('update:install', () => {
|
|
4080
|
+
/* TEK DAĞITIM npm: buton → görünür cmd'de "beast update" → kapan → kur → aç */
|
|
4081
|
+
if (!isNpmMode()) return { ok: false, error: NPM_ONLY_TEXT };
|
|
4082
|
+
npmUpdateViaCmd();
|
|
4083
|
+
return { ok: true, npm: true };
|
|
4084
|
+
});
|
|
4082
4085
|
|
|
4083
4086
|
ipcMain.handle('update:setAuto', (_e, cfg) => {
|
|
4084
4087
|
if (cfg && typeof cfg.autoCheck === 'boolean') settings.autoCheckUpdate = cfg.autoCheck;
|
|
@@ -4092,11 +4095,26 @@ ipcMain.handle('update:setAuto', (_e, cfg) => {
|
|
|
4092
4095
|
|
|
4093
4096
|
/* /update komutu (masaüstü + WA): hedefi kaydet, kontrol başlat */
|
|
4094
4097
|
/* npm modunda güncelle-şimdi: sürüm kontrolü + numaralarıyla bildir + kendi kendini güncelle */
|
|
4095
|
-
/* TEK DAĞITIM POLİTİKASI: exe/installer YOK
|
|
4096
|
-
Güncelleme
|
|
4098
|
+
/* TEK DAĞITIM POLİTİKASI: exe/installer YOK.
|
|
4099
|
+
Güncelleme akışı: buton → görünür CMD penceresi açılır → "beast update"
|
|
4100
|
+
(npm install çıktısı ekranda akar) → uygulama kapanır → kurulum bitince
|
|
4101
|
+
uygulama kendiliğinden yeniden açılır. */
|
|
4097
4102
|
const NPM_ONLY_TEXT =
|
|
4098
|
-
'Tek dağıtım npm\u2019dir
|
|
4099
|
-
|
|
4103
|
+
'Tek dağıtım npm\u2019dir. Güncellemek için:\n1) Uygulamayı kapat\n2) Terminalde: npm i -g beast-agent@latest\n3) Tekrar aç';
|
|
4104
|
+
|
|
4105
|
+
/* buton akışı: görünür cmd + "beast update" + uygulama kapanışı */
|
|
4106
|
+
function npmUpdateViaCmd() {
|
|
4107
|
+
try {
|
|
4108
|
+
const shim = path.join(process.env.APPDATA || '', 'npm', 'beast-agent.cmd');
|
|
4109
|
+
const cmdLine = fs.existsSync(shim) ? `"${shim}" update` : 'beast update';
|
|
4110
|
+
spawn(
|
|
4111
|
+
'cmd.exe',
|
|
4112
|
+
['/c', 'start', 'Beast Guncelleme', 'cmd', '/k', cmdLine],
|
|
4113
|
+
{ detached: true, stdio: 'ignore', windowsHide: false }
|
|
4114
|
+
).unref();
|
|
4115
|
+
} catch {}
|
|
4116
|
+
setTimeout(() => { try { app.quit(); } catch {} }, 600);
|
|
4117
|
+
}
|
|
4100
4118
|
|
|
4101
4119
|
function npmUpdateNow(reply /* fn(text) */) {
|
|
4102
4120
|
const current = app.getVersion();
|
|
@@ -4104,7 +4122,8 @@ function npmUpdateNow(reply /* fn(text) */) {
|
|
|
4104
4122
|
if (v && isNewerVersion(v, current)) {
|
|
4105
4123
|
updateState.available = true;
|
|
4106
4124
|
updateState.version = v;
|
|
4107
|
-
reply(`🔄 *Yeni sürüm var*\nMevcut: v${current}\nYeni: v${v}\
|
|
4125
|
+
reply(`🔄 *Yeni sürüm var*\nMevcut: v${current}\nYeni: v${v}\nGüncelleme başlatıldı — cmd penceresinden takip et.`);
|
|
4126
|
+
npmUpdateViaCmd();
|
|
4108
4127
|
} else {
|
|
4109
4128
|
reply(`✅ *Güncelsin* — v${current} zaten en son sürüm.`);
|
|
4110
4129
|
}
|
|
@@ -4112,7 +4131,7 @@ function npmUpdateNow(reply /* fn(text) */) {
|
|
|
4112
4131
|
}
|
|
4113
4132
|
|
|
4114
4133
|
async function runUpdateCommand(reply /* fn(text) */) {
|
|
4115
|
-
/* yalnız KONTROL + yol gösterme — kurulum yapmaz */
|
|
4134
|
+
/* yalnız KONTROL + yol gösterme — kendiliğinden kurulum yapmaz */
|
|
4116
4135
|
return npmUpdateNow(reply);
|
|
4117
4136
|
}
|
|
4118
4137
|
|
package/src/renderer/i18n.js
CHANGED
|
@@ -165,7 +165,7 @@
|
|
|
165
165
|
sk_h2: 'Skills',
|
|
166
166
|
sk_sub: 'SKILL.md indeksi — tam metin model tarafından okunur',
|
|
167
167
|
sk_auto: 'Otomatik skill: ajan öğrendiği yeni yöntemleri taslak onayı beklemeden kurar; bir skillin daha kolay/daha iyi yolunu bulursa mevcut skilli kendisi günceller',
|
|
168
|
-
up_npm_only: 'Tek dağıtım npm\u2019dir
|
|
168
|
+
up_npm_only: 'Tek dağıtım npm\u2019dir. "Yeniden başlat ve güncelle" butonu: uygulamayı kapatır, GÖRÜNÜR bir cmd penceresinde "beast update" koşturur (npm install çıktısını ekranda görürsün), kurulum bitince uygulama kendiliğinden açılır.İstersen terminalden de: npm i -g beast-agent@latest',
|
|
169
169
|
sk_rules_h2: 'Kalıcı Kurallar',
|
|
170
170
|
sk_rules_sub: 'Agent\u2019ın her sohbette uyduğu talimatlar — WA\u2019dan /rule ile de eklenir',
|
|
171
171
|
sk_no_rule: 'Henüz kural yok.',
|
|
@@ -684,7 +684,7 @@
|
|
|
684
684
|
sk_h2: 'Skills',
|
|
685
685
|
sk_sub: 'SKILL.md index — full text is read by the model',
|
|
686
686
|
sk_auto: 'Auto skills: the agent installs learned procedures without draft approval and updates existing skills when it finds an easier or better way',
|
|
687
|
-
up_npm_only: 'npm is the only distribution
|
|
687
|
+
up_npm_only: 'npm is the only distribution. The "Restart & update" button: closes the app, runs "beast update" in a VISIBLE cmd window (npm install output on screen), and reopens the app when done. Or manually: npm i -g beast-agent@latest',
|
|
688
688
|
sk_rules_h2: 'Persistent Rules',
|
|
689
689
|
sk_rules_sub: 'Instructions the agent follows in every chat — also addable via /rule on WA',
|
|
690
690
|
sk_no_rule: 'No rules yet.',
|
package/src/renderer/renderer.js
CHANGED
|
@@ -1813,13 +1813,14 @@ async function renderUpdatePane(autoCheck) {
|
|
|
1813
1813
|
if (!st) return;
|
|
1814
1814
|
clearInterval(updatePaneTimer);
|
|
1815
1815
|
|
|
1816
|
-
/* mod bazlı butonlar: npm → kontrol
|
|
1817
|
-
|
|
1816
|
+
/* mod bazlı butonlar: npm → kontrol + güncelle-butonu (görünür cmd açar),
|
|
1817
|
+
installer → kontrol + not, dev → sadece kontrol */
|
|
1818
1818
|
const isDev = !st.packaged && !st.npm;
|
|
1819
1819
|
let actions;
|
|
1820
1820
|
if (st.npm) {
|
|
1821
1821
|
actions = `<div class="form-grid" style="grid-template-columns:auto auto;gap:8px;margin-top:12px">
|
|
1822
1822
|
<button id="upCheck" class="btn ghost">${_t('up_check_now')}</button>
|
|
1823
|
+
<button id="upInstall" class="btn">${st.available ? '🔄 ' + _t('up_install_now') : _t('up_install_now')}</button>
|
|
1823
1824
|
</div>
|
|
1824
1825
|
<div class="sub" style="margin-top:8px">${_t('up_npm_only')}</div>`;
|
|
1825
1826
|
} else if (isDev) {
|