Initial: multi-agent XMPP communication system with dashboard
- Platform-based architecture (Windows/Linux/Mac) - Agent instance registry (agents.yaml) - Management dashboard with cross-platform monitoring - xmpp_bot with HTTP bridge + health endpoints - wechat_agent with WeChat-Hermes bridging - Platform services: ProcessGuardian, HealthProbe, APIRouter, ChannelBridge - Deployment: systemd (Linux) + PowerShell (Windows) - Monitoring: SSH+ejabberdctl for cross-platform presence
This commit is contained in:
@@ -0,0 +1,47 @@
|
||||
# Linux 部署步骤(给 mohe 参考)
|
||||
|
||||
## 1. hermes-gateway@.service
|
||||
|
||||
```bash
|
||||
# 复制模板
|
||||
sudo cp /path/to/deploy/linux/hermes-gateway@.service /etc/systemd/system/
|
||||
sudo systemctl daemon-reload
|
||||
|
||||
# 启用默认 gateway(8642端口)
|
||||
sudo systemctl enable --now hermes-gateway@default
|
||||
|
||||
# 验证
|
||||
systemctl status hermes-gateway@default
|
||||
```
|
||||
|
||||
## 2. state.db 清理
|
||||
|
||||
```bash
|
||||
cd ~/.hermes/profiles/main
|
||||
|
||||
# 方案A:CLI 清理(推荐)
|
||||
hermes session prune --older-than 30d
|
||||
|
||||
# 方案B:手动清理
|
||||
sqlite3 state.db "DELETE FROM sessions WHERE time_created < strftime('%s','now','-30 days'); VACUUM;"
|
||||
```
|
||||
|
||||
## 3. Provider key 迁移
|
||||
|
||||
```yaml
|
||||
# config.yaml 中用环境变量替换
|
||||
providers:
|
||||
volcengine:
|
||||
api_key: ${VOLCENGINE_KEY} # 从 .env 读取
|
||||
ocg-new:
|
||||
api_key: ${OCG_NEW_KEY}
|
||||
ocg-old:
|
||||
api_key: ${OCG_OLD_KEY}
|
||||
```
|
||||
|
||||
```bash
|
||||
# .env 文件
|
||||
echo "VOLCENGINE_KEY=xxx" >> ~/.hermes/.env
|
||||
echo "OCG_NEW_KEY=xxx" >> ~/.hermes/.env
|
||||
echo "OCG_OLD_KEY=xxx" >> ~/.hermes/.env
|
||||
```
|
||||
@@ -0,0 +1,19 @@
|
||||
[Unit]
|
||||
Description=Hermes Gateway — %i profile
|
||||
After=network-online.target
|
||||
Wants=network-online.target
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
User=hmo
|
||||
WorkingDirectory=/home/hmo/hermes-agent
|
||||
Environment="PATH=/home/hmo/.local/bin:/usr/local/bin:/usr/bin:/bin"
|
||||
ExecStart=/home/hmo/hermes-agent/.venv/bin/python -m hermes_cli.main -p %i gateway run --replace
|
||||
Restart=always
|
||||
RestartSec=10
|
||||
StandardOutput=journal
|
||||
StandardError=journal
|
||||
SyslogIdentifier=hermes-gateway-%i
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
@@ -0,0 +1,45 @@
|
||||
#!/bin/bash
|
||||
set -euo pipefail
|
||||
# AgentsMeeting — Linux 安装脚本
|
||||
# 以 hmo 用户身份运行
|
||||
|
||||
echo "=== AgentsMeeting Linux Installation ==="
|
||||
|
||||
# 1. Install systemd units
|
||||
echo "[1/4] Installing systemd units..."
|
||||
sudo cp deploy/linux/hermes-gateway@.service /etc/systemd/system/
|
||||
sudo cp deploy/linux/xmpp-bot@.service /etc/systemd/system/
|
||||
sudo systemctl daemon-reload
|
||||
|
||||
# 2. Create bot directories
|
||||
echo "[2/4] Creating bot directories..."
|
||||
for bot in mohe xiaoguo zhiwei; do
|
||||
mkdir -p /home/hmo/bots/${bot}
|
||||
done
|
||||
|
||||
# 3. Copy bot scripts
|
||||
echo "[3/4] Copying bot scripts..."
|
||||
cp src/bots/mohe/bot.py /home/hmo/bots/mohe/
|
||||
cp src/bots/xiaoguo/bot.py /home/hmo/bots/xiaoguo/
|
||||
cp src/bots/zhiwei/bot.py /home/hmo/bots/zhiwei/
|
||||
|
||||
# 4. Enable services
|
||||
echo "[4/4] Enabling services..."
|
||||
for profile in main mohe position-analyst xiaoguo; do
|
||||
if [ -f "/home/hmo/.hermes/profiles/${profile}/config.yaml" ]; then
|
||||
sudo systemctl enable --now hermes-gateway@${profile}
|
||||
echo " hermes-gateway@${profile} enabled"
|
||||
else
|
||||
echo " hermes-gateway@${profile}: SKIP (no config)"
|
||||
fi
|
||||
done
|
||||
|
||||
for bot in mohe xiaoguo zhiwei; do
|
||||
if [ -f "/home/hmo/bots/${bot}/bot.py" ]; then
|
||||
sudo systemctl enable --now xmpp-bot@${bot}
|
||||
echo " xmpp-bot@${bot} enabled"
|
||||
fi
|
||||
done
|
||||
|
||||
echo "=== Done ==="
|
||||
echo "Check: systemctl status hermes-gateway@main xmpp-bot@mohe"
|
||||
@@ -0,0 +1,20 @@
|
||||
[Unit]
|
||||
Description=XMPP Bot — %i
|
||||
After=network-online.target ejabberd.service
|
||||
Wants=network-online.target
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
User=hmo
|
||||
WorkingDirectory=/home/hmo/bots
|
||||
Environment="PYTHONUNBUFFERED=1"
|
||||
Environment="BOT_NAME=%i"
|
||||
ExecStart=/home/hmo/.local/bin/uv run python /home/hmo/bots/%i/bot.py
|
||||
Restart=always
|
||||
RestartSec=15
|
||||
StandardOutput=journal
|
||||
StandardError=journal
|
||||
SyslogIdentifier=xmpp-bot-%i
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
Reference in New Issue
Block a user