yymaxapi 1.0.47 → 1.0.48
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 +21 -8
- package/package.json +1 -1
package/bin/yymaxapi.js
CHANGED
|
@@ -3219,20 +3219,32 @@ function getConfigStatusLine(paths) {
|
|
|
3219
3219
|
const primary = config?.agents?.defaults?.model?.primary || '';
|
|
3220
3220
|
const primaryProvider = primary.split('/')[0] || '';
|
|
3221
3221
|
|
|
3222
|
-
const
|
|
3222
|
+
const KNOWN_PROVIDERS = {
|
|
3223
3223
|
'claude-yunyi': 'Claude(包月)',
|
|
3224
3224
|
'yunyi': 'Codex(包月)',
|
|
3225
3225
|
'heibai': 'MAXAPI(按量)',
|
|
3226
3226
|
};
|
|
3227
3227
|
|
|
3228
3228
|
const parts = [];
|
|
3229
|
+
let otherCount = 0;
|
|
3229
3230
|
for (const p of providers) {
|
|
3230
|
-
|
|
3231
|
-
|
|
3232
|
-
|
|
3231
|
+
if (KNOWN_PROVIDERS[p]) {
|
|
3232
|
+
const label = KNOWN_PROVIDERS[p];
|
|
3233
|
+
const isActive = p === primaryProvider;
|
|
3234
|
+
parts.push(isActive ? chalk.green(`${label} ✓`) : chalk.yellow(`${label} ○`));
|
|
3235
|
+
} else if (p === primaryProvider) {
|
|
3236
|
+
// 未知 provider 但是当前主力,显示名称
|
|
3237
|
+
parts.push(chalk.green(`${p} ✓`));
|
|
3238
|
+
} else {
|
|
3239
|
+
otherCount++;
|
|
3240
|
+
}
|
|
3241
|
+
}
|
|
3242
|
+
|
|
3243
|
+
if (otherCount > 0) {
|
|
3244
|
+
parts.push(chalk.gray(`+${otherCount} 其他`));
|
|
3233
3245
|
}
|
|
3234
3246
|
|
|
3235
|
-
if (parts.length === 0) {
|
|
3247
|
+
if (parts.length === 0 && otherCount === 0) {
|
|
3236
3248
|
return chalk.gray('当前状态: 未配置任何模型');
|
|
3237
3249
|
}
|
|
3238
3250
|
|
|
@@ -3511,9 +3523,10 @@ async function testConnection(paths, args = {}) {
|
|
|
3511
3523
|
console.log(chalk.yellow('⚠️ 请先设置主模型'));
|
|
3512
3524
|
return;
|
|
3513
3525
|
}
|
|
3514
|
-
//
|
|
3515
|
-
const
|
|
3516
|
-
const
|
|
3526
|
+
// 优先选云翼/maxapi provider
|
|
3527
|
+
const preferOrder = ['claude-yunyi', 'yunyi', 'heibai'];
|
|
3528
|
+
const preferred = preferOrder.find(n => providerNames.includes(n));
|
|
3529
|
+
const firstP = preferred || providerNames.find(n => n.includes('claude')) || providerNames[0];
|
|
3517
3530
|
const firstModels = providers[firstP]?.models || [];
|
|
3518
3531
|
if (firstModels.length > 0) {
|
|
3519
3532
|
primary = `${firstP}/${firstModels[0].id}`;
|