Add HeXi bot codebase: custom plugins, web frontends, tests

- hexi core: message handling, rate limiting, cooldown, plugin manager
- Custom plugins: BF stats, daily check-in, quotes, persona cards, etc.
- Community plugins vendored under hexi/plugins with local fixes
- Web admin frontends (learning-chat, persona-admin), unified hexi/web
- Tests for rate_limit/cooldown/memes/persona; poetry.lock

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
2026-09-01 13:13:40 +08:00
co-authored by Claude
parent 1783c60afa
commit b61d09f09f
3201 changed files with 160436 additions and 171 deletions
@@ -0,0 +1,30 @@
from dataclasses import dataclass
import psutil
from . import normal_collector, periodic_collector
@dataclass
class MemoryStat:
percent: float
used: int
total: int
async def get_memory_stat() -> MemoryStat:
mem = psutil.virtual_memory()
return MemoryStat(percent=mem.percent, used=mem.used, total=mem.total)
normal_collector("memory_stat")(get_memory_stat)
periodic_collector("memory_stat_periodic")(get_memory_stat)
async def get_swap_stat() -> MemoryStat:
swap = psutil.swap_memory()
return MemoryStat(percent=swap.percent, used=swap.used, total=swap.total)
normal_collector("swap_stat")(get_swap_stat)
periodic_collector("swap_stat_periodic")(get_swap_stat)