feat(/me): recent 块 —— 一次拿全「我最近调用/消耗/主要 slot」 (1.0.29)
同事反馈:希望 `/api/v1/me` 直接带自己最近的调用/消耗数据,不再需要二次
调 `/api/v1/usage` + `/api/v1/upstreams`。
**1.0.29**:在 `/api/v1/me` 顶层加 `recent` 块,数据从 audit meta.jsonl 实时
聚合——**不依赖 stats 落盘周期**,log 阶段落盘即聚合,零延迟。
`recent` 字段:
- `calls_24h` / `calls_7d`:24h / 7 天总调用数(含被拒 401/404,**与 shm 日桶
只统计成功转发不同**——审计全量)
- `tin_24h` / `tout_24h` / `tin_7d` / `tout_7d`:token 数
- `hour_24h`:24 长度的数组,索引 = 小时(按本地时区切分),值 = 该小时调用数
- `by_slot`:\[\{slot, calls_24h, calls_7d, tin_7d, tout_7d, last_status\}\]
按 calls_7d 降序
- `last_at` / `last_slot`:最近一次调用的时间 / 哪个 slot
**实现要点**:
- `plugin_llm::llm_audit::user_recent(username, days)` 新增聚合 helper,复用
已有 `read_day` 路径(不重新发明读 meta.jsonl 的轮子)
- gateway::decorate_me 装配根调它,往 `/api/v1/me` view 里塞 `recent` 字段
—— 插件依赖方向依然 `plugin → core`,gateway 反向装配,不破坏插件边界
- 失败兜底:audit 无数据 / 权限 → 返回空统计(不阻塞 /me)
回归 238/0 全绿(§10 账号态端点新增 6 条 me.recent 断言)。