yymaxapi 1.0.25 → 1.0.26
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/bin/yymaxapi.js +8 -8
- package/package.json +1 -1
package/bin/yymaxapi.js
CHANGED
|
@@ -1873,21 +1873,21 @@ async function presetClaude(paths, args = {}) {
|
|
|
1873
1873
|
|
|
1874
1874
|
const sorted = speedResult.ranked || [];
|
|
1875
1875
|
if (sorted.length > 0) {
|
|
1876
|
+
const defaultEp = ENDPOINTS[0];
|
|
1876
1877
|
const { selectedIndex } = await inquirer.prompt([{
|
|
1877
1878
|
type: 'list',
|
|
1878
1879
|
name: 'selectedIndex',
|
|
1879
1880
|
message: '选择节点:',
|
|
1880
1881
|
choices: [
|
|
1881
|
-
{ name: `*
|
|
1882
|
-
new inquirer.Separator(' ----
|
|
1882
|
+
{ name: `* 使用默认节点 (${defaultEp.name})`, value: -1 },
|
|
1883
|
+
new inquirer.Separator(' ---- 或按测速结果选择 ----'),
|
|
1883
1884
|
...sorted.map((e, i) => ({
|
|
1884
1885
|
name: `${e.name} - ${e.latency}ms (评分:${e.score})`,
|
|
1885
1886
|
value: i
|
|
1886
1887
|
}))
|
|
1887
1888
|
]
|
|
1888
1889
|
}]);
|
|
1889
|
-
|
|
1890
|
-
selectedEndpoint = sorted[primaryIndex];
|
|
1890
|
+
selectedEndpoint = selectedIndex === -1 ? defaultEp : sorted[selectedIndex];
|
|
1891
1891
|
if (speedResult.usedFallback) {
|
|
1892
1892
|
console.log(chalk.yellow(`\n⚠ 当前使用备用节点\n`));
|
|
1893
1893
|
}
|
|
@@ -2070,21 +2070,21 @@ async function presetCodex(paths, args = {}) {
|
|
|
2070
2070
|
|
|
2071
2071
|
const sorted = speedResult.ranked || [];
|
|
2072
2072
|
if (sorted.length > 0) {
|
|
2073
|
+
const defaultEp = ENDPOINTS[0];
|
|
2073
2074
|
const { selectedIndex } = await inquirer.prompt([{
|
|
2074
2075
|
type: 'list',
|
|
2075
2076
|
name: 'selectedIndex',
|
|
2076
2077
|
message: '选择节点:',
|
|
2077
2078
|
choices: [
|
|
2078
|
-
{ name: `*
|
|
2079
|
-
new inquirer.Separator(' ----
|
|
2079
|
+
{ name: `* 使用默认节点 (${defaultEp.name})`, value: -1 },
|
|
2080
|
+
new inquirer.Separator(' ---- 或按测速结果选择 ----'),
|
|
2080
2081
|
...sorted.map((e, i) => ({
|
|
2081
2082
|
name: `${e.name} - ${e.latency}ms (评分:${e.score})`,
|
|
2082
2083
|
value: i
|
|
2083
2084
|
}))
|
|
2084
2085
|
]
|
|
2085
2086
|
}]);
|
|
2086
|
-
|
|
2087
|
-
selectedEndpoint = sorted[primaryIndex];
|
|
2087
|
+
selectedEndpoint = selectedIndex === -1 ? defaultEp : sorted[selectedIndex];
|
|
2088
2088
|
if (speedResult.usedFallback) {
|
|
2089
2089
|
console.log(chalk.yellow(`\n⚠ 当前使用备用节点\n`));
|
|
2090
2090
|
}
|