@dedenlabs/claude-code-router-cli 2.0.2 → 2.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +34 -11
- package/dist/cli.js +10027 -182
- package/examples/configs/fixed-router-config.json +3 -4
- package/examples/configs/unified-router-example.json +165 -171
- package/package.json +15 -3
package/README.md
CHANGED
|
@@ -2,14 +2,14 @@
|
|
|
2
2
|
|
|
3
3
|
<div align="center">
|
|
4
4
|
|
|
5
|
-
[](https://github.com/dedenlabs/claude-code-router-cli)
|
|
6
6
|
[](LICENSE)
|
|
7
7
|
[](https://nodejs.org/)
|
|
8
8
|
[](https://www.typescriptlang.org/)
|
|
9
9
|
|
|
10
10
|
**基于 [@musistudio/claude-code-router](https://github.com/musistudio/claude-code-router) 的增强版命令行路由工具**
|
|
11
11
|
|
|
12
|
-
[✨ 新功能概览](#-新功能) • [🚀 快速开始](#-快速开始) • [📖 完整文档](./docs/UNIFIED_ROUTER_GUIDE.md) • [🔧 示例配置](./examples/) • [📚 官方教程](https://code.claude.com/docs/en/quickstart)
|
|
12
|
+
[✨ 新功能概览](#-新功能) • [🚀 快速开始](#-快速开始) • [📖 完整文档](./docs/UNIFIED_ROUTER_GUIDE.md) • [📋 路由规则](./docs/UNIFIED_ROUTER_RULES.md) • [🔧 示例配置](./examples/) • [📚 官方教程](https://code.claude.com/docs/en/quickstart)
|
|
13
13
|
|
|
14
14
|
</div>
|
|
15
15
|
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
🚀 ──────────────────────────────────────
|
|
30
30
|
📝 用户请求开始 [2025/12/07 00:35:46] 🎯 目标模型: opus
|
|
31
31
|
🔗 请求ID: b8fdsc4f-ba72-4e2c-967d-2be41577f820
|
|
32
|
-
✨ 规则触发:
|
|
32
|
+
✨ 规则触发: 代号映射规则
|
|
33
33
|
📍 路由决策: opus → opus/glm-4.6
|
|
34
34
|
📝 请求文本: <system-reminder>...
|
|
35
35
|
As you answer the user's questions, you can use the following context:...
|
|
@@ -51,14 +51,14 @@ As you answer the user's questions, you can use the following context:...
|
|
|
51
51
|
🔍 [DEBUG] 条件: 自定义函数: modelContainsComma
|
|
52
52
|
🔍 [DEBUG] 结果: ❌ 不匹配
|
|
53
53
|
🔍 [DEBUG] 评估条件 {"conditionType":"custom","condition":{"type":"custom","customFunction":"directModelMapping"},"requestedModel":"haiku"}
|
|
54
|
-
🔍 [DEBUG] 规则 "
|
|
54
|
+
🔍 [DEBUG] 规则 "代号映射规则" (优先级: 190)
|
|
55
55
|
🔍 [DEBUG] 条件: 自定义函数: directModelMapping
|
|
56
56
|
🔍 [DEBUG] 结果: ✅ 匹配
|
|
57
|
-
🔍 [DEBUG] 🎯 规则 "
|
|
58
|
-
🔍 [DEBUG]
|
|
59
|
-
🔍 [DEBUG]
|
|
57
|
+
🔍 [DEBUG] 🎯 规则 "代号映射规则" 匹配成功,停止后续评估
|
|
58
|
+
🔍 [DEBUG] 尝试代号模型映射 {"modelName":"haiku","providersCount":3}
|
|
59
|
+
🔍 [DEBUG] 未找到代号模型映射,尝试通过 provider 名称匹配 {"modelName":"haiku"}
|
|
60
60
|
🔍 [DEBUG] 🔄 变量替换完成 {"原始路由":"${mappedModel}","最终路由":"haiku,glm-4.5-air"}
|
|
61
|
-
✨ 规则触发:
|
|
61
|
+
✨ 规则触发: 代号映射规则
|
|
62
62
|
📍 路由决策: haiku → haiku/glm-4.5-air
|
|
63
63
|
📝 请求文本:
|
|
64
64
|
Please write a 5-10 word title for the following conversation:...
|
|
@@ -279,7 +279,7 @@ module.exports = { checkUserPreference };
|
|
|
279
279
|
}
|
|
280
280
|
},
|
|
281
281
|
{
|
|
282
|
-
"name": "
|
|
282
|
+
"name": "代号映射规则",
|
|
283
283
|
"priority": 190,
|
|
284
284
|
"enabled": true,
|
|
285
285
|
"condition": {
|
|
@@ -288,7 +288,7 @@ module.exports = { checkUserPreference };
|
|
|
288
288
|
},
|
|
289
289
|
"action": {
|
|
290
290
|
"route": "${mappedModel}",
|
|
291
|
-
"description": "
|
|
291
|
+
"description": "将provider作为代号,映射到对应的model模型"
|
|
292
292
|
}
|
|
293
293
|
},
|
|
294
294
|
{
|
|
@@ -569,6 +569,28 @@ export class MyTransformer extends BaseTransformer {
|
|
|
569
569
|
|
|
570
570
|
## 📈 版本历史
|
|
571
571
|
|
|
572
|
+
### v2.0.3 (2025-12-16)
|
|
573
|
+
|
|
574
|
+
**🔧 核心问题修复**
|
|
575
|
+
|
|
576
|
+
**✅ 字段兼容性问题修复**
|
|
577
|
+
- 修复 `${subagent}` 变量替换失败问题
|
|
578
|
+
- 实现智能字段兼容机制,自动兼容 `content` 和 `text` 字段
|
|
579
|
+
- 确保老用户配置无需修改,完全向后兼容
|
|
580
|
+
- 优化 `getFieldValue` 方法,支持 `system.1.text` 路径自动获取 `content` 字段
|
|
581
|
+
|
|
582
|
+
**📚 文档完善**
|
|
583
|
+
- 新增《统一路由引擎规则文档》(UNIFIED_ROUTER_RULES.md)
|
|
584
|
+
- 提供完整的技术规则说明和 Mermaid 流程图
|
|
585
|
+
- 修复文档中的 Mermaid 图表解析错误
|
|
586
|
+
- 标准化术语为"代号模型映射规则"
|
|
587
|
+
- 在 README.md 中添加路由规则文档引用
|
|
588
|
+
|
|
589
|
+
**🧪 测试增强**
|
|
590
|
+
- 新增字段兼容性的单元测试
|
|
591
|
+
- 验证所有路由规则的正确性 (8/8 测试用例通过)
|
|
592
|
+
- 确保变量替换机制正常工作
|
|
593
|
+
|
|
572
594
|
### v2.0.2 (2025-12-14)
|
|
573
595
|
|
|
574
596
|
**📚 文档修复**
|
|
@@ -650,6 +672,7 @@ MIT License - 与原版保持一致
|
|
|
650
672
|
|
|
651
673
|
[🐛 报告问题](https://github.com/dedenlabs/claude-code-router-cli/issues) •
|
|
652
674
|
[💡 功能建议](https://github.com/dedenlabs/claude-code-router-cli/issues) •
|
|
653
|
-
[📖 完整文档](./docs/UNIFIED_ROUTER_GUIDE.md)
|
|
675
|
+
[📖 完整文档](./docs/UNIFIED_ROUTER_GUIDE.md) •
|
|
676
|
+
[📋 路由规则](./docs/UNIFIED_ROUTER_RULES.md)
|
|
654
677
|
|
|
655
678
|
</div>
|