alvin-bot 4.4.1

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 (136) hide show
  1. package/.env.example +43 -0
  2. package/BACKLOG.md +223 -0
  3. package/CHANGELOG.md +63 -0
  4. package/CLAUDE.example.md +152 -0
  5. package/CODE_OF_CONDUCT.md +52 -0
  6. package/CONTRIBUTING.md +72 -0
  7. package/LICENSE +21 -0
  8. package/README.md +529 -0
  9. package/SECURITY.md +38 -0
  10. package/SOUL.example.md +60 -0
  11. package/TOOLS.example.md +42 -0
  12. package/alvin-bot.config.example.json +24 -0
  13. package/bin/cli.js +1088 -0
  14. package/dist/.metadata_never_index +0 -0
  15. package/dist/claude.js +102 -0
  16. package/dist/config.js +65 -0
  17. package/dist/engine.js +90 -0
  18. package/dist/find-claude-binary.js +98 -0
  19. package/dist/handlers/commands.js +1489 -0
  20. package/dist/handlers/document.js +187 -0
  21. package/dist/handlers/message.js +200 -0
  22. package/dist/handlers/photo.js +154 -0
  23. package/dist/handlers/platform-message.js +275 -0
  24. package/dist/handlers/video.js +237 -0
  25. package/dist/handlers/voice.js +148 -0
  26. package/dist/i18n.js +299 -0
  27. package/dist/index.js +442 -0
  28. package/dist/init-data-dir.js +81 -0
  29. package/dist/middleware/auth.js +215 -0
  30. package/dist/migrate.js +139 -0
  31. package/dist/paths.js +87 -0
  32. package/dist/platforms/discord.js +161 -0
  33. package/dist/platforms/index.js +130 -0
  34. package/dist/platforms/signal.js +205 -0
  35. package/dist/platforms/slack.js +318 -0
  36. package/dist/platforms/telegram.js +111 -0
  37. package/dist/platforms/types.js +8 -0
  38. package/dist/platforms/whatsapp.js +648 -0
  39. package/dist/providers/claude-sdk-provider.js +173 -0
  40. package/dist/providers/codex-cli-provider.js +121 -0
  41. package/dist/providers/index.js +7 -0
  42. package/dist/providers/openai-compatible.js +388 -0
  43. package/dist/providers/registry.js +209 -0
  44. package/dist/providers/tool-executor.js +450 -0
  45. package/dist/providers/types.js +205 -0
  46. package/dist/services/access.js +144 -0
  47. package/dist/services/asset-index.js +230 -0
  48. package/dist/services/browser-manager.js +161 -0
  49. package/dist/services/browser.js +121 -0
  50. package/dist/services/compaction.js +129 -0
  51. package/dist/services/cron.js +462 -0
  52. package/dist/services/custom-tools.js +317 -0
  53. package/dist/services/delivery-queue.js +154 -0
  54. package/dist/services/elevenlabs.js +58 -0
  55. package/dist/services/embeddings.js +386 -0
  56. package/dist/services/exec-guard.js +46 -0
  57. package/dist/services/fallback-order.js +151 -0
  58. package/dist/services/heartbeat.js +192 -0
  59. package/dist/services/hooks.js +44 -0
  60. package/dist/services/imagegen.js +72 -0
  61. package/dist/services/language-detect.js +144 -0
  62. package/dist/services/markdown.js +63 -0
  63. package/dist/services/mcp.js +252 -0
  64. package/dist/services/memory.js +133 -0
  65. package/dist/services/personality.js +227 -0
  66. package/dist/services/plugins.js +171 -0
  67. package/dist/services/reminders.js +97 -0
  68. package/dist/services/restart.js +48 -0
  69. package/dist/services/security-audit.js +66 -0
  70. package/dist/services/self-search.js +129 -0
  71. package/dist/services/session.js +93 -0
  72. package/dist/services/skills.js +287 -0
  73. package/dist/services/standing-orders.js +29 -0
  74. package/dist/services/subagents.js +142 -0
  75. package/dist/services/sudo.js +243 -0
  76. package/dist/services/telegram.js +113 -0
  77. package/dist/services/tool-discovery.js +214 -0
  78. package/dist/services/usage-tracker.js +137 -0
  79. package/dist/services/users.js +199 -0
  80. package/dist/services/voice.js +95 -0
  81. package/dist/tui/index.js +507 -0
  82. package/dist/web/canvas.js +30 -0
  83. package/dist/web/doctor-api.js +606 -0
  84. package/dist/web/openai-compat.js +252 -0
  85. package/dist/web/server.js +1351 -0
  86. package/dist/web/setup-api.js +1078 -0
  87. package/docs/mcp.example.json +16 -0
  88. package/docs/screenshots/00-Login.png +0 -0
  89. package/docs/screenshots/01-Chat-Dark-Conversation.png +0 -0
  90. package/docs/screenshots/02-Chat.png +0 -0
  91. package/docs/screenshots/03-Dashboard-Overview.png +0 -0
  92. package/docs/screenshots/04-AI-Models-and-Providers.png +0 -0
  93. package/docs/screenshots/05-Personality-Editor.png +0 -0
  94. package/docs/screenshots/06-Memory-Manager.png +0 -0
  95. package/docs/screenshots/07-Active-Sessions.png +0 -0
  96. package/docs/screenshots/08-File-Browser.png +0 -0
  97. package/docs/screenshots/09-Scheduled-Jobs.png +0 -0
  98. package/docs/screenshots/10-Custom-Tools.png +0 -0
  99. package/docs/screenshots/11-Plugins-and-MCP.png +0 -0
  100. package/docs/screenshots/12-Messaging-Platforms.png +0 -0
  101. package/docs/screenshots/12.1-Messaging-Platforms-WhatsApp-Groups-List.png +0 -0
  102. package/docs/screenshots/12.2-Messaging-Platforms-WA-Group-Details.png +0 -0
  103. package/docs/screenshots/13-User-Management.png +0 -0
  104. package/docs/screenshots/14-Web-Terminal.png +0 -0
  105. package/docs/screenshots/15-Maintenance-and-Health.png +0 -0
  106. package/docs/screenshots/16-Settings-and-Env.png +0 -0
  107. package/docs/screenshots/TG-commands.png +0 -0
  108. package/docs/screenshots/TG.png +0 -0
  109. package/docs/screenshots/_Mac-Installer.png +0 -0
  110. package/docs/tools.example.json +33 -0
  111. package/install.sh +165 -0
  112. package/package.json +190 -0
  113. package/plugins/calendar/index.js +270 -0
  114. package/plugins/email/index.js +231 -0
  115. package/plugins/finance/index.js +254 -0
  116. package/plugins/notes/index.js +227 -0
  117. package/plugins/smarthome/index.js +230 -0
  118. package/plugins/weather/index.js +122 -0
  119. package/skills/apple-notes/SKILL.md +31 -0
  120. package/skills/browse/SKILL.md +136 -0
  121. package/skills/code-project/SKILL.md +43 -0
  122. package/skills/data-analysis/SKILL.md +39 -0
  123. package/skills/document-creation/SKILL.md +48 -0
  124. package/skills/email-summary/SKILL.md +46 -0
  125. package/skills/github/SKILL.md +42 -0
  126. package/skills/summarize/SKILL.md +28 -0
  127. package/skills/system-admin/SKILL.md +39 -0
  128. package/skills/weather/SKILL.md +34 -0
  129. package/skills/web-research/SKILL.md +35 -0
  130. package/web/public/canvas.html +52 -0
  131. package/web/public/css/style.css +555 -0
  132. package/web/public/index.html +189 -0
  133. package/web/public/js/app.js +3102 -0
  134. package/web/public/js/i18n.js +1048 -0
  135. package/web/public/js/icons.js +104 -0
  136. package/web/public/login.html +48 -0
@@ -0,0 +1,16 @@
1
+ {
2
+ "servers": {
3
+ "filesystem": {
4
+ "command": "npx",
5
+ "args": ["-y", "@modelcontextprotocol/server-filesystem", "/tmp"],
6
+ "env": {}
7
+ },
8
+ "brave-search": {
9
+ "command": "npx",
10
+ "args": ["-y", "@modelcontextprotocol/server-brave-search"],
11
+ "env": {
12
+ "BRAVE_API_KEY": "your-key-here"
13
+ }
14
+ }
15
+ }
16
+ }
Binary file
Binary file
Binary file
Binary file
@@ -0,0 +1,33 @@
1
+ {
2
+ "tools": [
3
+ {
4
+ "name": "server_health",
5
+ "description": "Check server health",
6
+ "type": "http",
7
+ "url": "https://api.example.com/health",
8
+ "method": "GET"
9
+ },
10
+ {
11
+ "name": "deploy",
12
+ "description": "Deploy the application",
13
+ "command": "ssh server 'cd /app && git pull && pm2 restart all'",
14
+ "timeout": 60000
15
+ },
16
+ {
17
+ "name": "quick_note",
18
+ "description": "Append a note to a file",
19
+ "command": "echo '{{text}}' >> ~/notes.txt",
20
+ "parameters": {
21
+ "text": {
22
+ "type": "string",
23
+ "description": "Note text to append"
24
+ }
25
+ }
26
+ },
27
+ {
28
+ "name": "disk_usage",
29
+ "description": "Check disk usage",
30
+ "command": "df -h / | tail -1"
31
+ }
32
+ ]
33
+ }
package/install.sh ADDED
@@ -0,0 +1,165 @@
1
+ #!/usr/bin/env bash
2
+ # ─────────────────────────────────────────────────────────────
3
+ # Alvin Bot — One-Line Installer
4
+ # Usage: curl -fsSL https://install.alvin-bot.dev | bash
5
+ # ─────────────────────────────────────────────────────────────
6
+ set -euo pipefail
7
+
8
+ # Colors
9
+ RED='\033[0;31m'
10
+ GREEN='\033[0;32m'
11
+ YELLOW='\033[1;33m'
12
+ BLUE='\033[0;34m'
13
+ BOLD='\033[1m'
14
+ NC='\033[0m' # No Color
15
+
16
+ INSTALL_DIR="$HOME/.alvin-bot"
17
+ REPO_URL="https://github.com/alvbln/alvin-bot.git"
18
+ BIN_LINK="/usr/local/bin/alvin-bot"
19
+ MIN_NODE_VERSION=18
20
+
21
+ # ─── Helpers ────────────────────────────────────────────────
22
+
23
+ info() { echo -e "${BLUE}ℹ${NC} $*"; }
24
+ ok() { echo -e "${GREEN}✔${NC} $*"; }
25
+ warn() { echo -e "${YELLOW}⚠${NC} $*"; }
26
+ fail() { echo -e "${RED}✘${NC} $*"; exit 1; }
27
+
28
+ # ─── OS Detection ──────────────────────────────────────────
29
+
30
+ detect_os() {
31
+ case "$(uname -s)" in
32
+ Darwin*) OS="macOS" ;;
33
+ Linux*)
34
+ if grep -qi microsoft /proc/version 2>/dev/null; then
35
+ OS="WSL"
36
+ else
37
+ OS="Linux"
38
+ fi
39
+ ;;
40
+ *) fail "Unsupported OS: $(uname -s). Use macOS, Linux, or WSL." ;;
41
+ esac
42
+ ok "Detected OS: ${BOLD}$OS${NC}"
43
+ }
44
+
45
+ # ─── Dependency Checks ─────────────────────────────────────
46
+
47
+ check_git() {
48
+ if ! command -v git &>/dev/null; then
49
+ fail "Git is not installed. Please install git first:
50
+ macOS: xcode-select --install
51
+ Linux: sudo apt install git (or yum/pacman equivalent)
52
+ WSL: sudo apt install git"
53
+ fi
54
+ ok "Git found: $(git --version)"
55
+ }
56
+
57
+ check_node() {
58
+ if ! command -v node &>/dev/null; then
59
+ fail "Node.js is not installed (>= $MIN_NODE_VERSION required).
60
+ Install via: https://nodejs.org or
61
+ macOS: brew install node@22
62
+ Linux: curl -fsSL https://deb.nodesource.com/setup_22.x | sudo -E bash - && sudo apt install -y nodejs"
63
+ fi
64
+
65
+ local node_ver
66
+ node_ver=$(node -v | sed 's/^v//' | cut -d. -f1)
67
+ if [ "$node_ver" -lt "$MIN_NODE_VERSION" ]; then
68
+ fail "Node.js >= $MIN_NODE_VERSION required, but found v$(node -v). Please upgrade."
69
+ fi
70
+ ok "Node.js found: $(node -v)"
71
+ }
72
+
73
+ check_npm() {
74
+ if ! command -v npm &>/dev/null; then
75
+ fail "npm is not installed. It should come with Node.js — please reinstall Node."
76
+ fi
77
+ ok "npm found: $(npm -v)"
78
+ }
79
+
80
+ # ─── Installation ──────────────────────────────────────────
81
+
82
+ install_bot() {
83
+ if [ -d "$INSTALL_DIR" ]; then
84
+ warn "Existing installation found at $INSTALL_DIR"
85
+ info "Updating..."
86
+ cd "$INSTALL_DIR"
87
+ git pull --ff-only || fail "Git pull failed. Resolve conflicts manually in $INSTALL_DIR"
88
+ else
89
+ info "Cloning alvin-bot to $INSTALL_DIR..."
90
+ git clone --depth 1 "$REPO_URL" "$INSTALL_DIR" || fail "Git clone failed. Check your network."
91
+ cd "$INSTALL_DIR"
92
+ fi
93
+
94
+ info "Installing production dependencies..."
95
+ npm install --omit=dev || fail "npm install failed."
96
+
97
+ info "Building TypeScript..."
98
+ npm run build || fail "Build failed."
99
+
100
+ ok "Installation complete!"
101
+ }
102
+
103
+ create_symlink() {
104
+ local bin_dir
105
+ bin_dir=$(dirname "$BIN_LINK")
106
+
107
+ # Make CLI executable
108
+ chmod +x "$INSTALL_DIR/bin/cli.js"
109
+
110
+ # Try /usr/local/bin first, fall back to ~/.local/bin
111
+ if [ -w "$bin_dir" ] || [ -w "$BIN_LINK" ] 2>/dev/null; then
112
+ ln -sf "$INSTALL_DIR/bin/cli.js" "$BIN_LINK"
113
+ ok "Symlinked: alvin-bot → $BIN_LINK"
114
+ elif command -v sudo &>/dev/null; then
115
+ info "Creating symlink (requires sudo)..."
116
+ sudo ln -sf "$INSTALL_DIR/bin/cli.js" "$BIN_LINK"
117
+ ok "Symlinked: alvin-bot → $BIN_LINK"
118
+ else
119
+ # Fallback: ~/.local/bin
120
+ local fallback="$HOME/.local/bin"
121
+ mkdir -p "$fallback"
122
+ ln -sf "$INSTALL_DIR/bin/cli.js" "$fallback/alvin-bot"
123
+ warn "Symlinked to $fallback/alvin-bot (add to PATH if not already)"
124
+ warn " export PATH=\"$fallback:\$PATH\""
125
+ BIN_LINK="$fallback/alvin-bot"
126
+ fi
127
+ }
128
+
129
+ # ─── Main ──────────────────────────────────────────────────
130
+
131
+ main() {
132
+ echo ""
133
+ echo -e "${BOLD}🦊 Alvin Bot Installer${NC}"
134
+ echo -e "─────────────────────────────────────"
135
+ echo ""
136
+
137
+ detect_os
138
+ check_git
139
+ check_node
140
+ check_npm
141
+
142
+ echo ""
143
+ install_bot
144
+ create_symlink
145
+
146
+ echo ""
147
+ echo -e "─────────────────────────────────────"
148
+ echo -e "${GREEN}${BOLD}🎉 Alvin Bot installed successfully!${NC}"
149
+ echo ""
150
+ echo -e " Next steps:"
151
+ echo -e " ${BOLD}alvin-bot setup${NC} — Configure your bot (interactive)"
152
+ echo -e " ${BOLD}alvin-bot start${NC} — Start the bot"
153
+ echo -e " ${BOLD}alvin-bot --help${NC} — Show all commands"
154
+ echo ""
155
+ echo -e " Installed to: ${BLUE}$INSTALL_DIR${NC}"
156
+ echo -e " Command: ${BLUE}$BIN_LINK${NC}"
157
+ echo ""
158
+
159
+ # Run interactive setup
160
+ info "Starting setup wizard..."
161
+ echo ""
162
+ alvin-bot setup || warn "Setup skipped. Run 'alvin-bot setup' later to configure."
163
+ }
164
+
165
+ main "$@"
package/package.json ADDED
@@ -0,0 +1,190 @@
1
+ {
2
+ "name": "alvin-bot",
3
+ "version": "4.4.1",
4
+ "description": "Alvin Bot — Your personal AI agent on Telegram, WhatsApp, Discord, Signal, and Web.",
5
+ "type": "module",
6
+ "main": "dist/index.js",
7
+ "bin": {
8
+ "alvin-bot": "bin/cli.js"
9
+ },
10
+ "scripts": {
11
+ "dev": "tsx src/index.ts",
12
+ "build": "tsc",
13
+ "start": "node dist/index.js",
14
+ "setup": "node bin/cli.js setup",
15
+ "electron:compile": "tsc -p electron/tsconfig.json",
16
+ "electron:dev": "npm run electron:compile && electron .",
17
+ "electron:build": "npm run build && npm run electron:compile && electron-builder --publish never",
18
+ "electron:pack": "npm run build && npm run electron:compile && electron-builder --dir --publish never",
19
+ "electron:build:full": "bash scripts/electron-build.sh"
20
+ },
21
+ "build": {
22
+ "appId": "com.alvinbot.app",
23
+ "productName": "Alvin Bot",
24
+ "directories": {
25
+ "output": "release"
26
+ },
27
+ "extraResources": [
28
+ {
29
+ "from": "dist",
30
+ "to": "app/dist"
31
+ },
32
+ {
33
+ "from": "web",
34
+ "to": "app/web"
35
+ },
36
+ {
37
+ "from": "docs",
38
+ "to": "app/docs"
39
+ },
40
+ {
41
+ "from": "plugins",
42
+ "to": "app/plugins"
43
+ },
44
+ {
45
+ "from": "skills",
46
+ "to": "app/skills"
47
+ },
48
+ {
49
+ "from": ".prod-node-modules",
50
+ "to": "app/node_modules"
51
+ },
52
+ {
53
+ "from": "build",
54
+ "to": "build"
55
+ },
56
+ {
57
+ "from": "package.json",
58
+ "to": "app/package.json"
59
+ }
60
+ ],
61
+ "mac": {
62
+ "target": [
63
+ {
64
+ "target": "dmg",
65
+ "arch": [
66
+ "arm64"
67
+ ]
68
+ }
69
+ ],
70
+ "icon": "build/icon.png",
71
+ "category": "public.app-category.utilities"
72
+ },
73
+ "win": {
74
+ "target": "nsis",
75
+ "icon": "build/icon.ico"
76
+ },
77
+ "nsis": {
78
+ "oneClick": false,
79
+ "allowToChangeInstallationDirectory": true
80
+ },
81
+ "linux": {
82
+ "target": [
83
+ "AppImage",
84
+ "deb"
85
+ ],
86
+ "icon": "build/icon.png",
87
+ "category": "Utility"
88
+ },
89
+ "publish": {
90
+ "provider": "github",
91
+ "owner": "alvbln",
92
+ "repo": "alvin-bot"
93
+ },
94
+ "asar": false,
95
+ "files": [
96
+ "electron/dist/**/*",
97
+ "dist/**/*",
98
+ "web/**/*",
99
+ "plugins/**/*",
100
+ "skills/**/*",
101
+ "docs/*.md",
102
+ "docs/prompts/**/*",
103
+ "!docs/memory/**",
104
+ "!docs/MEMORY.md",
105
+ "!docs/users/**",
106
+ "!docs/whatsapp-groups.json",
107
+ "!docs/cron-jobs.json",
108
+ "bin/**/*",
109
+ "package.json",
110
+ "SOUL.md",
111
+ "alvin-bot.config.example.json",
112
+ ".env.example",
113
+ "CHANGELOG.md",
114
+ "README.md",
115
+ "LICENSE",
116
+ "!src",
117
+ "!data",
118
+ "!backups",
119
+ "!.wwebjs_cache",
120
+ "!.git",
121
+ "!.github",
122
+ "!scripts",
123
+ "!release",
124
+ "!.prod-node-modules",
125
+ "!.electron-prod",
126
+ "!CLAUDE.md",
127
+ "!telegram-agent-setup-prompt.md",
128
+ "!**/*.log",
129
+ "!**/*.bak"
130
+ ],
131
+ "afterPack": "./electron/afterPack.cjs"
132
+ },
133
+ "keywords": [
134
+ "telegram",
135
+ "bot",
136
+ "ai",
137
+ "claude",
138
+ "agent",
139
+ "llm",
140
+ "multi-model",
141
+ "gpt",
142
+ "gemini",
143
+ "nvidia",
144
+ "self-hosted",
145
+ "autonomous",
146
+ "whatsapp",
147
+ "discord",
148
+ "signal",
149
+ "openai",
150
+ "groq",
151
+ "chatbot",
152
+ "assistant",
153
+ "electron"
154
+ ],
155
+ "author": "alvbln",
156
+ "license": "MIT",
157
+ "repository": {
158
+ "type": "git",
159
+ "url": "git+https://github.com/alvbln/Alvin-Bot.git"
160
+ },
161
+ "dependencies": {
162
+ "@anthropic-ai/claude-agent-sdk": "^0.2.92",
163
+ "@hapi/boom": "^10.0.1",
164
+ "@slack/bolt": "^4.6.0",
165
+ "@types/node": "^22.0.0",
166
+ "@types/ws": "^8.18.1",
167
+ "@whiskeysockets/baileys": "^6.7.21",
168
+ "dotenv": "^16.4.0",
169
+ "electron-updater": "^6.8.3",
170
+ "grammy": "^1.30.0",
171
+ "node-edge-tts": "^1.2.10",
172
+ "pino": "^10.3.1",
173
+ "playwright": "^1.58.2",
174
+ "typescript": "^5.9.3",
175
+ "whatsapp-web.js": "^1.34.6",
176
+ "ws": "^8.19.0"
177
+ },
178
+ "devDependencies": {
179
+ "electron": "^35.7.5",
180
+ "electron-builder": "^26.8.1",
181
+ "tsx": "^4.19.0"
182
+ },
183
+ "homepage": "https://github.com/alvbln/Alvin-Bot",
184
+ "engines": {
185
+ "node": ">=18.0.0"
186
+ },
187
+ "bugs": {
188
+ "url": "https://github.com/alvbln/alvin-bot/issues"
189
+ }
190
+ }