beast-agent 0.20.0 → 0.22.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 +1 -1
- package/bin/beast-agent.js +16 -6
- package/package.json +3 -2
- package/scripts/release.js +21 -34
- package/src/agent/bots.js +17 -3
- package/src/agent/engine.js +258 -57
- package/src/main.js +332 -20
- package/src/preload.js +10 -0
- package/src/renderer/i18n.js +28 -2
- package/src/renderer/index.html +46 -1
- package/src/renderer/renderer.js +855 -10
- package/src/renderer/style.css +524 -2
package/README.md
CHANGED
|
@@ -37,7 +37,7 @@ Then start it:
|
|
|
37
37
|
beast-agent
|
|
38
38
|
```
|
|
39
39
|
|
|
40
|
-
That's it — the app window opens. On first launch Beast also creates a **desktop shortcut** and registers itself to **start with Windows** (lives in the tray). Later updates: close the app and run `beast-agent update
|
|
40
|
+
That's it — the app window opens. On first launch Beast also creates a **desktop shortcut** and registers itself to **start with Windows** (lives in the tray). Later updates: close the app and run `beast update` (or `beast-agent update`).
|
|
41
41
|
|
|
42
42
|
## ⚙️ Configuration
|
|
43
43
|
|
package/bin/beast-agent.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
'use strict';
|
|
3
3
|
|
|
4
|
-
/* Beast Agent global npm
|
|
5
|
-
`beast-agent`
|
|
6
|
-
`beast
|
|
4
|
+
/* Beast Agent global npm başlatıcısı (`beast` kısa adı da aynı scripte bağlı):
|
|
5
|
+
`beast` / `beast-agent` → uygulamayı detached başlatır, terminali hemen serbest bırakır
|
|
6
|
+
`beast update` → npm'den en son sürümü yükler (uygulama kapalıyken çalıştır) */
|
|
7
7
|
|
|
8
8
|
const { spawn, spawnSync } = require('child_process');
|
|
9
9
|
const path = require('path');
|
|
@@ -62,10 +62,20 @@ if (process.argv[2] === 'update') {
|
|
|
62
62
|
} else {
|
|
63
63
|
try { spawnSync('pkill', ['-f', 'node_modules/beast-agent'], { stdio: 'ignore' }); } catch {}
|
|
64
64
|
}
|
|
65
|
-
|
|
66
|
-
|
|
65
|
+
/* dosya kilidi (EBUSY) bazen ilk denemede patlar — 5 deneme hakkı */
|
|
66
|
+
let ok = false;
|
|
67
|
+
for (let i = 1; i <= 5 && !ok; i++) {
|
|
68
|
+
const r = spawnSync('npm', ['install', '-g', 'beast-agent@latest'], { stdio: 'inherit', shell: isWin });
|
|
69
|
+
ok = r.status === 0;
|
|
70
|
+
if (!ok && i < 5) {
|
|
71
|
+
console.log(` \u2022 deneme ${i}/5 ba\u015Far\u0131s\u0131z (dosya kilidi olabilir) \u2014 3 sn sonra tekrar\u2026`);
|
|
72
|
+
if (isWin) spawnSync('powershell.exe', ['-NoProfile', '-Command', 'Start-Sleep -Seconds 3'], { stdio: 'ignore' });
|
|
73
|
+
else spawnSync('sleep', ['3']);
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
if (!ok) {
|
|
67
77
|
console.log('\n\u2717 g\u00FCncelleme ba\u015Far\u0131s\u0131z \u2014 elle: npm install -g beast-agent@latest');
|
|
68
|
-
process.exit(
|
|
78
|
+
process.exit(1);
|
|
69
79
|
}
|
|
70
80
|
console.log('\n\u2713 beast-agent g\u00FCncellendi \u2014 uygulama ba\u015Flat\u0131l\u0131yor\u2026');
|
|
71
81
|
try {
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "beast-agent",
|
|
3
3
|
"productName": "Beast Agent",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.22.0",
|
|
5
5
|
"description": "Ultra-fast local agent shell for Windows.",
|
|
6
6
|
"author": "algokodcom (AlgoKod)",
|
|
7
7
|
"license": "MIT",
|
|
@@ -25,7 +25,8 @@
|
|
|
25
25
|
],
|
|
26
26
|
"main": "src/main.js",
|
|
27
27
|
"bin": {
|
|
28
|
-
"beast-agent": "bin/beast-agent.js"
|
|
28
|
+
"beast-agent": "bin/beast-agent.js",
|
|
29
|
+
"beast": "bin/beast-agent.js"
|
|
29
30
|
},
|
|
30
31
|
"scripts": {
|
|
31
32
|
"start": "electron .",
|
package/scripts/release.js
CHANGED
|
@@ -1,18 +1,17 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
/* Beast Agent — Dağıtım / Senkron Sistemi
|
|
4
|
-
Tek komutla tam sürüm
|
|
5
|
-
npm run release → otomatik patch bump (0.
|
|
6
|
-
npm run release -- minor → 0.
|
|
7
|
-
npm release -- 0.
|
|
4
|
+
Tek komutla tam sürüm akışı (EXE/INSTALLER YOK — npm + kaynak dağıtımı):
|
|
5
|
+
npm run release → otomatik patch bump (0.20.0 → 0.20.1)
|
|
6
|
+
npm run release -- minor → 0.21.0
|
|
7
|
+
npm run release -- 0.22.0 → belirli sürüm
|
|
8
8
|
|
|
9
9
|
Adımlar:
|
|
10
10
|
1) package.json sürümü yükselt
|
|
11
11
|
2) commit + tag + push (main + tag)
|
|
12
|
-
3)
|
|
13
|
-
4)
|
|
14
|
-
5)
|
|
15
|
-
6) OneDrive yedek klasörüne kaynak kopyası (beast-v< sürüm >)
|
|
12
|
+
3) GitHub Release (yalnız kaynak — exe/asset yüklenmez)
|
|
13
|
+
4) npm publish (NPM_TOKEN env var ise; yoksa atlar ve uyarır)
|
|
14
|
+
5) OneDrive yedek klasörüne kaynak kopyası (beast-v< sürüm >)
|
|
16
15
|
*/
|
|
17
16
|
|
|
18
17
|
const fs = require('fs');
|
|
@@ -29,7 +28,8 @@ const warn = (msg) => console.log(' \x1b[33m!\x1b[0m ' + msg);
|
|
|
29
28
|
const fail = (msg) => { console.error(' \x1b[31m✗ ' + msg + '\x1b[0m'); process.exit(1); };
|
|
30
29
|
|
|
31
30
|
function run(cmd, opts = {}) {
|
|
32
|
-
|
|
31
|
+
/* stdio:'inherit' iken execSync null döner — trim patlamasın */
|
|
32
|
+
return String(execSync(cmd, { cwd: ROOT, stdio: opts.inherit ? 'inherit' : 'pipe', encoding: 'utf8', ...opts }) ?? '').trim();
|
|
33
33
|
}
|
|
34
34
|
|
|
35
35
|
function bump(version, kind) {
|
|
@@ -51,13 +51,13 @@ const tag = 'v' + next;
|
|
|
51
51
|
console.log(`\x1b[1mBeast Agent release: ${current} → ${next}\x1b[0m`);
|
|
52
52
|
|
|
53
53
|
/* ---------- 1) sürüm bump ---------- */
|
|
54
|
-
step('1/
|
|
54
|
+
step('1/5 sürüm yükselt: ' + current + ' → ' + next);
|
|
55
55
|
pkg.version = next;
|
|
56
56
|
fs.writeFileSync(pkgPath, JSON.stringify(pkg, null, 4) + '\n');
|
|
57
57
|
ok('package.json → ' + next);
|
|
58
58
|
|
|
59
59
|
/* ---------- 2) commit + push ---------- */
|
|
60
|
-
step('2/
|
|
60
|
+
step('2/5 git: commit + tag + push');
|
|
61
61
|
try {
|
|
62
62
|
run('git add -A');
|
|
63
63
|
run(`git commit -m "v${next}"`);
|
|
@@ -67,43 +67,30 @@ run('git push origin main');
|
|
|
67
67
|
run(`git push origin ${tag}`);
|
|
68
68
|
ok('pushed: main + ' + tag);
|
|
69
69
|
|
|
70
|
-
/* ---------- 3)
|
|
71
|
-
step('3/
|
|
72
|
-
run('npm run dist', { inherit: true });
|
|
73
|
-
const setupExe = path.join(ROOT, 'dist', `BeastAgent-Setup-${next}.exe`);
|
|
74
|
-
const portableExe = path.join(ROOT, 'dist', 'BeastAgent.exe');
|
|
75
|
-
if (!fs.existsSync(setupExe)) fail('setup exe bulunamadı: ' + setupExe);
|
|
76
|
-
if (!fs.existsSync(portableExe)) fail('portable exe bulunamadı: ' + portableExe);
|
|
77
|
-
ok('dist hazır: Setup + Portable');
|
|
78
|
-
|
|
79
|
-
/* ---------- 4) GitHub release ---------- */
|
|
80
|
-
step('4/6 GitHub Release ' + tag);
|
|
70
|
+
/* ---------- 3) GitHub Release (kaynak — exe yok) ---------- */
|
|
71
|
+
step('3/5 GitHub Release ' + tag);
|
|
81
72
|
const gh = process.env.GH || 'gh';
|
|
82
73
|
try {
|
|
83
74
|
const notes = [
|
|
84
75
|
`## Beast Agent ${tag}`,
|
|
85
76
|
'',
|
|
86
|
-
'-
|
|
87
|
-
'- \`BeastAgent.exe\` — portable',
|
|
88
|
-
'- \`npm i -g beast-agent\` — npm üzerinden',
|
|
77
|
+
'- \`npm i -g beast-agent@\`' + next,
|
|
89
78
|
'',
|
|
79
|
+
'Dağıtım npm üzerinden yapılır — exe/installer sürümü kaldırıldı.',
|
|
90
80
|
'Tam değişiklik listesi: commit geçmişi.',
|
|
91
81
|
].join('\n');
|
|
92
82
|
const notesFile = path.join(ROOT, 'dist', 'release-notes.md');
|
|
83
|
+
fs.mkdirSync(path.dirname(notesFile), { recursive: true });
|
|
93
84
|
fs.writeFileSync(notesFile, notes);
|
|
94
|
-
const assets = [setupExe, setupExe + '.blockmap', portableExe, path.join(ROOT, 'dist', 'latest.yml')]
|
|
95
|
-
.filter((f) => fs.existsSync(f))
|
|
96
|
-
.map((f) => `"${f}"`)
|
|
97
|
-
.join(' ');
|
|
98
85
|
try { run(`${gh} release delete ${tag} --yes --cleanup-tag`); } catch {}
|
|
99
|
-
run(`${gh} release create ${tag}
|
|
86
|
+
run(`${gh} release create ${tag} --title "Beast Agent ${tag}" --notes-file "${notesFile}"`, { inherit: true });
|
|
100
87
|
ok('release yayında: https://github.com/algokodcom/beast-agent/releases/tag/' + tag);
|
|
101
88
|
} catch (e) {
|
|
102
89
|
fail('GitHub release: ' + String(e));
|
|
103
90
|
}
|
|
104
91
|
|
|
105
|
-
/* ----------
|
|
106
|
-
step('5
|
|
92
|
+
/* ---------- 4) npm publish ---------- */
|
|
93
|
+
step('4/5 npm publish');
|
|
107
94
|
if (process.env.NPM_TOKEN) {
|
|
108
95
|
try {
|
|
109
96
|
run(`npm publish --//registry.npmjs.org/:_authToken=${process.env.NPM_TOKEN}`, { inherit: true });
|
|
@@ -116,8 +103,8 @@ if (process.env.NPM_TOKEN) {
|
|
|
116
103
|
warn('Elle: set NPM_TOKEN=<token> && npm publish');
|
|
117
104
|
}
|
|
118
105
|
|
|
119
|
-
/* ----------
|
|
120
|
-
step('
|
|
106
|
+
/* ---------- 5) OneDrive kaynak yedeği ---------- */
|
|
107
|
+
step('5/5 OneDrive yedek (beast-v' + next + ')');
|
|
121
108
|
try {
|
|
122
109
|
const dest = path.join(ONE_DRIVE_DIR, 'beast-v' + next);
|
|
123
110
|
fs.mkdirSync(dest, { recursive: true });
|
package/src/agent/bots.js
CHANGED
|
@@ -239,9 +239,23 @@ function update(id, patch) {
|
|
|
239
239
|
changes.push('prompt güncellendi');
|
|
240
240
|
b.prompt = String(patch.prompt).slice(0, 4000);
|
|
241
241
|
}
|
|
242
|
-
if (
|
|
243
|
-
|
|
244
|
-
|
|
242
|
+
if (patch.perm !== undefined) {
|
|
243
|
+
/* 'all' tek başına tüm araçları verir; web/read/chat çoklu seçilebilir
|
|
244
|
+
(['web','read'] gibi dizi ya da 'web,read' gibi string kabul edilir) */
|
|
245
|
+
const PERMS_ALL = ['all', 'web', 'read', 'chat'];
|
|
246
|
+
let nextPerm = null;
|
|
247
|
+
if (Array.isArray(patch.perm)) {
|
|
248
|
+
const picked = [...new Set(patch.perm.map((x) => String(x).trim()).filter((x) => PERMS_ALL.includes(x)))];
|
|
249
|
+
nextPerm = picked.includes('all') ? 'all' : (picked.length ? picked : 'chat');
|
|
250
|
+
} else if (typeof patch.perm === 'string') {
|
|
251
|
+
const arr = patch.perm.split(',').map((x) => x.trim()).filter((x) => PERMS_ALL.includes(x));
|
|
252
|
+
if (arr.length) nextPerm = arr.includes('all') ? 'all' : (arr.length === 1 ? arr[0] : arr);
|
|
253
|
+
}
|
|
254
|
+
if (nextPerm !== null && JSON.stringify(nextPerm) !== JSON.stringify(b.perm)) {
|
|
255
|
+
const fp = (p) => (Array.isArray(p) ? '[' + p.join('+') + ']' : String(p));
|
|
256
|
+
changes.push(`perm: ${fp(b.perm)} → ${fp(nextPerm)}`);
|
|
257
|
+
b.perm = nextPerm;
|
|
258
|
+
}
|
|
245
259
|
}
|
|
246
260
|
if (patch.skills && typeof patch.skills === 'object') {
|
|
247
261
|
const merged = { ...DEFAULT_SKILLS, ...(b.skills || {}) };
|