beast-agent 0.15.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.
Files changed (62) hide show
  1. package/.env.example +7 -0
  2. package/LICENSE +21 -0
  3. package/README.md +94 -0
  4. package/assets/app.ico +0 -0
  5. package/assets/tray.png +0 -0
  6. package/bin/beast-agent.js +23 -0
  7. package/config.example.yaml +26 -0
  8. package/eng.traineddata +0 -0
  9. package/package.json +101 -0
  10. package/scripts/swap-electron.js +40 -0
  11. package/src/agent/bus.js +384 -0
  12. package/src/agent/computeruse.js +200 -0
  13. package/src/agent/config.js +284 -0
  14. package/src/agent/engine.js +3118 -0
  15. package/src/agent/kb.js +123 -0
  16. package/src/agent/llm.js +219 -0
  17. package/src/agent/logger.js +90 -0
  18. package/src/agent/memory.js +383 -0
  19. package/src/agent/pdf.js +20 -0
  20. package/src/agent/scripts/__pycache__/websearch.cpython-312.pyc +0 -0
  21. package/src/agent/scripts/news.py +113 -0
  22. package/src/agent/scripts/websearch.py +225 -0
  23. package/src/agent/skills.js +522 -0
  24. package/src/agent/tokens.js +39 -0
  25. package/src/agent/tools.js +911 -0
  26. package/src/agent/usage.js +125 -0
  27. package/src/agent/watchers.js +312 -0
  28. package/src/agent/watext.js +75 -0
  29. package/src/agent/whatsapp.js +494 -0
  30. package/src/cron.js +245 -0
  31. package/src/main.js +3622 -0
  32. package/src/preload.js +122 -0
  33. package/src/renderer/browserPreload.js +73 -0
  34. package/src/renderer/i18n.js +757 -0
  35. package/src/renderer/index.html +227 -0
  36. package/src/renderer/renderer.js +3250 -0
  37. package/src/renderer/style.css +1559 -0
  38. package/tests/approval.test.js +56 -0
  39. package/tests/bg-jobs.test.js +315 -0
  40. package/tests/bus.test.js +46 -0
  41. package/tests/computeruse-context.test.js +69 -0
  42. package/tests/cron.test.js +95 -0
  43. package/tests/engine.test.js +140 -0
  44. package/tests/eval.test.js +91 -0
  45. package/tests/fallout.test.js +188 -0
  46. package/tests/llm.test.js +56 -0
  47. package/tests/memory.test.js +33 -0
  48. package/tests/memoryloop.test.js +26 -0
  49. package/tests/notegen.test.js +63 -0
  50. package/tests/owner.test.js +32 -0
  51. package/tests/python.test.js +75 -0
  52. package/tests/scenarios.json +81 -0
  53. package/tests/sessioncode.test.js +50 -0
  54. package/tests/setup.js +9 -0
  55. package/tests/tokens.test.js +42 -0
  56. package/tests/tools.test.js +84 -0
  57. package/tests/usage.test.js +44 -0
  58. package/tests/v11.test.js +76 -0
  59. package/tests/watchers.test.js +206 -0
  60. package/tests/watext.test.js +53 -0
  61. package/tests/whatsapp.test.js +103 -0
  62. package/tests/wherewasi.test.js +40 -0
package/.env.example ADDED
@@ -0,0 +1,7 @@
1
+ # Beast Agent API anahtarları örneği.
2
+ # Kullanım: bu dosyayı %APPDATA%\beast\.env olarak kopyala ve anahtarlarını gir.
3
+ # Bu dosya config.yaml'daki key_env alanlarıyla eşleşir;
4
+ # key_env yoksa <PROVIDER_ID>_API_KEY denenir (örn. zhipu -> ZHIPU_API_KEY).
5
+
6
+ ZHIPU_API_KEY=
7
+ OPENAI_API_KEY=
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 algokodcom (AlgoKod)
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,94 @@
1
+ # Beast Agent
2
+
3
+ > **fast, light and resourceful** — a local agent shell for Windows. It chats, runs commands, writes files, searches the web, and is fully controllable from WhatsApp.
4
+
5
+ ![platform](https://img.shields.io/badge/platform-Windows-blue) ![license](https://img.shields.io/badge/license-MIT-green) ![electron](https://img.shields.io/badge/electron-40-47848F)
6
+
7
+ **Website:** [beast.algokod.com](https://beast.algokod.com) · **AlgoKod:** [algokod.com](https://algokod.com)
8
+
9
+ Beast Agent is a personal AI agent that runs on your machine and connects to **any OpenAI-compatible provider**. Define all your models in a single `config.yaml`; Beast handles the rest.
10
+
11
+ ## ✨ Features
12
+
13
+ - **Multi-provider** — unlimited models from config.yaml; instant switching in the picker, role-based models (vision / terminal / coding / subagent)
14
+ - **FALLOUT chain** ⚛ — if a model fails, Beast automatically moves to the next provider and resumes where it left off
15
+ - **CEO mode** — the talking agent does no work itself; it delegates orders to parallel agents with a live monitoring panel
16
+ - **WhatsApp integration** — pair via QR; DMs + groups (@mention), voice notes auto-transcribed by local Whisper, replies can be sent as voice notes too
17
+ - **Slash commands** — `/new`, `/open`, `/change`, `/think`, `/rule`, `/allow`, `/block`, `/backup`, `/approve` and more
18
+ - **Event center** — IMAP IDLE email watching, file-change watching, price feed (Binance), webhook inputs
19
+ - **Cron + watchers** — scheduled tasks, file/web/battery watchers
20
+ - **Web search chain** — TinyFish (free, used first if a key is set) → built-in browser (direct Google) → python multi-engine (DDG/Bing/Mojeek) → Exa
21
+ - **Approval gate** — optional confirmation for risky actions (commands / file deletion-modification): default OFF (everything free), when ON the agent asks (`/approve`, `/approve always`, `/deny`)
22
+ - **Provider-based limits** — per-provider max input token limit with context compression
23
+ - **Encrypted backups** — all data is AES-256 encrypted and signed with your machine's unique **Beast Code**
24
+ - **Dashboard** — session history, message statistics, cost tracking
25
+ - **Full TR/EN interface** — everything switches language instantly
26
+ - **/health** — `http://127.0.0.1:8788/health` liveness endpoint from the moment the app boots
27
+
28
+ ## 📦 Download
29
+
30
+ ### Installer (recommended)
31
+ Grab `BeastAgent-Setup-x.x.x.exe` from the [Releases](../../releases) page. After install, Beast starts automatically with Windows (lives in the tray).
32
+
33
+ ### npm
34
+ ```bash
35
+ npm install -g beast-agent
36
+ ```
37
+ Then run `beast-agent` from any terminal. On first launch Beast creates a desktop shortcut and registers itself for auto-start.
38
+
39
+ ### From source
40
+ ```bash
41
+ git clone https://github.com/algokodcom/beast-agent.git
42
+ cd beast-agent
43
+ npm install
44
+ npm start
45
+ ```
46
+
47
+ > Requirements: Node.js 18+, Windows 10/11. Python and ffmpeg are optional — Beast installs missing tooling itself.
48
+
49
+ ## ⚙️ Configuration
50
+
51
+ 1. Copy `config.example.yaml` → `config.yaml` and add your providers:
52
+ ```yaml
53
+ defaultSelection: openrouter::anthropic/claude-3.5-sonnet
54
+ providers:
55
+ - id: openrouter
56
+ name: OpenRouter
57
+ baseUrl: https://openrouter.ai/api/v1
58
+ apiKey: sk-or-...
59
+ models:
60
+ - anthropic/claude-3.5-sonnet
61
+ - gpt-4o
62
+ ```
63
+ 2. You can also provide API keys via `.env`: copy `.env.example` → `.env`
64
+ 3. On first launch, Settings → Provider pulls your models automatically.
65
+
66
+ All app data lives under `%APPDATA%\beast` (sessions, memory, WhatsApp pairing, encrypted settings).
67
+
68
+ ## 🗣️ Usage
69
+
70
+ | Where | What it does |
71
+ |---|---|
72
+ | Chat | Give it a task — it works on its own with tools (files, commands, web, python, browser) |
73
+ | WhatsApp | Add your number to the allow list, control the agent from your phone |
74
+ | Tray | Closing the window doesn't kill it — Beast keeps living in the tray |
75
+
76
+ Type `/help` in the chat to see every command.
77
+
78
+ ## 🔒 Security & Privacy
79
+
80
+ - Everything runs **locally**: sessions, memory and logs stay on your disk
81
+ - API keys are never sent to the renderer in plaintext — masking is applied
82
+ - Backups are AES-256 encrypted + signed with the Beast Code — only your machine can restore them
83
+ - The approval gate is **off by default**; enable it from the Security tab if you want
84
+
85
+ ## 🧪 Development
86
+
87
+ ```bash
88
+ npm test # engine + tool tests (node --test)
89
+ npm run dist # NSIS + portable build
90
+ ```
91
+
92
+ ## 📄 License
93
+
94
+ [MIT](LICENSE) © 2026 algokodcom (AlgoKod)
package/assets/app.ico ADDED
Binary file
Binary file
@@ -0,0 +1,23 @@
1
+ #!/usr/bin/env node
2
+ 'use strict';
3
+
4
+ /* Beast Agent global npm başlatıcısı:
5
+ `beast-agent` komutu uygulamayı detached başlatır ve terminali hemen serbest bırakır. */
6
+
7
+ const { spawn } = require('child_process');
8
+ const path = require('path');
9
+
10
+ const electron = require('electron');
11
+ if (typeof electron !== 'string') {
12
+ /* electron runtime içindeyiz — bu script için anlamsız */
13
+ process.exit(1);
14
+ }
15
+
16
+ const appPath = path.resolve(__dirname, '..');
17
+ const child = spawn(electron, [appPath, ...process.argv.slice(2)], {
18
+ stdio: 'ignore',
19
+ detached: true,
20
+ windowsHide: true,
21
+ });
22
+ child.unref();
23
+ process.exit(0);
@@ -0,0 +1,26 @@
1
+ # Beast Agent sağlayıcı yapılandırması örneği.
2
+ # Kullanım: bu dosyayı %APPDATA%\beast\config.yaml olarak kopyala ve düzenle.
3
+ # (Taşınabilir kullanım için BEAST_DATA ortam değişkeni ile başka klasöre alabilirsin.)
4
+
5
+ providers:
6
+ zhipu:
7
+ name: Zhipu AI
8
+ base_url: https://api.z.ai/api/paas/v4
9
+ key_env: ZHIPU_API_KEY
10
+ models:
11
+ glm-4.6: {}
12
+ glm-4.5-air: {}
13
+
14
+ openai:
15
+ name: OpenAI
16
+ base_url: https://api.openai.com/v1
17
+ key_env: OPENAI_API_KEY
18
+ models:
19
+ gpt-4o-mini: {}
20
+ gpt-4o: {}
21
+
22
+ model:
23
+ provider: zhipu # varsayılan provider id (yoksa ilk provider kullanılır)
24
+ default: glm-4.6 # varsayılan model
25
+ # base_url: ... # istersen aktif provider'ın URL'ini override et
26
+ # key_env: ... # istersen anahtarı farklı env'den oku
Binary file
package/package.json ADDED
@@ -0,0 +1,101 @@
1
+ {
2
+ "name": "beast-agent",
3
+ "productName": "Beast Agent",
4
+ "version": "0.15.0",
5
+ "description": "Ultra-fast local agent shell for Windows.",
6
+ "author": "algokodcom (AlgoKod)",
7
+ "license": "MIT",
8
+ "homepage": "https://github.com/algokodcom/beast-agent#readme",
9
+ "repository": {
10
+ "type": "git",
11
+ "url": "git+https://github.com/algokodcom/beast-agent.git"
12
+ },
13
+ "bugs": {
14
+ "url": "https://github.com/algokodcom/beast-agent/issues"
15
+ },
16
+ "keywords": [
17
+ "agent",
18
+ "ai",
19
+ "whatsapp",
20
+ "assistant",
21
+ "electron",
22
+ "windows",
23
+ "llm",
24
+ "openai"
25
+ ],
26
+ "main": "src/main.js",
27
+ "bin": {
28
+ "beast-agent": "bin/beast-agent.js"
29
+ },
30
+ "scripts": {
31
+ "start": "electron .",
32
+ "dist": "electron-builder --win nsis portable",
33
+ "test": "node --test \"tests/**/*.test.js\"",
34
+ "prepublishOnly": "node scripts/swap-electron.js deps",
35
+ "postpublish": "node scripts/swap-electron.js devdeps"
36
+ },
37
+ "devDependencies": {
38
+ "electron-builder": "^26.15.3"
39
+ },
40
+ "dependencies": {
41
+ "@pdf-lib/fontkit": "^1.1.1",
42
+ "@whiskeysockets/baileys": "^7.0.0-rc14",
43
+ "@xenova/transformers": "^2.17.2",
44
+ "electron-updater": "^6.8.9",
45
+ "ffmpeg-static": "^5.3.0",
46
+ "imapflow": "^1.7.6",
47
+ "nodemailer": "^9.0.5",
48
+ "pdf-lib": "^1.17.1",
49
+ "pdf-parse": "^2.4.5",
50
+ "pdf-to-img": "^6.3.0",
51
+ "pdfjs-dist": "^5.6.205",
52
+ "pdfkit": "^0.20.1",
53
+ "qrcode": "^1.5.4",
54
+ "tesseract.js": "^7.0.0",
55
+ "ws": "^8.21.3",
56
+ "electron": "40.10.2"
57
+ },
58
+ "build": {
59
+ "appId": "com.quantumalgo.beastagent",
60
+ "productName": "Beast Agent",
61
+ "directories": {
62
+ "output": "dist"
63
+ },
64
+ "publish": [
65
+ {
66
+ "provider": "github",
67
+ "owner": "algokodcom",
68
+ "repo": "beast-agent"
69
+ }
70
+ ],
71
+ "files": [
72
+ "src/**/*",
73
+ "assets/**/*",
74
+ "!tests/**"
75
+ ],
76
+ "win": {
77
+ "target": [
78
+ "nsis",
79
+ "portable"
80
+ ],
81
+ "icon": "assets/app.ico"
82
+ },
83
+ "nsis": {
84
+ "oneClick": true,
85
+ "perMachine": false,
86
+ "createDesktopShortcut": "always",
87
+ "runAfterFinish": true,
88
+ "artifactName": "BeastAgent-Setup-${version}.exe"
89
+ },
90
+ "portable": {
91
+ "artifactName": "BeastAgent.exe"
92
+ },
93
+ "asarUnpack": [
94
+ "node_modules/ffmpeg-static/**",
95
+ "node_modules/@xenova/transformers/**",
96
+ "**/node_modules/@napi-rs/canvas/**",
97
+ "**/node_modules/tesseract.js/**",
98
+ "**/node_modules/tesseract.js-core/**"
99
+ ]
100
+ }
101
+ }
@@ -0,0 +1,40 @@
1
+ 'use strict';
2
+
3
+ /* electron yer değiştirici:
4
+ - `deps` : electron'u devDependencies → dependencies taşır (npm publish öncesi;
5
+ global kurulumda electron runtime'ı inmesi için)
6
+ - `devdeps`: geri taşır (electron-builder yalnız devDependencies kabul eder;
7
+ repo normal durumu budur)
8
+ npm lifecycle: prepublishOnly → deps, postpublish → devdeps */
9
+
10
+ const fs = require('fs');
11
+ const path = require('path');
12
+
13
+ const mode = process.argv[2];
14
+ const pkgPath = path.join(__dirname, '..', 'package.json');
15
+ const pkg = JSON.parse(fs.readFileSync(pkgPath, 'utf8'));
16
+ const VER = pkg.devDependencies && pkg.devDependencies.electron
17
+ ? pkg.devDependencies.electron
18
+ : (pkg.dependencies && pkg.dependencies.electron);
19
+
20
+ if (!VER) {
21
+ console.error('electron sürümü package.json içinde bulunamadı');
22
+ process.exit(1);
23
+ }
24
+
25
+ if (mode === 'deps') {
26
+ delete pkg.devDependencies.electron;
27
+ pkg.dependencies = pkg.dependencies || {};
28
+ pkg.dependencies.electron = VER;
29
+ console.log('electron → dependencies (' + VER + ')');
30
+ } else if (mode === 'devdeps') {
31
+ delete pkg.dependencies.electron;
32
+ pkg.devDependencies = pkg.devDependencies || {};
33
+ pkg.devDependencies.electron = VER;
34
+ console.log('electron → devDependencies (' + VER + ')');
35
+ } else {
36
+ console.error('kullanım: node scripts/swap-electron.js deps|devdeps');
37
+ process.exit(1);
38
+ }
39
+
40
+ fs.writeFileSync(pkgPath, JSON.stringify(pkg, null, 4) + '\n');