@dedenlabs/claude-code-router-cli 2.0.3 → 2.0.4
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 +753 -678
- package/dist/cli.js +14 -3
- package/dist/index.html +464 -0
- package/examples/README-External-Rules.md +32 -2
- package/examples/README-/350/260/203/350/257/225/346/227/245/345/277/227/350/204/232/346/234/254.md +386 -0
- package/examples/config-with-debug-logger.json +111 -0
- package/examples/external-rules/debug-logger.js +254 -0
- package/examples/external-rules-example.js +6 -6
- package/examples/image/README/1765879508612.png +0 -0
- package/examples/image/README-/350/260/203/350/257/225/346/227/245/345/277/227/350/204/232/346/234/254/1765945871911.png +0 -0
- package/package.json +76 -76
- package/examples/external-rules/user-preference.js +0 -70
package/dist/cli.js
CHANGED
|
@@ -67706,7 +67706,7 @@ var require_package3 = __commonJS({
|
|
|
67706
67706
|
"package.json"(exports2, module2) {
|
|
67707
67707
|
module2.exports = {
|
|
67708
67708
|
name: "@dedenlabs/claude-code-router-cli",
|
|
67709
|
-
version: "2.0.
|
|
67709
|
+
version: "2.0.4",
|
|
67710
67710
|
description: "\u57FA\u4E8E@musistudio/claude-code-router\u7684\u589E\u5F3A\u7248CLI\u8DEF\u7531\u5DE5\u5177 - \u652F\u6301\u7EDF\u4E00\u8DEF\u7531\u5F15\u64CE\u3001\u5916\u90E8\u89C4\u5219\u52A0\u8F7D\u3001\u667A\u80FD\u65E5\u5FD7\u7CFB\u7EDF\u3001\u81EA\u52A8\u914D\u7F6E\u8FC1\u79FB\u548CGLM\u601D\u8003\u6A21\u5F0F",
|
|
67711
67711
|
bin: {
|
|
67712
67712
|
ccr: "dist/cli.js"
|
|
@@ -85069,7 +85069,17 @@ ${allLines[totalLines - 1] || ""}`
|
|
|
85069
85069
|
}
|
|
85070
85070
|
try {
|
|
85071
85071
|
const externalModule = await import(condition.externalFunction.path);
|
|
85072
|
-
const
|
|
85072
|
+
const functionName = condition.externalFunction.functionName;
|
|
85073
|
+
let conditionFunction;
|
|
85074
|
+
if (functionName && externalModule[functionName]) {
|
|
85075
|
+
conditionFunction = externalModule[functionName];
|
|
85076
|
+
} else if (externalModule.default) {
|
|
85077
|
+
conditionFunction = externalModule.default;
|
|
85078
|
+
} else if (externalModule["evaluate"]) {
|
|
85079
|
+
conditionFunction = externalModule["evaluate"];
|
|
85080
|
+
} else {
|
|
85081
|
+
conditionFunction = void 0;
|
|
85082
|
+
}
|
|
85073
85083
|
if (typeof conditionFunction !== "function") {
|
|
85074
85084
|
this.logger.error(
|
|
85075
85085
|
`\u5916\u90E8\u51FD\u6570 ${condition.externalFunction.path} \u4E0D\u662F\u4E00\u4E2A\u6709\u6548\u7684\u51FD\u6570`
|
|
@@ -87201,7 +87211,8 @@ function getAccessibleIPs(HOST) {
|
|
|
87201
87211
|
function getPrimaryIP(HOST) {
|
|
87202
87212
|
const addresses = getAccessibleIPs(HOST);
|
|
87203
87213
|
const privateIPRegex = /^(10\.|172\.(1[6-9]|2[0-9]|3[0-1])\.|192\.168\.)/;
|
|
87204
|
-
|
|
87214
|
+
const priorityIP = addresses.find((ip) => /^192\.168\./.test(ip)) || addresses.find((ip) => privateIPRegex.test(ip));
|
|
87215
|
+
return priorityIP || addresses[0] || HOST;
|
|
87205
87216
|
}
|
|
87206
87217
|
async function initializeClaudeConfig() {
|
|
87207
87218
|
const homeDir = (0, import_os2.homedir)();
|