Files
cursor2api/package.json
小海 48de59cba7 feat: v2.7.0 — API鉴权 + Thinking支持 + 动态预算 + response_format + Vision独立代理 + 拒绝模式更新
 新功能:
- API Token 鉴权 (auth_tokens): 公网部署安全,Bearer token / x-api-key 双模式
- Thinking 支持 (客户端驱动): Anthropic thinking block + OpenAI reasoning_content
- response_format 支持: json_object / json_schema + markdown 自动剥离
- Vision 独立代理 (vision.proxy): 图片API走代理,Cursor API保持直连

🔧 优化:
- 已知工具跳过描述 (WELL_KNOWN_TOOLS): 减少 ~30% 工具指令输入
- 动态工具结果预算 (getToolResultBudget): 替代固定 15K 限制
- isTruncated 重写: 消除反引号误判导致的无限重试
- 计费头清除: 清除 x-anthropic-billing-header 防注入警告

🛡️ 防御:
- 新增 4 个 Cursor 拒绝措辞匹配模式
2026-03-16 09:44:15 +08:00

34 lines
1.0 KiB
JSON

{
"name": "cursor2api",
"version": "2.7.0",
"description": "Proxy Cursor docs AI to Anthropic Messages API for Claude Code",
"type": "module",
"scripts": {
"dev": "tsx watch src/index.ts",
"build": "tsc",
"start": "node dist/index.js",
"test:unit": "node test/unit-tolerant-parse.mjs",
"test:tool-fixer": "node test/unit-tool-fixer.mjs",
"test:openai-compat": "node test/unit-openai-compat.mjs",
"test:all": "node test/unit-tolerant-parse.mjs && node test/unit-tool-fixer.mjs && node test/unit-openai-compat.mjs && node test/unit-proxy-agent.mjs",
"test:e2e": "node test/e2e-chat.mjs",
"test:agentic": "node test/e2e-agentic.mjs"
},
"dependencies": {
"dotenv": "^16.5.0",
"eventsource-parser": "^3.0.1",
"express": "^5.1.0",
"tesseract.js": "^7.0.0",
"undici": "^7.22.0",
"uuid": "^11.1.0",
"yaml": "^2.7.1"
},
"devDependencies": {
"@types/express": "^5.0.2",
"@types/node": "^22.15.0",
"@types/uuid": "^10.0.0",
"tsx": "^4.19.0",
"typescript": "^5.8.0"
}
}