BaskDuan
0f8b3246ed
feat: 内置 stealth-proxy 到 Docker 镜像,一个容器搞定 Vercel Bot Protection
...
- Dockerfile 从 alpine 切换到 slim (Debian) 以支持 Playwright Chromium
- 新增 start.sh 入口脚本,ENABLE_STEALTH=true 时自动启动内置 stealth-proxy
- docker-compose.yml 简化为单容器方案,默认启用 stealth 模式
- 新增 cookie/stealth_proxy/system_prompt 配置项及环境变量支持
- deploy-all.sh 加入 .gitignore(含敏感服务器信息)
- 更新默认指纹为 macOS Chrome 146
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com >
2026-04-02 15:44:32 +08:00
小海
0716b602ac
feat: v2.7.8 - 新增三大防截断机制
...
- 上下文压力膨胀(context_pressure):虚增 input_tokens 让客户端提前触发自动压缩
- 自适应历史预算(tools.adaptive_budget):工具数量越多,自动预留越多输出空间
- 工具结果智能截断(tools.smart_truncation):按工具类型差异化截断(Read/Bash/Search)
- 三个功能均默认关闭,支持 config.yaml 和环境变量控制
- 更新 config.yaml.example、docker-compose.yml、README 更新日志
2026-03-27 11:48:37 +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
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
c4b81f33d1
fix: improve token budget accuracy and add TokenDiff logging
...
- converter: replace rough overhead formula (tools*70+350) with actual
estimateTokens on built few-shot messages + Cursor hidden overhead
(1300 base + perTool by schema_mode); remove 16000 output reservation
- cursor-client: sendCursorRequestFull now returns {text, usage?} to
capture real Cursor inputTokens/outputTokens from messageMetadata
- handler: add estimateCursorReqTokens() and [TokenDiff] log to compare
tiktoken estimate vs actual Cursor usage; fix non-stream retry paths
to update usage from retry result; skip auto-continue when response < 200 chars
- openai-handler: update 4 call sites for new sendCursorRequestFull return type
- config: raise default maxHistoryTokens from 130000 to 150000
- docs/config: remove incorrect 'tiktoken underestimates 10~20%' claim;
update overhead description and reference range to 130000~170000
2026-03-22 02:35:04 +08:00
huangzhenting
b542d554c6
feat: add max_history_tokens to trim context by token budget
...
Introduce js-tiktoken (cl100k_base) based token estimation to replace
the naive chars/3 approach. Add max_history_tokens config option that
trims oldest messages when the estimated token budget is exceeded.
- src/tokenizer.ts: new module wrapping js-tiktoken getEncoding
- src/config.ts/config-api.ts: YAML parse, env var, hot-reload, default 130000
- src/converter.ts: token budget trimming after max_history_messages pass
- src/handler.ts: replace estimateInputTokens with tiktoken-based version
- config.yaml.example/docker-compose.yml/README.md: docs and examples
- vue-ui: ConfigDrawer field, HotConfig type, README table row
2026-03-21 18:41:45 +08:00
huangzhenting
35e2c56855
docs: update vue-ui README with Docker deploy notes, fix config.yaml ro mount
...
Remove :ro from config.yaml volume mount in docker-compose.yml so the
config drawer can write back changes at runtime. Add deployment section
to vue-ui/README.md covering: build-before-docker requirement, config.yaml
read-write mount, first-time setup steps, and config drawer field reference.
2026-03-20 17:54:51 +08:00
小海
4a026b6b98
feat: add tools.disabled mode to skip all tool injection for max context savings
...
- tools.disabled: true completely skips tool definitions + few-shot injection
- Response-side parseToolCalls still works if model outputs action blocks
- Env var: TOOLS_DISABLED=true|false
- Updated config.yaml.example and docker-compose.yml
2026-03-20 09:23:15 +08:00
小海
7c2422ce60
feat: add TOOLS_PASSTHROUGH env var override for Docker support
2026-03-20 09:18:13 +08:00
小海
14aa65349c
feat: v2.7.5 — 常量集中管理 + 自定义拒绝规则 + 响应清洗开关
...
🏗️ 常量集中管理
- 新增 constants.ts,提取 REFUSAL_PATTERNS、IDENTITY_PROBE_PATTERNS、
TOOL_CAPABILITY_PATTERNS、CLAUDE_IDENTITY_RESPONSE、CLAUDE_TOOLS_RESPONSE
- isRefusal() 统一导出,内置 + 自定义规则合并检测
🔧 自定义拒绝检测规则 (config.yaml: refusal_patterns)
- 用户可添加自定义正则匹配规则,追加到内置列表
- 无效正则自动退化为字面量匹配
- 缓存编译 + 热重载支持
🔀 响应内容清洗开关 (config.yaml: sanitize_response)
- 控制 sanitizeResponse() 是否替换 Cursor 身份引用为 Claude
- 默认关闭,关闭时零开销
- 支持环境变量 SANITIZE_RESPONSE 覆盖
2026-03-19 09:44:21 +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
小海
18c90e0720
feat: 续写次数可配置 + 历史消息条数硬限制 ( #61 )
...
采纳社区建议,新增两个配置项:
1. max_auto_continue(默认 3,设 0 禁用)
- 替换了 handler.ts 中 4 处硬编码的 MAX_AUTO_CONTINUE = 3
- 设为 0 时 while 循环直接短路,完全禁用自动续写
- 用户可在对话中自行要求续写,往往更精准
2. max_history_messages(默认 100,-1 不限制)
- 在 converter.ts 消息转换后、压缩步骤前执行裁剪
- 保留 few-shot 示例(工具模式前 2 条),删除最早的非 few-shot 消息
- 防止 800+ 条消息导致请求体积过大、响应变慢
两项配置均支持 config.yaml 和环境变量(MAX_AUTO_CONTINUE / MAX_HISTORY_MESSAGES)
2026-03-18 09:10:08 +08:00
小海
fd9d17a49e
release: v2.7.3 — 统一 thinking 剥离 + 拒绝检测增强 + Docker 部署优化
...
Made-with: Cursor
2026-03-17 14:28:31 +08:00
小海
5526d8859e
chore(docker): 同步 Docker 配置至 v2.3.0
...
- Dockerfile: 新增 COPY config.yaml 使容器内置默认配置
- docker-compose.yml: 启用 config.yaml 挂载,移除已废弃的 SCRIPT_URL/FP 引用,增加 vision/OCR 说明
- .dockerignore: 补充 Docker 自身配置/文档/压缩包到忽略列表
2026-03-06 11:27:47 +08:00
小海
c670fa49f1
feat: 增加基于现代多阶段构建的生产级 Docker 环境配置
...
- 采用最新的 Node.js 22 LTS (Alpine) 作为底座。
- 引入二阶段构建 (Builder/Runner),隔离源码与产物,极致缩小最终镜像体积。
- 采用非 root (cursor UID=1001) 用户权限组执行程序,保证生产环境安全性。
- 提供了配套的 .dockerignore 和 docker-compose.yml 服务编排文件,支持传参 SOCKS 代理等。
2026-03-04 17:17:22 +08:00