init project
This commit is contained in:
57
AGENTS.md
Normal file
57
AGENTS.md
Normal file
@@ -0,0 +1,57 @@
|
||||
# PROJECT M - OpenClaw Matrix Bot
|
||||
|
||||
> AI Agent 專用文檔,描述項目結構和開發指南
|
||||
|
||||
## 項目概述
|
||||
|
||||
| 屬性 | 內容 |
|
||||
|------|------|
|
||||
| 代號 | PROJECT M |
|
||||
| 類型 | Matrix Bot |
|
||||
| 核心功能 | 自動登錄、Token 同步、邀請響應、問候發送 |
|
||||
|
||||
## 目錄結構
|
||||
|
||||
```
|
||||
openclaw-matrix-uplife-bot/
|
||||
├── src/ # 源代碼
|
||||
│ ├── main.py # 主入口
|
||||
│ ├── config.py # 配置管理
|
||||
│ └── services/
|
||||
│ ├── matrix_service.py # Matrix 服務
|
||||
│ └── token_manager.py # Token 管理器
|
||||
├── tests/ # 單元測試
|
||||
├── references/ # 參考代碼(只讀)
|
||||
│ └── matrix-bot-chat-reference/
|
||||
├── docker-compose.yml # Docker 配置
|
||||
└── README.md
|
||||
```
|
||||
|
||||
## 關鍵配置
|
||||
|
||||
- **Token JSON Key**: `channels.matrix.accessToken`
|
||||
- **OpenClaw 路徑**: `~/.openclaw/openclaw.json`
|
||||
|
||||
## 開發命令
|
||||
|
||||
```bash
|
||||
# 啟動
|
||||
docker compose up -d
|
||||
|
||||
# 停止
|
||||
docker compose down
|
||||
|
||||
# 測試
|
||||
pytest tests/ -v
|
||||
```
|
||||
|
||||
## 安全協議
|
||||
|
||||
1. 更新 Token 前**必須**備份
|
||||
2. 使用沙箱測試
|
||||
3. 密碼僅通過環境變量傳入
|
||||
|
||||
## 參考資料
|
||||
|
||||
- `references/matrix-bot-chat-reference/` - 舊版 Matrix Bot 代碼
|
||||
- [matrix-nio 文檔](https://matrix-nio.readthedocs.io/)
|
||||
Reference in New Issue
Block a user