yymaxapi 1.0.56 → 1.0.57

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/bin/yymaxapi.js +6 -6
  2. package/package.json +1 -1
package/bin/yymaxapi.js CHANGED
@@ -3834,14 +3834,14 @@ async function testConnection(paths, args = {}) {
3834
3834
  let result = await testGatewayApi(gatewayPort, gatewayToken, primary);
3835
3835
  const latency = Date.now() - startTime;
3836
3836
 
3837
- // /v1/responses 返回 405 时,回退测试 /v1/chat/completions
3838
- if (!result.success && result.reachable && result.status === 405) {
3837
+ // /v1/responses 返回 404/405 时,回退测试 /v1/chat/completions
3838
+ if (!result.success && result.reachable && [404, 405].includes(result.status)) {
3839
3839
  console.log(chalk.gray(' /v1/responses 不支持,回退测试 /v1/chat/completions...'));
3840
3840
  result = await testGatewayApi(gatewayPort, gatewayToken, primary, '/v1/chat/completions');
3841
3841
  }
3842
3842
 
3843
- // CLI 对话已成功 + Gateway 可达(405)= Dashboard 通过 WebSocket 工作,视为通过
3844
- if (!result.success && cliPassed && result.reachable && result.status === 405) {
3843
+ // CLI 对话已成功 + Gateway 可达(404/405)= Dashboard 通过 WebSocket 工作,视为通过
3844
+ if (!result.success && cliPassed && result.reachable && [404, 405].includes(result.status)) {
3845
3845
  console.log(chalk.green(`\n✅ Gateway 测试通过`));
3846
3846
  console.log(chalk.cyan(` CLI 对话正常,Gateway 可达`));
3847
3847
  console.log(chalk.gray(` 注: Gateway Dashboard 通过 WebSocket 通信,REST 端点返回 405 属正常现象`));
@@ -3876,8 +3876,8 @@ async function testConnection(paths, args = {}) {
3876
3876
  console.log(chalk.gray(` 3) 若仍 401,检查是否存在多个配置目录(.openclaw 与 .clawdbot)`));
3877
3877
  }
3878
3878
 
3879
- if (cliPassed && /\b405\b/.test(String(result.error || ''))) {
3880
- console.log(chalk.yellow(`\n⚠️ 已定位:Gateway 可达(HTTP 405),Web API 端点不支持当前请求方法`));
3879
+ if (cliPassed && /\b(404|405)\b/.test(String(result.error || ''))) {
3880
+ console.log(chalk.yellow(`\n⚠️ 已定位:Gateway 可达,Web REST 端点返回 ${result.status || '404/405'}`));
3881
3881
  console.log(chalk.gray(` CLI 对话正常,Web Dashboard 应可正常使用。`));
3882
3882
  console.log(chalk.gray(` 如遇问题,尝试更新 Gateway: npm install -g openclaw@latest && openclaw gateway restart`));
3883
3883
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "yymaxapi",
3
- "version": "1.0.56",
3
+ "version": "1.0.57",
4
4
  "description": "跨平台 OpenClaw/Clawdbot 配置管理工具 - 管理中转地址、模型切换、API Keys、测速优化",
5
5
  "main": "bin/yymaxapi.js",
6
6
  "bin": {