beast-agent 1.9.0 → 2.0.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 +75 -10
- package/src/agent/kb.js +123 -123
- package/src/agent/llm.js +430 -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
|
@@ -1,113 +1,113 @@
|
|
|
1
|
-
#!/usr/bin/env python3
|
|
2
|
-
# -*- coding: utf-8 -*-
|
|
3
|
-
"""Beast haber toplayıcı — yalnızca standart kütüphane (requests yok).
|
|
4
|
-
|
|
5
|
-
Kaynaklar: NTV, CNN Türk, Habertürk, BBC Türkçe, Anadolu Ajansı.
|
|
6
|
-
Kullanım:
|
|
7
|
-
python news.py # her kaynaktan 8 başlık
|
|
8
|
-
python news.py --limit 3 # her kaynaktan 3 başlık
|
|
9
|
-
python news.py --feed ntv # tek kaynak (--json ile birlikte güzel)
|
|
10
|
-
python news.py --json # makine okunur JSON satırları
|
|
11
|
-
Çıktı formatı (satır başına): SAAT | KAYNAK | Başlık | Link
|
|
12
|
-
"""
|
|
13
|
-
import argparse
|
|
14
|
-
import json
|
|
15
|
-
import re
|
|
16
|
-
import ssl
|
|
17
|
-
import sys
|
|
18
|
-
import urllib.request
|
|
19
|
-
import xml.etree.ElementTree as ET
|
|
20
|
-
|
|
21
|
-
try: # konsol kod sayfasından bağımsız temiz UTF-8 çıktı
|
|
22
|
-
sys.stdout.reconfigure(encoding="utf-8", errors="replace")
|
|
23
|
-
sys.stderr.reconfigure(encoding="utf-8", errors="replace")
|
|
24
|
-
except Exception:
|
|
25
|
-
pass
|
|
26
|
-
|
|
27
|
-
FEEDS = {
|
|
28
|
-
"ntv": "https://www.ntv.com.tr/gundem.rss",
|
|
29
|
-
"cnnturk": "https://www.cnnturk.com/rss/rss.aspx?rss=1",
|
|
30
|
-
"haberturk": "https://www.haberturk.com/rss",
|
|
31
|
-
"bbcturkce": "https://feeds.bbci.co.uk/turkce/rss.xml",
|
|
32
|
-
"aa": "https://www.aa.com.tr/tr/rss/default?cat=guncel",
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
TAG_RE = re.compile(r"<[^>]+>")
|
|
36
|
-
CTX = ssl.create_default_context()
|
|
37
|
-
UA = {"User-Agent": "Mozilla/5.0 BeastAgent news.py"}
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
def fetch(url, timeout=15):
|
|
41
|
-
req = urllib.request.Request(url, headers=UA)
|
|
42
|
-
with urllib.request.urlopen(req, timeout=timeout, context=CTX) as r:
|
|
43
|
-
return r.read()
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
def strip_html(s):
|
|
47
|
-
return TAG_RE.sub(" ", s or "").replace("&", "&").replace(""", '"').replace(
|
|
48
|
-
"'", "'"
|
|
49
|
-
).replace("<", "<").replace(">", ">").strip()
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
def text_of(node):
|
|
53
|
-
return strip_html(node.text if node is not None and node.text else "")
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
def parse_feed(name, url):
|
|
57
|
-
"""RSS/Atom'u iki namespace'te de dener; (saat, kaynak, başlık, link) döner."""
|
|
58
|
-
raw = fetch(url)
|
|
59
|
-
root = ET.fromstring(raw)
|
|
60
|
-
items = []
|
|
61
|
-
for it in root.iter():
|
|
62
|
-
tag = it.tag.rsplit("}", 1)[-1]
|
|
63
|
-
if tag not in ("item", "entry"):
|
|
64
|
-
continue
|
|
65
|
-
title = link = date = ""
|
|
66
|
-
for ch in it:
|
|
67
|
-
t = ch.tag.rsplit("}", 1)[-1]
|
|
68
|
-
if t == "title":
|
|
69
|
-
title = text_of(ch)
|
|
70
|
-
elif t == "link":
|
|
71
|
-
link = (ch.get("href") or "").strip() or text_of(ch)
|
|
72
|
-
elif t in ("pubDate", "published", "updated", "date"):
|
|
73
|
-
date = text_of(ch)[:16]
|
|
74
|
-
if title:
|
|
75
|
-
items.append((date or "-", name.upper(), title[:180], link))
|
|
76
|
-
return items
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
def main():
|
|
80
|
-
ap = argparse.ArgumentParser(description="Beast RSS haber toplayıcı")
|
|
81
|
-
ap.add_argument("--limit", type=int, default=8, help="kaynak başına başlık sayısı")
|
|
82
|
-
ap.add_argument("--feed", default="", help="tek kaynak anahtarı (ntv,cnnturk,haberturk,bbcturkce,aa)")
|
|
83
|
-
ap.add_argument("--json", action="store_true", help="JSON Lines çıktısı")
|
|
84
|
-
a = ap.parse_args()
|
|
85
|
-
|
|
86
|
-
wanted = {a.feed.strip().lower()} if a.feed else set(FEEDS)
|
|
87
|
-
unknown = wanted - set(FEEDS)
|
|
88
|
-
if unknown:
|
|
89
|
-
print(f"[news.py] bilinmeyen kaynak: {', '.join(unknown)}", file=sys.stderr)
|
|
90
|
-
|
|
91
|
-
rows, errors = [], []
|
|
92
|
-
for name in FEEDS:
|
|
93
|
-
if name not in wanted:
|
|
94
|
-
continue
|
|
95
|
-
try:
|
|
96
|
-
rows.extend(parse_feed(name, FEEDS[name])[: max(0, a.limit)])
|
|
97
|
-
except Exception as e: # tek kaynak düşsün, diğerleri devam
|
|
98
|
-
errors.append(f"{name}: {e}")
|
|
99
|
-
|
|
100
|
-
if a.json:
|
|
101
|
-
for r in rows:
|
|
102
|
-
print(json.dumps({"time": r[0], "source": r[1], "title": r[2], "link": r[3]}, ensure_ascii=False))
|
|
103
|
-
else:
|
|
104
|
-
for r in rows:
|
|
105
|
-
print(f"{r[0]} | {r[1]} | {r[2]}\n {r[3]}")
|
|
106
|
-
|
|
107
|
-
for e in errors:
|
|
108
|
-
print(f"[news.py] hata {e}", file=sys.stderr)
|
|
109
|
-
print(f"[news.py] {len(rows)} haber, {len(errors)} kaynak hatası", file=sys.stderr)
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
if __name__ == "__main__":
|
|
113
|
-
main()
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
# -*- coding: utf-8 -*-
|
|
3
|
+
"""Beast haber toplayıcı — yalnızca standart kütüphane (requests yok).
|
|
4
|
+
|
|
5
|
+
Kaynaklar: NTV, CNN Türk, Habertürk, BBC Türkçe, Anadolu Ajansı.
|
|
6
|
+
Kullanım:
|
|
7
|
+
python news.py # her kaynaktan 8 başlık
|
|
8
|
+
python news.py --limit 3 # her kaynaktan 3 başlık
|
|
9
|
+
python news.py --feed ntv # tek kaynak (--json ile birlikte güzel)
|
|
10
|
+
python news.py --json # makine okunur JSON satırları
|
|
11
|
+
Çıktı formatı (satır başına): SAAT | KAYNAK | Başlık | Link
|
|
12
|
+
"""
|
|
13
|
+
import argparse
|
|
14
|
+
import json
|
|
15
|
+
import re
|
|
16
|
+
import ssl
|
|
17
|
+
import sys
|
|
18
|
+
import urllib.request
|
|
19
|
+
import xml.etree.ElementTree as ET
|
|
20
|
+
|
|
21
|
+
try: # konsol kod sayfasından bağımsız temiz UTF-8 çıktı
|
|
22
|
+
sys.stdout.reconfigure(encoding="utf-8", errors="replace")
|
|
23
|
+
sys.stderr.reconfigure(encoding="utf-8", errors="replace")
|
|
24
|
+
except Exception:
|
|
25
|
+
pass
|
|
26
|
+
|
|
27
|
+
FEEDS = {
|
|
28
|
+
"ntv": "https://www.ntv.com.tr/gundem.rss",
|
|
29
|
+
"cnnturk": "https://www.cnnturk.com/rss/rss.aspx?rss=1",
|
|
30
|
+
"haberturk": "https://www.haberturk.com/rss",
|
|
31
|
+
"bbcturkce": "https://feeds.bbci.co.uk/turkce/rss.xml",
|
|
32
|
+
"aa": "https://www.aa.com.tr/tr/rss/default?cat=guncel",
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
TAG_RE = re.compile(r"<[^>]+>")
|
|
36
|
+
CTX = ssl.create_default_context()
|
|
37
|
+
UA = {"User-Agent": "Mozilla/5.0 BeastAgent news.py"}
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
def fetch(url, timeout=15):
|
|
41
|
+
req = urllib.request.Request(url, headers=UA)
|
|
42
|
+
with urllib.request.urlopen(req, timeout=timeout, context=CTX) as r:
|
|
43
|
+
return r.read()
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
def strip_html(s):
|
|
47
|
+
return TAG_RE.sub(" ", s or "").replace("&", "&").replace(""", '"').replace(
|
|
48
|
+
"'", "'"
|
|
49
|
+
).replace("<", "<").replace(">", ">").strip()
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
def text_of(node):
|
|
53
|
+
return strip_html(node.text if node is not None and node.text else "")
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
def parse_feed(name, url):
|
|
57
|
+
"""RSS/Atom'u iki namespace'te de dener; (saat, kaynak, başlık, link) döner."""
|
|
58
|
+
raw = fetch(url)
|
|
59
|
+
root = ET.fromstring(raw)
|
|
60
|
+
items = []
|
|
61
|
+
for it in root.iter():
|
|
62
|
+
tag = it.tag.rsplit("}", 1)[-1]
|
|
63
|
+
if tag not in ("item", "entry"):
|
|
64
|
+
continue
|
|
65
|
+
title = link = date = ""
|
|
66
|
+
for ch in it:
|
|
67
|
+
t = ch.tag.rsplit("}", 1)[-1]
|
|
68
|
+
if t == "title":
|
|
69
|
+
title = text_of(ch)
|
|
70
|
+
elif t == "link":
|
|
71
|
+
link = (ch.get("href") or "").strip() or text_of(ch)
|
|
72
|
+
elif t in ("pubDate", "published", "updated", "date"):
|
|
73
|
+
date = text_of(ch)[:16]
|
|
74
|
+
if title:
|
|
75
|
+
items.append((date or "-", name.upper(), title[:180], link))
|
|
76
|
+
return items
|
|
77
|
+
|
|
78
|
+
|
|
79
|
+
def main():
|
|
80
|
+
ap = argparse.ArgumentParser(description="Beast RSS haber toplayıcı")
|
|
81
|
+
ap.add_argument("--limit", type=int, default=8, help="kaynak başına başlık sayısı")
|
|
82
|
+
ap.add_argument("--feed", default="", help="tek kaynak anahtarı (ntv,cnnturk,haberturk,bbcturkce,aa)")
|
|
83
|
+
ap.add_argument("--json", action="store_true", help="JSON Lines çıktısı")
|
|
84
|
+
a = ap.parse_args()
|
|
85
|
+
|
|
86
|
+
wanted = {a.feed.strip().lower()} if a.feed else set(FEEDS)
|
|
87
|
+
unknown = wanted - set(FEEDS)
|
|
88
|
+
if unknown:
|
|
89
|
+
print(f"[news.py] bilinmeyen kaynak: {', '.join(unknown)}", file=sys.stderr)
|
|
90
|
+
|
|
91
|
+
rows, errors = [], []
|
|
92
|
+
for name in FEEDS:
|
|
93
|
+
if name not in wanted:
|
|
94
|
+
continue
|
|
95
|
+
try:
|
|
96
|
+
rows.extend(parse_feed(name, FEEDS[name])[: max(0, a.limit)])
|
|
97
|
+
except Exception as e: # tek kaynak düşsün, diğerleri devam
|
|
98
|
+
errors.append(f"{name}: {e}")
|
|
99
|
+
|
|
100
|
+
if a.json:
|
|
101
|
+
for r in rows:
|
|
102
|
+
print(json.dumps({"time": r[0], "source": r[1], "title": r[2], "link": r[3]}, ensure_ascii=False))
|
|
103
|
+
else:
|
|
104
|
+
for r in rows:
|
|
105
|
+
print(f"{r[0]} | {r[1]} | {r[2]}\n {r[3]}")
|
|
106
|
+
|
|
107
|
+
for e in errors:
|
|
108
|
+
print(f"[news.py] hata {e}", file=sys.stderr)
|
|
109
|
+
print(f"[news.py] {len(rows)} haber, {len(errors)} kaynak hatası", file=sys.stderr)
|
|
110
|
+
|
|
111
|
+
|
|
112
|
+
if __name__ == "__main__":
|
|
113
|
+
main()
|
|
@@ -1,30 +1,30 @@
|
|
|
1
|
-
#!/usr/bin/env python3
|
|
2
|
-
# Beast stealth search - Obscura yaklasimi: Chrome TLS parmak izi taklidi.
|
|
3
|
-
# curl_cffi (curl-impersonate) ile html.duckduckgo.com'a gercek Chrome kimligiyle girer.
|
|
4
|
-
# stdout: ham DDG HTML - ayristirma JS tarafinda (tools.parseDdgResults) yapilir.
|
|
5
|
-
# Kullanim: stealthsearch.py "<url-encoded-sorgu>"
|
|
6
|
-
import sys
|
|
7
|
-
import urllib.parse
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
def main():
|
|
11
|
-
if len(sys.argv) < 2:
|
|
12
|
-
return
|
|
13
|
-
q = urllib.parse.quote_plus(sys.argv[1])
|
|
14
|
-
try:
|
|
15
|
-
from curl_cffi import requests
|
|
16
|
-
except ImportError:
|
|
17
|
-
return # kurulu degil - JS tarafi sessizce atlar
|
|
18
|
-
try:
|
|
19
|
-
r = requests.get(
|
|
20
|
-
"https://html.duckduckgo.com/html/?q=" + q,
|
|
21
|
-
impersonate="chrome",
|
|
22
|
-
headers={"Accept-Language": "tr-TR,tr;q=0.9,en;q=0.8"},
|
|
23
|
-
timeout=15,
|
|
24
|
-
)
|
|
25
|
-
sys.stdout.write(r.text or "")
|
|
26
|
-
except Exception:
|
|
27
|
-
return
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
main()
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
# Beast stealth search - Obscura yaklasimi: Chrome TLS parmak izi taklidi.
|
|
3
|
+
# curl_cffi (curl-impersonate) ile html.duckduckgo.com'a gercek Chrome kimligiyle girer.
|
|
4
|
+
# stdout: ham DDG HTML - ayristirma JS tarafinda (tools.parseDdgResults) yapilir.
|
|
5
|
+
# Kullanim: stealthsearch.py "<url-encoded-sorgu>"
|
|
6
|
+
import sys
|
|
7
|
+
import urllib.parse
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
def main():
|
|
11
|
+
if len(sys.argv) < 2:
|
|
12
|
+
return
|
|
13
|
+
q = urllib.parse.quote_plus(sys.argv[1])
|
|
14
|
+
try:
|
|
15
|
+
from curl_cffi import requests
|
|
16
|
+
except ImportError:
|
|
17
|
+
return # kurulu degil - JS tarafi sessizce atlar
|
|
18
|
+
try:
|
|
19
|
+
r = requests.get(
|
|
20
|
+
"https://html.duckduckgo.com/html/?q=" + q,
|
|
21
|
+
impersonate="chrome",
|
|
22
|
+
headers={"Accept-Language": "tr-TR,tr;q=0.9,en;q=0.8"},
|
|
23
|
+
timeout=15,
|
|
24
|
+
)
|
|
25
|
+
sys.stdout.write(r.text or "")
|
|
26
|
+
except Exception:
|
|
27
|
+
return
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
main()
|