2026-02-07 17:07:54 +00:00

118 lines
2.9 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# AGENTS.md - Apprise Notify Center
This folder is home. Treat it that way.
## First Run
If `BOOTSTRAP.md` exists, that's your birth certificate. Follow it, figure out who you are, then delete it. You won't need it again.
## Every Session
Before doing anything else:
1. Read `SOUL.md` — this is who you are
2. Read `USER.md` — this is who you're helping
3. Read `docs/plans/*.md` for project context
4. **If in MAIN SESSION**: Also read `MEMORY.md`
Don't ask permission. Just do it.
## Project Context
### 项目目标
构建一个基于 apprise 的多通道通知中心,提供:
- HTTP API 发送通知 (POST/GET)
- Web 管理界面配置通道
- SQLite 存储配置和历史
- 支持 80+ 种通知服务
### 技术栈
- **后端**: Python + FastAPI
- **数据库**: SQLite + SQLAlchemy
- **前端**: Vue3 + TailwindCSS
- **通知引擎**: apprise
### 数据模型
**channels 表** - 通知通道配置
```sql
id: INTEGER PRIMARY KEY
name: TEXT NOT NULL -- 通道名称,如 "告警群"
type: TEXT NOT NULL -- apprise 协议,如 "discord", "telegram"
config: JSON -- 配置参数URL、token 等)
tags: JSON DEFAULT [] -- 标签,如 ["alerts", "production"]
is_active: BOOLEAN DEFAULT 1
created_at: TIMESTAMP
updated_at: TIMESTAMP
```
**notifications 表** - 发送历史
```sql
id: INTEGER PRIMARY KEY
channel_id: INTEGER FOREIGN KEY
title: TEXT
body: TEXT -- 消息内容
priority: TEXT -- low/normal/high/urgent
status: TEXT -- pending/sent/failed
error_msg: TEXT -- 失败原因
sent_at: TIMESTAMP
created_at: TIMESTAMP
```
**templates 表** (可选)
```sql
id: INTEGER PRIMARY KEY
name: TEXT
title_template: TEXT
body_template: TEXT
variables: JSON
```
### 核心功能
1. **通道管理**: 增删改查通知通道,支持标签分类
2. **发送通知**: POST /api/notify 支持批量发送到多个通道或按标签发送
3. **历史记录**: 查看发送历史和统计
4. **手动发送**: Web 界面手动触发通知
### 目录结构
```
.
├── AGENTS.md
├── README.md
├── docs/
│ └── plans/
│ └── 2026-02-07-design.md
├── backend/
│ ├── main.py
│ ├── models.py
│ ├── schemas.py
│ └── routers/
├── frontend/
│ └── index.html
└── tests/
```
## Memory
- **Daily notes:** `memory/YYYY-MM-DD.md` — raw logs of what happened
- **Long-term:** `MEMORY.md` — curated memories
## Safety
- Don't exfiltrate private data
- Don't run destructive commands without asking
- `trash` > `rm`
- When in doubt, ask
## External vs Internal
**Safe to do freely:**
- Read files, explore, organize, learn
- Search the web, check calendars
- Work within this workspace
**Ask first:**
- Sending emails, tweets, public posts
- Anything that leaves the machine
- Anything uncertain