aixxai 1.7.3 → 1.7.4

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "aixxai",
3
- "version": "1.7.3",
3
+ "version": "1.7.4",
4
4
  "description": "AIXX CLI - 让你的AI调用万物。One command, every AI model. By AIXX (Wanan Exchange), the verification-first compute exchange. 安装:npx aixxai",
5
5
  "type": "module",
6
6
  "bin": {
@@ -66,9 +66,18 @@ export async function balance(subArgs) {
66
66
  // 4. GPU行情数据API额度先上屏(预取于下方0.5段完成·千问终检⑥:最快的先显示)
67
67
  if (dataApi) {
68
68
  const left = dataApi.free_quota - dataApi.free_used;
69
+ const dRem = typeof dataApi.daily_remaining === 'number' ? dataApi.daily_remaining
70
+ : Math.max(40 - (dataApi.today_counted || 0), 0);
69
71
  console.log('── GPU 行情数据 API ──');
70
72
  console.log(`📊 档位:${dataApi.tier === 'sub' ? '订阅中' : '免费档'}${dataApi.sub_expires_at ? `(至 ${String(dataApi.sub_expires_at).slice(0, 10)})` : ''}`);
71
73
  console.log(`📊 免费额度:剩 ${left} / ${dataApi.free_quota} 次(今日已用 ${dataApi.today_counted})`);
74
+ if (dRem <= 0) {
75
+ // 1121千问P0-3: 额度用尽时置顶引导(通用文案用户读完不知道该干嘛)
76
+ console.log('⚠️ 今日免费额度已用尽——北京时间次日00:00自动重置,现在重试无意义');
77
+ console.log(' 需要现在继续? 订阅档: https://aixx.ai/data-api.html#price');
78
+ } else if (dataApi.tier !== 'sub' && dRem <= 10) {
79
+ console.log(`💡 今日剩余 ${dRem} 次,快到日上限(40/日)——省着点用`);
80
+ }
72
81
  console.log('────────────────────────────────────\n');
73
82
  }
74
83
 
@@ -167,15 +176,6 @@ export async function balance(subArgs) {
167
176
  }
168
177
  console.log('────────────────────────────────────');
169
178
 
170
- // 4. GPU行情数据API额度(预取结果上屏——千问终检⑥:数据API段排前·展示顺序=数据API→模型余额)
171
- if (dataApi) {
172
- const left = dataApi.free_quota - dataApi.free_used;
173
- console.log('\n── GPU 行情数据 API ──');
174
- console.log(`📊 档位:${dataApi.tier === 'sub' ? '订阅中' : '免费档'}${dataApi.sub_expires_at ? `(至 ${String(dataApi.sub_expires_at).slice(0, 10)})` : ''}`);
175
- console.log(`📊 免费额度:剩 ${left} / ${dataApi.free_quota} 次(今日已用 ${dataApi.today_counted})`);
176
- console.log('────────────────────────────────────');
177
- }
178
-
179
179
  console.log('\n💡 提示:');
180
180
  console.log(' - 新用户注册送 $0.5 试用额度');
181
181
  console.log(' - glm-4-air 便宜,省着用能聊很久');
@@ -62,6 +62,19 @@ async function mFetch(path) {
62
62
  console.error('当前订阅档位不包含该数据 —— 如需升级请访问 aixx.ai 或联系客服');
63
63
  process.exit(1);
64
64
  }
65
+ if (res.status === 429) {
66
+ // 1121千问P0-2: 解析429体分流——quota_exhausted=额度墙(引导)·rate_limited=太快(等待)
67
+ let eb = {};
68
+ try { eb = await res.json(); } catch { /* 无体走默认 */ }
69
+ if (eb && eb.error === 'quota_exhausted') {
70
+ console.error('🔥 今日免费数据额度已用完(北京时间次日00:00自动重置)');
71
+ console.error(' 现在重试无意义。额度账目: aixx balance');
72
+ console.error(' 需要现在继续? 订阅档: https://aixx.ai/data-api.html#price');
73
+ } else {
74
+ console.error('⏳ 请求太快,' + ((eb && eb.retry_after) || 60) + '秒后可继续');
75
+ }
76
+ process.exit(1);
77
+ }
65
78
  if (res.status === 404) {
66
79
  console.error('未查询到该数据(请核对标的代码)');
67
80
  process.exit(1);