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,46 @@
1
+ ---
2
+ name: Email Summary
3
+ description: Create professional email summaries and daily digests
4
+ triggers: email summary, email digest, mail zusammenfassung, mails zusammenfassen, email übersicht, inbox summary, email report
5
+ priority: 5
6
+ category: productivity
7
+ ---
8
+
9
+ # Email Summary Skill
10
+
11
+ When creating email summaries or daily digests:
12
+
13
+ ## Workflow
14
+ 1. **Fetch emails** using available tools (osascript for Apple Mail, himalaya for IMAP)
15
+ 2. **Summarize YOURSELF** — you ARE the AI, do NOT call external LLM APIs
16
+ 3. **Structure** the output clearly (by account, by priority, by topic)
17
+ 4. **Deliver** in the requested format (text, PDF, or both)
18
+
19
+ ## Summary Guidelines
20
+ - **1-2 sentences per email** — capture the core message, skip fluff
21
+ - **Language:** Match the user's preferred language
22
+ - **Prioritize:** Flag urgent/action-required emails prominently
23
+ - **Group by:** Account → Read status (unread first) → Time
24
+
25
+ ## Apple Mail Access (macOS)
26
+ ```bash
27
+ osascript -e '
28
+ tell application "Mail"
29
+ set output to ""
30
+ repeat with acct in accounts
31
+ set acctName to name of acct
32
+ repeat with mb in mailboxes of acct
33
+ if name of mb is "INBOX" then
34
+ set msgs to (messages of mb whose date received > (current date) - 1 * days)
35
+ repeat with m in msgs
36
+ set output to output & acctName & " | " & sender of m & " | " & subject of m & " | " & (date received of m as string) & " | " & (read status of m as string) & linefeed
37
+ end repeat
38
+ end if
39
+ end repeat
40
+ end repeat
41
+ return output
42
+ end tell'
43
+ ```
44
+
45
+ ## PDF Generation
46
+ If a PDF is requested, create an HTML file and convert it. Use a clean, professional design.
@@ -0,0 +1,42 @@
1
+ ---
2
+ name: GitHub
3
+ description: Manage GitHub issues, PRs, and repos via gh CLI
4
+ triggers: github, gh, issue, pull request, pr, repository, repo, merge, branch
5
+ priority: 6
6
+ category: development
7
+ ---
8
+
9
+ # GitHub via gh CLI
10
+
11
+ Use the GitHub CLI (`gh`) for all GitHub operations.
12
+
13
+ ## Issues
14
+ ```bash
15
+ gh issue list
16
+ gh issue create --title "Title" --body "Body"
17
+ gh issue view 123
18
+ gh issue close 123
19
+ ```
20
+
21
+ ## Pull Requests
22
+ ```bash
23
+ gh pr list
24
+ gh pr create --title "Title" --body "Body"
25
+ gh pr view 123
26
+ gh pr merge 123
27
+ gh pr checks 123
28
+ ```
29
+
30
+ ## Repository
31
+ ```bash
32
+ gh repo view
33
+ gh repo clone owner/repo
34
+ gh release list
35
+ gh release create v1.0.0
36
+ ```
37
+
38
+ ## Search
39
+ ```bash
40
+ gh search issues "query" --repo owner/repo
41
+ gh search prs "query"
42
+ ```
@@ -0,0 +1,28 @@
1
+ ---
2
+ name: Summarize
3
+ description: Summarize URLs, documents, PDFs, and long text
4
+ triggers: summarize, zusammenfassen, summary, zusammenfassung, tldr, tl;dr, digest
5
+ priority: 7
6
+ category: research
7
+ ---
8
+
9
+ # Summarization Workflow
10
+
11
+ ## URL Summarization
12
+ 1. Fetch content: `curl -sL URL | head -c 50000`
13
+ 2. Summarize the text directly (YOU are the LLM — no external API needed)
14
+ 3. Present: Key points, main arguments, conclusion
15
+
16
+ ## PDF Summarization
17
+ 1. Extract text: `pdftotext file.pdf -` or `python3 -c "..."`
18
+ 2. Summarize directly
19
+ 3. If too long: chunk into sections, summarize each, then meta-summarize
20
+
21
+ ## Long Text
22
+ 1. If under 10,000 chars: summarize directly
23
+ 2. If over 10,000 chars: split into logical sections, summarize each, combine
24
+
25
+ ## Output Format
26
+ - **One-line summary** (1 sentence)
27
+ - **Key Points** (3-5 bullets)
28
+ - **Details** (if requested, 2-3 paragraphs)
@@ -0,0 +1,39 @@
1
+ ---
2
+ name: System Administration
3
+ description: Server management, deployment, monitoring
4
+ triggers: server, deploy, deployment, pm2, nginx, ssh, vps, docker, systemctl, service, logs, monitor, disk space, cpu, memory usage
5
+ priority: 3
6
+ category: devops
7
+ ---
8
+
9
+ # System Administration Skill
10
+
11
+ When managing servers and deployments:
12
+
13
+ ## Health Check Pattern
14
+ ```bash
15
+ # System overview
16
+ uptime && free -h && df -h / && top -bn1 | head -5
17
+
18
+ # PM2 processes
19
+ pm2 list && pm2 logs --lines 10 --nostream
20
+
21
+ # Nginx
22
+ nginx -t && systemctl status nginx
23
+
24
+ # Docker
25
+ docker ps && docker stats --no-stream
26
+ ```
27
+
28
+ ## Deployment Checklist
29
+ 1. **Build** locally first — never deploy broken code
30
+ 2. **Backup** config files before changing them
31
+ 3. **Test** after deploy — check logs, hit endpoints
32
+ 4. **Rollback plan** — know how to undo your changes
33
+
34
+ ## Guidelines
35
+ - **Always check before changing** — read config files before editing
36
+ - **Backup first** — `cp file file.bak-$(date +%Y%m%d-%H%M%S)`
37
+ - **PM2 env vars** — use `ecosystem.config.cjs` + `--update-env`, never raw `pm2 start`
38
+ - **Logs first** — when debugging, always check logs before guessing
39
+ - **One change at a time** — don't change 5 things and wonder which broke it
@@ -0,0 +1,34 @@
1
+ ---
2
+ name: Weather
3
+ description: Get weather forecasts and conditions
4
+ triggers: weather, wetter, forecast, vorhersage, temperature, temperatur, rain, regen, wind
5
+ priority: 4
6
+ category: utility
7
+ ---
8
+
9
+ # Weather
10
+
11
+ ## Quick Weather
12
+ ```bash
13
+ curl -s "wttr.in/Berlin?format=%l:+%c+%t+%w+%h"
14
+ ```
15
+
16
+ ## Detailed Forecast
17
+ ```bash
18
+ curl -s "wttr.in/Berlin?lang=de"
19
+ ```
20
+
21
+ ## Specific Location
22
+ ```bash
23
+ curl -s "wttr.in/LOCATION?format=3"
24
+ ```
25
+
26
+ ## Machine-Readable
27
+ ```bash
28
+ curl -s "wttr.in/Berlin?format=j1" | python3 -c "import sys,json; d=json.load(sys.stdin); print(json.dumps(d['current_condition'][0], indent=2))"
29
+ ```
30
+
31
+ ## Notes
32
+ - Default city: Berlin (unless user specifies another)
33
+ - Language detection: use `?lang=de` for German users
34
+ - For multi-day: use `wttr.in/CITY?3` for 3-day forecast
@@ -0,0 +1,35 @@
1
+ ---
2
+ name: Web Research
3
+ description: Deep web research with source aggregation and summarization
4
+ triggers: research, recherche, find information, look up, search for, herausfinden, web search, deep dive
5
+ priority: 3
6
+ category: research
7
+ ---
8
+
9
+ # Web Research Skill
10
+
11
+ When conducting web research:
12
+
13
+ ## Workflow
14
+ 1. **Search** — use curl/web_fetch to search and fetch relevant pages
15
+ 2. **Read & extract** — parse the content, extract key information
16
+ 3. **Synthesize YOURSELF** — combine findings into a coherent summary
17
+ 4. **Cite sources** — always include URLs for claims
18
+
19
+ ## Search Pattern
20
+ ```bash
21
+ # Google via web scraping
22
+ curl -sL "https://www.google.com/search?q=QUERY&hl=en" | python3 -c "
23
+ import sys, re
24
+ html = sys.stdin.read()
25
+ for m in re.finditer(r'<a href=\"/url\?q=(https?://[^&\"]+)', html):
26
+ print(m.group(1))
27
+ " | head -5
28
+ ```
29
+
30
+ ## Guidelines
31
+ - **Multiple sources** — never rely on a single source
32
+ - **Recency** — prefer recent results for time-sensitive topics
33
+ - **Summarize** — don't dump raw page content, distill the key findings
34
+ - **Structure** — organize by subtopic or relevance
35
+ - **Bias check** — note if sources are promotional or one-sided
@@ -0,0 +1,52 @@
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="UTF-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
+ <title>Alvin Bot — Canvas</title>
7
+ <style>
8
+ * { margin: 0; padding: 0; box-sizing: border-box; }
9
+ body { font-family: -apple-system, BlinkMacSystemFont, sans-serif; background: #0a0a0a; color: #e0e0e0; height: 100vh; display: flex; flex-direction: column; }
10
+ #toolbar { background: #1a1a1a; padding: 8px 16px; display: flex; gap: 12px; align-items: center; border-bottom: 1px solid #333; }
11
+ #toolbar .status { font-size: 12px; color: #888; margin-left: auto; }
12
+ #toolbar .status.connected { color: #4ade80; }
13
+ #canvas-container { flex: 1; position: relative; overflow: auto; }
14
+ #render-frame { width: 100%; height: 100%; border: none; background: white; }
15
+ .empty-state { display: flex; align-items: center; justify-content: center; height: 100%; color: #555; font-size: 18px; }
16
+ </style>
17
+ </head>
18
+ <body>
19
+ <div id="toolbar">
20
+ <strong>Canvas</strong>
21
+ <span class="status" id="status">Disconnected</span>
22
+ </div>
23
+ <div id="canvas-container">
24
+ <div class="empty-state" id="empty">Waiting for content from Alvin Bot...</div>
25
+ <iframe id="render-frame" style="display:none" sandbox="allow-scripts allow-same-origin"></iframe>
26
+ </div>
27
+ <script>
28
+ const ws = new WebSocket(`ws://${location.host}/canvas/ws`);
29
+ const status = document.getElementById("status");
30
+ const empty = document.getElementById("empty");
31
+ const frame = document.getElementById("render-frame");
32
+
33
+ ws.onopen = () => { status.textContent = "Connected"; status.className = "status connected"; };
34
+ ws.onclose = () => { status.textContent = "Disconnected"; status.className = "status"; };
35
+
36
+ ws.onmessage = (event) => {
37
+ const msg = JSON.parse(event.data);
38
+ if (msg.type === "present") {
39
+ empty.style.display = "none";
40
+ frame.style.display = "block";
41
+ frame.srcdoc = msg.html;
42
+ } else if (msg.type === "eval") {
43
+ try { frame.contentWindow.eval(msg.js); } catch (e) { console.error("Canvas eval error:", e); }
44
+ } else if (msg.type === "clear") {
45
+ frame.style.display = "none";
46
+ empty.style.display = "flex";
47
+ frame.srcdoc = "";
48
+ }
49
+ };
50
+ </script>
51
+ </body>
52
+ </html>