huangzhenting
717af46606
feat: Vue UI 增强 — 统计/筛选联动、自动跟随、交互优化
...
- 新增 getVueStats(since?)/apiGetVueStats/GET /api/vue/stats,供 Vue UI 专用
SQLite 模式走数据库全量聚合+since过滤,getStats() 保持原样不影响 HTML 版本
- Vue UI 所有 /api/stats 调用改为 /api/vue/stats
- SSE stats 事件改为调 statsStore.load() 从 /api/vue/stats 拉最新数据
- 时间筛选增加 1小时/6小时选项,状态筛选改为 emoji 图标风格
- 状态筛选选中态:全部用蓝紫渐变底色,图标按钮用对应颜色边框+文字
- AppHeader/RequestList 缩写处全面补充 title tooltip
- 新增「自动跟随」功能:选中记录后可开启,SSE 推送新请求时自动切换并滚动到顶部
- 修复 ConfigDrawer draft 可能为 null 的 TS 错误
- 修复 CSS typo:.rfmt.responses background 颜色值多余空格
- upsertRequest 改用 Object.assign 避免 SSE 推送时替换对象引用打断 hover
2026-03-23 17:35:13 +08:00
小海
2933df2697
fix: improve truncation recovery and diagnostics for v2.7.7
...
- mark degraded requests in logs and viewer when execution quality drops
- record Anthropic toolCallsDetected correctly in summaries
- continue semantically incomplete long Write/Edit tool payloads
- restore truncated OpenAI stream long Write tool_calls
- update release docs, sample config, docker notes, and README guidance
2026-03-23 11:39:00 +08:00
huangzhenting
a84dfd6d03
feat: 实现 db_enabled/db_path 热重载支持,修复文档格式
...
- logger-db.ts: 新增 closeDb(),修复 initDb() 支持安全重复调用
- logger.ts: 注册 onConfigReload 回调,db_enabled/db_path 变更后无需重启
- config.yaml.example: 删除「需重启」警告注释,补充热重载说明
- README.md: 修复环境变量表格被 blockquote 截断的格式问题,更新热重载说明
- vue-ui/README.md: 删除「需重启服务」错误说明
- ConfigDrawer.vue: 删除「需重启」提示
2026-03-23 08:45:21 +08:00
huangzhenting
1bc91cac24
feat: 新增 SQLite 持久化支持 + Vue UI 后端过滤与分页优化
...
- 新增 src/logger-db.ts:SQLite 封装层(WAL 模式,支持写入/分页/状态计数/按需 payload 查询)
- logger.ts:双写 SQLite+JSONL,启动时 db_enabled 模式跳过 JSONL 读取避免 OOM,新增游标分页和后端过滤函数
- config.ts/config-api.ts:新增 db_enabled/db_path 配置字段及 LOG_DB_ENABLED/LOG_DB_PATH 环境变量
- log-viewer.ts/index.ts:新增 /api/requests/more 支持 status/keyword/since 后端过滤
- Vue UI:搜索框 400ms 防抖,状态/时间筛选立即触发后端查询,statusCounts 不受状态筛选影响,SSE 实时推送时增量更新计数
- 新增迁移工具 test/migrate-jsonl-to-sqlite.mjs 和单元测试 test/unit-logger-db.mjs
- 完善 README.md、config.yaml.example、docker-compose.yml、vue-ui/README.md 文档
2026-03-22 21:10:26 +08:00
huangzhenting
a153dad4de
feat: record and display real Cursor API token usage
...
Capture the actual input/output token counts from Cursor API's finish
event (messageMetadata.usage) and use them in place of tiktoken
estimates where available. Fall back to tiktoken if not present.
- src/types.ts: extend CursorSSEEvent with finishReason/messageMetadata
- src/handler.ts: capture finish event usage in streaming paths, pass
real counts to updateSummary with tiktoken fallback
- src/logger.ts: add inputTokens/outputTokens fields to RequestSummary
- vue-ui: show ↑/↓ Cursor tokens in RequestList, DetailPanel, PayloadView
- public/logs.js: show ↑/↓ Cursor tokens in scard and prompts summary
2026-03-21 18:42:12 +08:00
majorcheng
310fd8672d
fix: complete OpenAI logs and default persisted logs to summary
2026-03-20 14:06:46 +08:00
小海
db5d3fb1f7
feat: show tools mode (disabled/passthrough) in startup and request logs
...
- Startup log: Tools: disabled / passthrough / schema=full
- Request log: tools=98(跳过) / tools=98(透传) / tools=98
2026-03-20 09:26:23 +08:00
小海
8a5117bbb1
v2.7.4: 截断安全 + 代理续写禁用 + 日志提示词对比视图
...
- 截断时跳过工具解析,防止损坏的工具调用(写入半截文件)
- maxAutoContinue 默认 0,交由 Claude Code 原生续写
- 系统提示词身份声明清除(防 prompt injection 拒绝)
- 流式热身窗口 96→300 chars(拒绝检测前不释放文本)
- 日志查看器「提示词对比」视图:原始 vs Cursor 转换后
- 转换摘要面板:工具数/消息数/上下文大小一目了然
- 标题提取增强:通用 XML 标签清除 + 更多引导语过滤
2026-03-18 11:56:26 +08:00
小海
a0af1c8934
feat: 可配置工具处理 + 修复 URL 图片兼容性
...
tools 配置:
- schema_mode: compact/full/names_only 三种 Schema 呈现模式
- description_max_length: 工具描述截断长度 (0=不截断)
- include_only/exclude: 工具白名单/黑名单过滤
- 启动 banner 显示 tools 配置摘要
- 日志记录完整工具描述(不再截断200字符)
图片 URL 修复:
- 归一化 Anthropic API source.url → source.data
- 支持 image/input_image 等多种客户端格式
- 图片下载添加 User-Agent 头(解决 Telegram 403)
- 增强日志:记录每张图片下载过程和结果
2026-03-17 10:13:09 +08:00
小海
d388fefa21
feat(log-viewer): 日夜主题切换 + 标题提取修复
...
- 新增日/夜主题切换按钮(☀️ /🌙 ),支持 localStorage 持久化,首次自动检测系统偏好
- 完整暗色主题 CSS 变量覆盖,所有 UI 元素适配
- 修复标题提取:过滤 <system-reminder> 注入内容和 Claude Code 引导语
- 日志页面前端重构为独立 HTML/CSS/JS 静态文件
- 登录页面样式同步更新为现代玻璃态主题
- Express 静态文件服务配置修复(兼容 v5 path-to-regexp)
2026-03-17 09:33:00 +08:00
小海
84c26aa332
feat: 全链路日志系统 — Web UI + 详细请求/响应追踪
...
- 新增 logger.ts: 全链路日志记录器,支持完整请求/响应 payload 存储
- 新增 log-viewer.ts: Web UI 日志查看器 (/logs),SSE 实时推送
- UI 支持四个标签页: 日志、请求参数、提示词、响应内容
- 存储完整消息内容 (100K/条上限),支持展开/折叠查看
- 阶段耗时可视化 (receive → convert → send → response → stream)
- 修复 Cursor 消息格式 parts vs content 导致的 500 错误
- handler/openai-handler 集成全链路日志记录
- 控制台仅打印核心简短日志
2026-03-16 15:22:31 +08:00