openclawapi 1.3.6 → 1.3.8

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.
Files changed (2) hide show
  1. package/cli.js +12 -9
  2. package/package.json +1 -1
package/cli.js CHANGED
@@ -415,37 +415,40 @@ async function testConnection(paths) {
415
415
  return;
416
416
  }
417
417
 
418
- console.log(chalk.gray(`测试 ${typeLabel} API...`));
418
+ console.log(chalk.gray(`当前激活: ${typeLabel}`));
419
419
  console.log(chalk.gray(`节点: ${provider.baseUrl}`));
420
420
  console.log(chalk.gray(`模型: ${provider.models?.[0]?.id || 'N/A'}\n`));
421
421
 
422
+ // 直接测试中转 API
423
+ console.log(chalk.cyan(`正在测试 ${typeLabel} API...`));
424
+
422
425
  try {
423
426
  const startTime = Date.now();
424
427
 
425
428
  if (type === 'claude') {
426
- // Claude API 测试
427
429
  const result = await testClaudeApi(provider.baseUrl, provider.apiKey, provider.models?.[0]?.id);
428
430
  const latency = Date.now() - startTime;
429
431
 
430
432
  if (result.success) {
431
- console.log(chalk.green(`✅ Claude API 连接成功!`));
433
+ console.log(chalk.green(`\n✅ ${typeLabel} API 连接成功!`));
432
434
  console.log(chalk.cyan(` 响应时间: ${latency}ms`));
433
- console.log(chalk.gray(` 回复: ${result.message}`));
435
+ console.log(chalk.yellow(` 模型回复: ${result.message}`));
436
+ console.log(chalk.gray(`\n💡 配置已写入,请运行 openclaw gateway restart 使配置生效`));
434
437
  } else {
435
- console.log(chalk.red(`❌ Claude API 连接失败`));
438
+ console.log(chalk.red(`\n❌ ${typeLabel} API 连接失败`));
436
439
  console.log(chalk.red(` 错误: ${result.error}`));
437
440
  }
438
441
  } else {
439
- // Codex API 测试
440
442
  const result = await testCodexApi(provider.baseUrl, provider.apiKey, provider.models?.[0]?.id);
441
443
  const latency = Date.now() - startTime;
442
444
 
443
445
  if (result.success) {
444
- console.log(chalk.green(`✅ Codex API 连接成功!`));
446
+ console.log(chalk.green(`\n✅ ${typeLabel} API 连接成功!`));
445
447
  console.log(chalk.cyan(` 响应时间: ${latency}ms`));
446
- console.log(chalk.gray(` 回复: ${result.message}`));
448
+ console.log(chalk.yellow(` 模型回复: ${result.message}`));
449
+ console.log(chalk.gray(`\n💡 配置已写入,请运行 openclaw gateway restart 使配置生效`));
447
450
  } else {
448
- console.log(chalk.red(`❌ Codex API 连接失败`));
451
+ console.log(chalk.red(`\n❌ ${typeLabel} API 连接失败`));
449
452
  console.log(chalk.red(` 错误: ${result.error}`));
450
453
  }
451
454
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "openclawapi",
3
- "version": "1.3.6",
3
+ "version": "1.3.8",
4
4
  "description": "跨平台 OpenClaw/Clawdbot 配置管理工具 - 管理中转地址、模型切换、API Keys、测速优化",
5
5
  "main": "cli.js",
6
6
  "bin": {