Files
cursor2api/docker-compose.yml
小海 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

68 lines
2.8 KiB
YAML
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
services:
cursor2api:
build:
context: .
dockerfile: Dockerfile
image: cursor2api:latest
container_name: cursor2api
restart: unless-stopped
ports:
- "3010:3010"
volumes:
# 挂载配置文件(可选)——先从 config.yaml.example 复制一份: cp config.yaml.example config.yaml
# 修改后只需 docker compose restart 即可生效;不挂载则使用内置默认值 + 环境变量
- ./config.yaml:/app/config.yaml:ro
# 日志持久化目录(需要在 config.yaml 或环境变量中开启 logging.file_enabled
- ./logs:/app/logs
environment:
- NODE_ENV=production
- PORT=3010
- TIMEOUT=120
# ⚠️ 部署到海外机器无需代理,如果在国内云,取消注释并填入你的本机 http/socks 代理
# - PROXY=http://host.docker.internal:7890
# [可选环境变量] 以下变量如果声明,将会覆盖 config.yaml 中对应的配置:
# - CURSOR_MODEL=anthropic/claude-sonnet-4.6
# ── API 鉴权 ──
# 公网部署时强烈建议开启,多个 token 用逗号分隔
# - AUTH_TOKEN=sk-your-secret-token-1,sk-your-secret-token-2
# ── Thinking 开关(最高优先级,覆盖 config.yaml ──
# true=始终启用思考链, false=强制关闭
# - THINKING_ENABLED=true
# ── 历史消息压缩 ──
# - COMPRESSION_ENABLED=false
# - COMPRESSION_LEVEL=1
# ── 自动续写 & 历史消息限制 ──
# - MAX_AUTO_CONTINUE=0 # 截断后自动续写次数0=禁用(默认)
# - MAX_HISTORY_MESSAGES=-1 # 历史消息条数上限,-1=不限制
# ── 日志持久化 ──
# - LOG_FILE_ENABLED=true
# - LOG_DIR=./logs
# ── 浏览器指纹base64 JSON ──
# - FP=eyJ1c2VyQWdlbnQiOiIuLi4ifQ==
# ── Vision 图片处理 ──
# 默认使用本地 OCR零配置如需外部 Vision API 请在 config.yaml 中修改 vision.mode 为 'api'
# 并配置 vision.base_url / vision.api_key / vision.model
# ── 工具透传模式(推荐 Roo Code / Cline 等非 Claude Code 客户端) ──
# 开启后跳过 few-shot 注入,直接嵌入工具定义,减少身份冲突
# - TOOLS_PASSTHROUGH=true
# ── 工具禁用模式(极致省上下文) ──
# 完全不注入工具定义和 few-shot模型凭训练记忆调用工具
# - TOOLS_DISABLED=true
# ── 响应内容清洗 ──
# 开启后会将响应中 Cursor 身份引用替换为 Claude默认关闭
# - SANITIZE_RESPONSE=true
# ── 自定义拒绝检测规则 ──
# 仅支持 config.yaml 配置(无环境变量覆盖),详见 config.yaml.example 中的 refusal_patterns 节