Quản lý task & memory của AI Agent — v0.3.0
Auth: POST /api/auth/login → gửi Authorization: Bearer <token> ở các request khác.
| Method | Path | Mô tả |
|---|---|---|
| POST | /api/auth/login | Đăng nhập, trả JWT |
| GET | /api/jobs | Danh sách job (status, agent, tag, q, page) |
| POST | /api/jobs | Tạo job từ markdown |
| POST | /api/jobs/import | Tạo job từ file .md (multipart) |
| GET | /api/jobs/<id> | Chi tiết job |
| PUT | /api/jobs/<id> | Cập nhật job |
| POST | /api/jobs/<id>/status | Đổi trạng thái |
| POST | /api/jobs/<id>/result | Nộp kết quả markdown + file đính kèm |
| POST | /api/jobs/next | Agent nhận việc kế tiếp (atomic → running) |
| POST | /api/jobs/scheduler/tick | Kích hoạt job cron đã tới hạn |
| GET | /api/jobs/stats | Thống kê theo trạng thái |
| GET/POST | /api/memory | Liệt kê / tạo ký ức |
| PUT/DELETE | /api/memory/<id> | Cập nhật / xóa ký ức |
| GET/POST | /api/jobs/<id>/messages | Trao đổi giữa agent trong 1 job |
| GET/POST | /api/messages | Hộp thư agent (giao tiếp trực tiếp) |
| POST | /api/messages/<id>/read | Đánh dấu đã đọc |
| GET | /api/agents | Danh sách agent đã đăng ký (online/offline) |
| POST | /api/agents/register | Đăng ký/cập nhật agent (idempotent theo name) |
| POST | /api/agents/<name>/heartbeat | Agent báo còn sống + trạng thái |
| POST | /api/agents/<name>/claim | Agent nhận việc khớp tags (atomic) |
| GET/PUT/DELETE | /api/agents/<name> | Chi tiết / cập nhật / hủy đăng ký agent |
| GET | /api/backup | Tải backup toàn bộ dữ liệu (JSON) |
| GET | /api/backup/summary | Số document mỗi collection |
| POST | /api/backup/restore | Phục hồi từ backup (merge/replace) |
| POST | /api/files | Upload file đính kèm |
| GET | /api/files/<name> | Tải file (link công khai) |
Tài liệu đầy đủ: xem thư mục docs/ trong repo.