aihezu 2.8.6 → 2.8.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.
@@ -66,8 +66,9 @@ async function configCommand(service, args = []) {
66
66
  const urlObj = new URL(apiUrl);
67
67
  const hostname = urlObj.hostname;
68
68
 
69
- // Only add suffix for aihezu.dev and its subdomains
70
- if (hostname === 'aihezu.dev' || hostname.endsWith('.aihezu.dev')) {
69
+ // Only add suffix for aihezu.dev/aihezu.top and their subdomains
70
+ if (hostname === 'aihezu.dev' || hostname.endsWith('.aihezu.dev') ||
71
+ hostname === 'aihezu.top' || hostname.endsWith('.aihezu.top')) {
71
72
  const normalizedSuffix = suffix.startsWith('/') ? suffix : `/${suffix}`;
72
73
  const trimmedUrl = apiUrl.replace(/\/+$/, '');
73
74
  if (!trimmedUrl.endsWith(normalizedSuffix)) {
@@ -67,8 +67,9 @@ async function installCommand(service, args = []) {
67
67
  const urlObj = new URL(apiUrl);
68
68
  const hostname = urlObj.hostname;
69
69
 
70
- // Only add suffix for aihezu.dev and its subdomains
71
- if (hostname === 'aihezu.dev' || hostname.endsWith('.aihezu.dev')) {
70
+ // Only add suffix for aihezu.dev/aihezu.top and their subdomains
71
+ if (hostname === 'aihezu.dev' || hostname.endsWith('.aihezu.dev') ||
72
+ hostname === 'aihezu.top' || hostname.endsWith('.aihezu.top')) {
72
73
  const normalizedSuffix = suffix.startsWith('/') ? suffix : `/${suffix}`;
73
74
  const trimmedUrl = apiUrl.replace(/\/+$/, '');
74
75
  if (!trimmedUrl.endsWith(normalizedSuffix)) {
package/commands/usage.js CHANGED
@@ -434,11 +434,13 @@ function displayUsageStats(stats, origin, source) {
434
434
  return l - c;
435
435
  })();
436
436
 
437
- // 提取请求次数和 Token 用量
438
- const currentDailyRequests = (stats.currentDailyRequests !== undefined) ? stats.currentDailyRequests : limits.currentDailyRequests;
439
- const currentDailyTokens = (stats.currentDailyTokens !== undefined) ? stats.currentDailyTokens : limits.currentDailyTokens;
440
- const currentWindowRequests = (stats.currentWindowRequests !== undefined) ? stats.currentWindowRequests : limits.currentWindowRequests;
441
- const currentWindowTokens = (stats.currentWindowTokens !== undefined) ? stats.currentWindowTokens : limits.currentWindowTokens;
437
+ // 提取日请求次数和 Token 用量(API 中 currentWindowRequests/Tokens 实际为日数据)
438
+ const currentDailyRequests = (stats.currentDailyRequests !== undefined) ? stats.currentDailyRequests
439
+ : (limits.currentDailyRequests !== undefined) ? limits.currentDailyRequests
440
+ : (stats.currentWindowRequests !== undefined) ? stats.currentWindowRequests : limits.currentWindowRequests;
441
+ const currentDailyTokens = (stats.currentDailyTokens !== undefined) ? stats.currentDailyTokens
442
+ : (limits.currentDailyTokens !== undefined) ? limits.currentDailyTokens
443
+ : (stats.currentWindowTokens !== undefined) ? stats.currentWindowTokens : limits.currentWindowTokens;
442
444
 
443
445
  console.log(`域名: ${origin}`);
444
446
  console.log(`来源: ${source}`);
@@ -465,12 +467,6 @@ function displayUsageStats(stats, origin, source) {
465
467
  if (windowRemaining !== null) {
466
468
  console.log(`窗口剩余: ${formatCost(windowRemaining)}`);
467
469
  }
468
- if (asNumber(currentWindowRequests) !== null || asNumber(currentWindowTokens) !== null) {
469
- const parts = [];
470
- if (asNumber(currentWindowRequests) !== null) parts.push(`请求 ${formatNumber(currentWindowRequests)} 次`);
471
- if (asNumber(currentWindowTokens) !== null) parts.push(`Token ${formatCompactNumber(currentWindowTokens)}`);
472
- console.log(`窗口统计: ${parts.join(' | ')}`);
473
- }
474
470
  const windowStartText = formatDateTime(windowStartTime);
475
471
  const windowEndText = formatDateTime(windowEndTime);
476
472
  if (windowStartText !== '-' || windowEndText !== '-') {
@@ -243,7 +243,7 @@ function getTroubleshootingGuide(errorType)
243
243
 
244
244
  2. 永久设置(需要重启终端):
245
245
  setx ANTHROPIC_AUTH_TOKEN "sk-xxx"
246
- setx ANTHROPIC_BASE_URL "https://cn.aihezu.dev/api"
246
+ setx ANTHROPIC_BASE_URL "https://code.aihezu.top/api"
247
247
 
248
248
  3. 推荐:使用配置文件而非环境变量
249
249
  npx aihezu config claude
@@ -629,7 +629,7 @@ function getEnvVarGuide(varName) {
629
629
  '',
630
630
  '方式 2: 永久设置(需要重启终端)',
631
631
  ` setx ${varName} "your-value"`,
632
- ` setx ANTHROPIC_BASE_URL "https://cn.aihezu.dev/api"`,
632
+ ` setx ANTHROPIC_BASE_URL "https://code.aihezu.top/api"`,
633
633
  '',
634
634
  '⚠️ 注意: setx 后必须重启 PowerShell/CMD 才能生效',
635
635
  '',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "aihezu",
3
- "version": "2.8.6",
3
+ "version": "2.8.8",
4
4
  "description": "AI 开发环境配置工具 - 支持 Claude Code, Codex, Google Gemini 的本地化配置、代理设置与缓存清理",
5
5
  "main": "bin/aihezu.js",
6
6
  "bin": {
@@ -10,7 +10,7 @@ const settingsPath = path.join(configDir, 'settings.json');
10
10
  module.exports = {
11
11
  name: 'claude',
12
12
  displayName: 'Claude Code',
13
- defaultApiUrl: 'https://cn.aihezu.dev/api',
13
+ defaultApiUrl: 'https://code.aihezu.top/api',
14
14
  apiSuffix: '/api',
15
15
 
16
16
  // Cache cleaning configuration