beast-agent 1.9.0 → 2.1.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/LICENSE +21 -21
- package/README.md +130 -130
- package/bin/beast-agent.js +137 -137
- package/package.json +1 -1
- package/scripts/fix-electron.js +138 -138
- package/scripts/release.js +137 -131
- package/scripts/swap-electron.js +40 -40
- package/src/agent/agentdefs.js +122 -122
- package/src/agent/bots.js +580 -580
- package/src/agent/bus.js +389 -389
- package/src/agent/computeruse.js +200 -200
- package/src/agent/config.js +284 -284
- package/src/agent/discord.js +332 -332
- package/src/agent/engine.js +106 -14
- package/src/agent/kb.js +123 -123
- package/src/agent/llm.js +610 -430
- package/src/agent/logger.js +90 -90
- package/src/agent/mcp.js +427 -427
- package/src/agent/mem0.js +605 -605
- package/src/agent/memory.js +427 -427
- package/src/agent/mqueue.js +124 -124
- package/src/agent/pdf.js +20 -20
- package/src/agent/research.js +133 -133
- package/src/agent/scripts/news.py +113 -113
- package/src/agent/scripts/stealthsearch.py +30 -30
- package/src/agent/scripts/websearch.py +225 -225
- package/src/agent/searxng.js +325 -325
- package/src/agent/seeds/brainstorming/SKILL.md +90 -90
- package/src/agent/seeds/dispatching-parallel-agents/SKILL.md +120 -120
- package/src/agent/seeds/executing-plans/SKILL.md +60 -60
- package/src/agent/seeds/subagent-driven-development/SKILL.md +167 -167
- package/src/agent/seeds/systematic-debugging/SKILL.md +131 -131
- package/src/agent/seeds/test-driven-development/SKILL.md +152 -152
- package/src/agent/seeds/verification-before-completion/SKILL.md +63 -63
- package/src/agent/seeds/writing-plans/SKILL.md +162 -162
- package/src/agent/seeds/writing-skills/SKILL.md +229 -229
- package/src/agent/skills.js +652 -652
- package/src/agent/store.js +378 -378
- package/src/agent/telegram.js +155 -155
- package/src/agent/tokens.js +39 -39
- package/src/agent/usage.js +125 -125
- package/src/agent/watchers.js +312 -312
- package/src/agent/watext.js +80 -80
- package/src/agent/whatsapp.js +555 -555
- package/src/cron.js +255 -255
- package/src/main.js +348 -6
- package/src/preload.js +9 -0
- package/src/renderer/browserPreload.js +73 -73
- package/src/renderer/i18n.js +4 -0
- package/src/renderer/index.html +448 -409
- package/src/renderer/renderer.js +824 -41
- package/src/renderer/style.css +264 -5
package/src/agent/agentdefs.js
CHANGED
|
@@ -1,122 +1,122 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
/* ---------- opencode agent.ts port: özel ajan tanımları ----------
|
|
4
|
-
Kullanıcı ajanları: %APPDATA%\beast\agents\<isim>.md
|
|
5
|
-
Markdown frontmatter + prompt gövdesi:
|
|
6
|
-
|
|
7
|
-
---
|
|
8
|
-
model: providerId::model # opsiyonel — o ajanın modeli
|
|
9
|
-
tools: [run_command, web_search] # opsiyonel araç beyaz listesi
|
|
10
|
-
steps: 12 # opsiyonel tur limiti (2-60)
|
|
11
|
-
mode: all # chat | bg | all (nerede kullanılabilir)
|
|
12
|
-
---
|
|
13
|
-
|
|
14
|
-
Buradan itibaren ajanın sistem prompt eki gelir.
|
|
15
|
-
|
|
16
|
-
Kullanım: sohbette /agent <isim> · paralel ajanda run_background(agent:"isim")
|
|
17
|
-
Ana akış bunları engine.setSessionAgent / runBackground(opts.agent) ile tüketir. */
|
|
18
|
-
|
|
19
|
-
const fs = require('fs');
|
|
20
|
-
const path = require('path');
|
|
21
|
-
const { parseYaml, beastDir } = require('./config');
|
|
22
|
-
|
|
23
|
-
function dir() {
|
|
24
|
-
return path.join(beastDir(), 'agents');
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
/* İlk açılışta klasörü + örnek tanımı tohumla (kullanıcı hemen görür) */
|
|
28
|
-
function seedIfEmpty() {
|
|
29
|
-
try {
|
|
30
|
-
const d = dir();
|
|
31
|
-
if (fs.existsSync(d)) return;
|
|
32
|
-
fs.mkdirSync(d, { recursive: true });
|
|
33
|
-
fs.writeFileSync(
|
|
34
|
-
path.join(d, 'ornek-arastirmaci.md'),
|
|
35
|
-
[
|
|
36
|
-
'---',
|
|
37
|
-
'# Bu dosya bir ÖRNEK ajan tanımıdır — dilediğin gibi düzenle/kopyala.',
|
|
38
|
-
'# model: providerId::model → bu ajana özel model (boşsa aktif model)',
|
|
39
|
-
'# tools: [web_search, http_fetch, deep_search] → araç beyaz listesi',
|
|
40
|
-
'# steps: 10 → tur limiti (2-60)',
|
|
41
|
-
'# mode: all → chat | bg | all',
|
|
42
|
-
'mode: all',
|
|
43
|
-
'steps: 10',
|
|
44
|
-
'---',
|
|
45
|
-
'',
|
|
46
|
-
'Sen odaklı bir ARAŞTIRMACI ajansın. Görevi baştan sona yürüt:',
|
|
47
|
-
'1) Kaynakları paralel tara (3-5 yeterli), 2) çelişkileri işaretle,',
|
|
48
|
-
'3) bulguları madde madde + kaynak linkleriyle raporla.',
|
|
49
|
-
'2-3 denemede bulunamayan bilgiyi bırak — kısmi sonuçla gel, takılma.',
|
|
50
|
-
'',
|
|
51
|
-
].join('\n')
|
|
52
|
-
);
|
|
53
|
-
} catch {}
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
function _parseFile(file) {
|
|
57
|
-
const name = path.basename(file).replace(/\.md$/i, '');
|
|
58
|
-
let text = '';
|
|
59
|
-
try {
|
|
60
|
-
text = fs.readFileSync(file, 'utf8');
|
|
61
|
-
} catch {
|
|
62
|
-
return null;
|
|
63
|
-
}
|
|
64
|
-
const t = String(text || '').replace(/\r\n/g, '\n').trim();
|
|
65
|
-
if (!t) return null;
|
|
66
|
-
let meta = {};
|
|
67
|
-
let body = t;
|
|
68
|
-
const m = /^---\n([\s\S]*?)\n---\n?([\s\S]*)$/.exec(t);
|
|
69
|
-
if (m) {
|
|
70
|
-
try {
|
|
71
|
-
meta = parseYaml(m[1]) || {};
|
|
72
|
-
} catch {
|
|
73
|
-
meta = {};
|
|
74
|
-
}
|
|
75
|
-
body = m[2] || '';
|
|
76
|
-
}
|
|
77
|
-
let tools = null;
|
|
78
|
-
if (Array.isArray(meta.tools)) tools = meta.tools.map(String).map((s) => s.trim()).filter(Boolean);
|
|
79
|
-
else if (meta.tools) tools = String(meta.tools).split(',').map((s) => s.trim()).filter(Boolean);
|
|
80
|
-
const steps = Math.round(Number(meta.steps) || 0);
|
|
81
|
-
return {
|
|
82
|
-
name,
|
|
83
|
-
model: String(meta.model || '').trim() || null,
|
|
84
|
-
tools: tools && tools.length ? tools : null,
|
|
85
|
-
steps: steps ? Math.max(2, Math.min(60, steps)) : null,
|
|
86
|
-
mode: ['chat', 'bg', 'all'].includes(String(meta.mode || '').toLowerCase())
|
|
87
|
-
? String(meta.mode).toLowerCase()
|
|
88
|
-
: 'all',
|
|
89
|
-
prompt: body.trim(),
|
|
90
|
-
};
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
function list() {
|
|
94
|
-
let files = [];
|
|
95
|
-
try {
|
|
96
|
-
files = fs.readdirSync(dir()).filter((f) => f.toLowerCase().endsWith('.md'));
|
|
97
|
-
} catch {
|
|
98
|
-
return [];
|
|
99
|
-
}
|
|
100
|
-
const out = [];
|
|
101
|
-
const seen = new Set();
|
|
102
|
-
for (const f of files) {
|
|
103
|
-
const def = _parseFile(path.join(dir(), f));
|
|
104
|
-
if (def && def.prompt && !seen.has(def.name.toLowerCase())) {
|
|
105
|
-
seen.add(def.name.toLowerCase());
|
|
106
|
-
out.push(def);
|
|
107
|
-
}
|
|
108
|
-
}
|
|
109
|
-
return out;
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
function get(name) {
|
|
113
|
-
const n = String(name || '').trim().toLowerCase();
|
|
114
|
-
if (!n) return null;
|
|
115
|
-
return (
|
|
116
|
-
list().find((d) => d.name.toLowerCase() === n) ||
|
|
117
|
-
list().find((d) => d.name.toLowerCase().startsWith(n)) ||
|
|
118
|
-
null
|
|
119
|
-
);
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
module.exports = { dir, list, get, seedIfEmpty };
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
/* ---------- opencode agent.ts port: özel ajan tanımları ----------
|
|
4
|
+
Kullanıcı ajanları: %APPDATA%\beast\agents\<isim>.md
|
|
5
|
+
Markdown frontmatter + prompt gövdesi:
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
model: providerId::model # opsiyonel — o ajanın modeli
|
|
9
|
+
tools: [run_command, web_search] # opsiyonel araç beyaz listesi
|
|
10
|
+
steps: 12 # opsiyonel tur limiti (2-60)
|
|
11
|
+
mode: all # chat | bg | all (nerede kullanılabilir)
|
|
12
|
+
---
|
|
13
|
+
|
|
14
|
+
Buradan itibaren ajanın sistem prompt eki gelir.
|
|
15
|
+
|
|
16
|
+
Kullanım: sohbette /agent <isim> · paralel ajanda run_background(agent:"isim")
|
|
17
|
+
Ana akış bunları engine.setSessionAgent / runBackground(opts.agent) ile tüketir. */
|
|
18
|
+
|
|
19
|
+
const fs = require('fs');
|
|
20
|
+
const path = require('path');
|
|
21
|
+
const { parseYaml, beastDir } = require('./config');
|
|
22
|
+
|
|
23
|
+
function dir() {
|
|
24
|
+
return path.join(beastDir(), 'agents');
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
/* İlk açılışta klasörü + örnek tanımı tohumla (kullanıcı hemen görür) */
|
|
28
|
+
function seedIfEmpty() {
|
|
29
|
+
try {
|
|
30
|
+
const d = dir();
|
|
31
|
+
if (fs.existsSync(d)) return;
|
|
32
|
+
fs.mkdirSync(d, { recursive: true });
|
|
33
|
+
fs.writeFileSync(
|
|
34
|
+
path.join(d, 'ornek-arastirmaci.md'),
|
|
35
|
+
[
|
|
36
|
+
'---',
|
|
37
|
+
'# Bu dosya bir ÖRNEK ajan tanımıdır — dilediğin gibi düzenle/kopyala.',
|
|
38
|
+
'# model: providerId::model → bu ajana özel model (boşsa aktif model)',
|
|
39
|
+
'# tools: [web_search, http_fetch, deep_search] → araç beyaz listesi',
|
|
40
|
+
'# steps: 10 → tur limiti (2-60)',
|
|
41
|
+
'# mode: all → chat | bg | all',
|
|
42
|
+
'mode: all',
|
|
43
|
+
'steps: 10',
|
|
44
|
+
'---',
|
|
45
|
+
'',
|
|
46
|
+
'Sen odaklı bir ARAŞTIRMACI ajansın. Görevi baştan sona yürüt:',
|
|
47
|
+
'1) Kaynakları paralel tara (3-5 yeterli), 2) çelişkileri işaretle,',
|
|
48
|
+
'3) bulguları madde madde + kaynak linkleriyle raporla.',
|
|
49
|
+
'2-3 denemede bulunamayan bilgiyi bırak — kısmi sonuçla gel, takılma.',
|
|
50
|
+
'',
|
|
51
|
+
].join('\n')
|
|
52
|
+
);
|
|
53
|
+
} catch {}
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
function _parseFile(file) {
|
|
57
|
+
const name = path.basename(file).replace(/\.md$/i, '');
|
|
58
|
+
let text = '';
|
|
59
|
+
try {
|
|
60
|
+
text = fs.readFileSync(file, 'utf8');
|
|
61
|
+
} catch {
|
|
62
|
+
return null;
|
|
63
|
+
}
|
|
64
|
+
const t = String(text || '').replace(/\r\n/g, '\n').trim();
|
|
65
|
+
if (!t) return null;
|
|
66
|
+
let meta = {};
|
|
67
|
+
let body = t;
|
|
68
|
+
const m = /^---\n([\s\S]*?)\n---\n?([\s\S]*)$/.exec(t);
|
|
69
|
+
if (m) {
|
|
70
|
+
try {
|
|
71
|
+
meta = parseYaml(m[1]) || {};
|
|
72
|
+
} catch {
|
|
73
|
+
meta = {};
|
|
74
|
+
}
|
|
75
|
+
body = m[2] || '';
|
|
76
|
+
}
|
|
77
|
+
let tools = null;
|
|
78
|
+
if (Array.isArray(meta.tools)) tools = meta.tools.map(String).map((s) => s.trim()).filter(Boolean);
|
|
79
|
+
else if (meta.tools) tools = String(meta.tools).split(',').map((s) => s.trim()).filter(Boolean);
|
|
80
|
+
const steps = Math.round(Number(meta.steps) || 0);
|
|
81
|
+
return {
|
|
82
|
+
name,
|
|
83
|
+
model: String(meta.model || '').trim() || null,
|
|
84
|
+
tools: tools && tools.length ? tools : null,
|
|
85
|
+
steps: steps ? Math.max(2, Math.min(60, steps)) : null,
|
|
86
|
+
mode: ['chat', 'bg', 'all'].includes(String(meta.mode || '').toLowerCase())
|
|
87
|
+
? String(meta.mode).toLowerCase()
|
|
88
|
+
: 'all',
|
|
89
|
+
prompt: body.trim(),
|
|
90
|
+
};
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
function list() {
|
|
94
|
+
let files = [];
|
|
95
|
+
try {
|
|
96
|
+
files = fs.readdirSync(dir()).filter((f) => f.toLowerCase().endsWith('.md'));
|
|
97
|
+
} catch {
|
|
98
|
+
return [];
|
|
99
|
+
}
|
|
100
|
+
const out = [];
|
|
101
|
+
const seen = new Set();
|
|
102
|
+
for (const f of files) {
|
|
103
|
+
const def = _parseFile(path.join(dir(), f));
|
|
104
|
+
if (def && def.prompt && !seen.has(def.name.toLowerCase())) {
|
|
105
|
+
seen.add(def.name.toLowerCase());
|
|
106
|
+
out.push(def);
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
return out;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
function get(name) {
|
|
113
|
+
const n = String(name || '').trim().toLowerCase();
|
|
114
|
+
if (!n) return null;
|
|
115
|
+
return (
|
|
116
|
+
list().find((d) => d.name.toLowerCase() === n) ||
|
|
117
|
+
list().find((d) => d.name.toLowerCase().startsWith(n)) ||
|
|
118
|
+
null
|
|
119
|
+
);
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
module.exports = { dir, list, get, seedIfEmpty };
|