minimax-status 1.1.7 → 1.1.9

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/README.md CHANGED
@@ -37,17 +37,16 @@ npm update -g minimax-status
37
37
  ### 3. 配置认证
38
38
 
39
39
  ```bash
40
- minimax auth <token> <groupId>
40
+ minimax auth <token>
41
41
  ```
42
42
 
43
43
  配置信息将保存在 `~/.minimax-config.json` 文件中。
44
44
 
45
- 获取令牌和组 ID:
45
+ 获取令牌:
46
46
 
47
47
  1. 访问 [MiniMax 开放平台](https://platform.minimaxi.com/user-center/payment/coding-plan)
48
48
  2. 登录并进入控制台
49
- 3. 账户信息中复制 groupID
50
- 4. Coding Plan 中创建或获取 API Key
49
+ 3. Coding Plan 中创建或获取 API Key
51
50
 
52
51
  ### 4. 查看状态
53
52
 
@@ -90,7 +89,7 @@ npm run package
90
89
 
91
90
  1. 安装扩展后,点击状态栏的 "MiniMax 未配置" 按钮
92
91
  2. 或使用命令 "MiniMax Status: 配置向导"
93
- 3. 输入您的 API Key 和 GroupID
92
+ 3. 输入您的 API Key
94
93
  4. 配置完成后,状态栏将显示实时使用状态
95
94
 
96
95
  > **注意**: 扩展尚未发布到 VSCode 市场,需要手动安装
@@ -105,7 +104,7 @@ npm run package
105
104
 
106
105
  ```bash
107
106
  npm install -g minimax-status
108
- minimax auth <token> <groupId>
107
+ minimax auth <token>
109
108
  ```
110
109
 
111
110
  2. **配置 Claude Code**:
@@ -190,7 +189,7 @@ my-app │ main * │ ...
190
189
 
191
190
  ```bash
192
191
  npm install -g minimax-status
193
- minimax auth <token> <groupId>
192
+ minimax auth <token>
194
193
  ```
195
194
 
196
195
  2. **配置 Droid**:
@@ -271,9 +270,9 @@ minimax-status │ main * │ Usage █░░░░░░░░ 10% (4047/4500)
271
270
 
272
271
  ## 命令说明
273
272
 
274
- | 命令 | 描述 | 示例 |
275
- | --------------------- | ------------------------------------------- | -------------------------------- |
276
- | `minimax auth` | 设置认证凭据 | `minimax auth <token> <groupId>` |
273
+ | 命令 | 描述 | 示例 |
274
+ | --------------------- | ------------------------------------------- | ----------------------------- |
275
+ | `minimax auth` | 设置认证凭据 | `minimax auth <token>` |
277
276
  | `minimax status` | 显示当前使用状态(支持 --compact、--watch) | `minimax status` |
278
277
  | `minimax bar` | 终端底部持续状态栏 | `minimax bar` |
279
278
  | `minimax statusline` | Claude Code 状态栏集成 | 用于 Claude Code 配置 |
@@ -322,8 +321,7 @@ minimax-status │ main * │ Usage █░░░░░░░░ 10% (4047/4500)
322
321
 
323
322
  ```json
324
323
  {
325
- "token": "your_access_token_here",
326
- "groupId": "your_group_id_here"
324
+ "token": "your_access_token_here"
327
325
  }
328
326
  ```
329
327
 
@@ -359,11 +357,11 @@ npm install -g minimax-status
359
357
  ### 认证失败
360
358
 
361
359
  ```bash
362
- # 检查令牌和组 ID
360
+ # 检查令牌
363
361
  minimax status
364
362
 
365
363
  # 重新设置认证
366
- minimax auth <new_token> <new_groupId>
364
+ minimax auth <new_token>
367
365
  ```
368
366
 
369
367
  ### 状态栏不显示
package/cli/api.js CHANGED
@@ -82,7 +82,6 @@ class MinimaxAPI {
82
82
  const response = await axios.get(
83
83
  `https://www.minimaxi.com/v1/api/openplatform/coding_plan/remains`,
84
84
  {
85
- params: { GroupId: this.groupId },
86
85
  headers: {
87
86
  Authorization: `Bearer ${this.token}`,
88
87
  Accept: "application/json",
@@ -124,7 +123,6 @@ class MinimaxAPI {
124
123
  biz_line: 2,
125
124
  cycle_type: 1,
126
125
  resource_package_type: 7,
127
- GroupId: this.groupId,
128
126
  },
129
127
  headers: {
130
128
  Authorization: `Bearer ${this.token}`,
@@ -157,7 +155,6 @@ class MinimaxAPI {
157
155
  page: page,
158
156
  limit: limit,
159
157
  aggregate: false,
160
- GroupId: this.groupId,
161
158
  },
162
159
  headers: {
163
160
  Authorization: `Bearer ${this.token}`,
@@ -302,6 +299,14 @@ class MinimaxAPI {
302
299
  const hours = Math.floor(remainingMs / (1000 * 60 * 60));
303
300
  const minutes = Math.floor((remainingMs % (1000 * 60 * 60)) / (1000 * 60));
304
301
 
302
+ // Calculate weekly usage data
303
+ const weeklyUsed = modelData.current_weekly_total_count - modelData.current_weekly_usage_count;
304
+ const weeklyTotal = modelData.current_weekly_total_count;
305
+ const weeklyPercentage = Math.floor((weeklyUsed / weeklyTotal) * 100);
306
+ const weeklyRemainingMs = modelData.weekly_remains_time;
307
+ const weeklyDays = Math.floor(weeklyRemainingMs / (1000 * 60 * 60 * 24));
308
+ const weeklyHours = Math.floor((weeklyRemainingMs % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60));
309
+
305
310
  // Parse subscription expiry date if available
306
311
  let expiryInfo = null;
307
312
  if (
@@ -372,6 +377,16 @@ class MinimaxAPI {
372
377
  total: modelData.current_interval_total_count,
373
378
  percentage: usedPercentage,
374
379
  },
380
+ weekly: {
381
+ used: weeklyUsed,
382
+ total: weeklyTotal,
383
+ percentage: weeklyPercentage,
384
+ days: weeklyDays,
385
+ hours: weeklyHours,
386
+ text: weeklyDays > 0
387
+ ? `${weeklyDays} 天 ${weeklyHours} 小时后重置`
388
+ : `${weeklyHours} 小时后重置`,
389
+ },
375
390
  contextWindow,
376
391
  expiry: expiryInfo,
377
392
  };
package/cli/index.js CHANGED
@@ -29,9 +29,9 @@ program
29
29
  .command("auth")
30
30
  .description("设置认证凭据")
31
31
  .argument("<token>", "MiniMax 访问令牌")
32
- .argument("<groupId>", "MiniMax 组 ID")
32
+ .argument("[groupId]", "MiniMax 组 ID(已废弃,可不填)")
33
33
  .action((token, groupId) => {
34
- api.setCredentials(token, groupId);
34
+ api.setCredentials(token, groupId || null);
35
35
  console.log(chalk.green("✓ 认证信息已保存"));
36
36
  });
37
37
 
@@ -374,6 +374,7 @@ program
374
374
  usage,
375
375
  remaining,
376
376
  expiry,
377
+ weekly: usageData.weekly,
377
378
  contextUsage: contextUsageValue,
378
379
  contextSize: contextSizeValue,
379
380
  configCounts,
@@ -565,13 +566,14 @@ program
565
566
  } catch (e) {
566
567
  usageData = {
567
568
  usage: { percentage: 0, input: 0, output: 0, cached: 0, total: 0 },
569
+ weekly: null,
568
570
  remaining: "未知",
569
571
  expiry: "未知",
570
572
  modelName: modelDisplayName
571
573
  };
572
574
  }
573
575
 
574
- const { usage, remaining, expiry } = usageData;
576
+ const { usage, weekly, remaining, expiry } = usageData;
575
577
 
576
578
  // 获取 git 分支
577
579
  let gitBranch = null;
@@ -675,7 +677,13 @@ program
675
677
  // 使用量 - 进度条风格 (显示次数)
676
678
  const usageBar = coloredBar(usage.percentage);
677
679
  const usageColor = usage.percentage >= 85 ? chalk.red : usage.percentage >= 60 ? chalk.yellow : chalk.green;
678
- parts.push(`${chalk.yellow('Usage')} ${usageBar} ${usageColor(usage.percentage + '%')} (${usage.remaining}/${usage.total})`);
680
+ let usageLine = `${chalk.yellow('Usage')} ${usageBar} ${usageColor(usage.percentage + '%')} (${usage.remaining}/${usage.total})`;
681
+ // 周用量紧跟在 usage 后面
682
+ if (weekly) {
683
+ const weeklyColor = weekly.percentage >= 85 ? chalk.red : weekly.percentage >= 60 ? chalk.yellow : chalk.green;
684
+ usageLine += ` ${chalk.gray('·')} ${chalk.blue('W')} ${weeklyColor(weekly.percentage + '%')}`;
685
+ }
686
+ parts.push(usageLine);
679
687
 
680
688
  // 倒计时
681
689
  const remainingText = remaining.hours > 0
package/cli/renderer.js CHANGED
@@ -70,6 +70,7 @@ class Renderer {
70
70
  contextSize,
71
71
  configCounts,
72
72
  sessionDuration,
73
+ weekly,
73
74
  } = data;
74
75
 
75
76
  const parts = [];
@@ -122,7 +123,13 @@ class Renderer {
122
123
  const filled = Math.round((usagePercentage / 100) * 10);
123
124
  const empty = 10 - filled;
124
125
  const usageBar = usageColor('█'.repeat(filled) + '\x1b[2m' + '░'.repeat(empty) + '\x1b[0m');
125
- parts.push(`${chalk.yellow('Usage')} ${usageBar} ${usageColor(usagePercentage + '%')} (${usage.remaining}/${usage.total})`);
126
+ let usageLine = `${chalk.yellow('Usage')} ${usageBar} ${usageColor(usagePercentage + '%')} (${usage.remaining}/${usage.total})`;
127
+ // 周用量紧跟在 usage 后面
128
+ if (weekly) {
129
+ const weeklyColor = this.getStatusColor(weekly.percentage);
130
+ usageLine += ` ${chalk.gray('·')} ${chalk.blue('W')} ${weeklyColor(weekly.percentage + '%')}`;
131
+ }
132
+ parts.push(usageLine);
126
133
 
127
134
  // 倒计时 - 保留图标
128
135
  const remainingText = remaining.hours > 0
package/cli/status.js CHANGED
@@ -74,7 +74,7 @@ class StatusBar {
74
74
  }
75
75
 
76
76
  render() {
77
- const { modelName, timeWindow, remaining, usage, expiry } = this.data;
77
+ const { modelName, timeWindow, remaining, usage, weekly, expiry } = this.data;
78
78
 
79
79
  // Calculate progress bar width
80
80
  const width = 30;
@@ -110,6 +110,20 @@ class StatusBar {
110
110
  // 剩余次数
111
111
  contentLines.push(`${chalk.dim(' 剩余:')} ${usage.remaining}/${usage.total} 次调用`);
112
112
 
113
+ // 周用量(如果有数据)
114
+ if (weekly) {
115
+ contentLines.push('');
116
+ const weeklyPercent = weekly.percentage;
117
+ const weeklyColor = weeklyPercent >= 85 ? chalk.red : weeklyPercent >= 60 ? chalk.yellow : chalk.green;
118
+ const weeklyProgress = this.createProgressBar(
119
+ Math.floor((weeklyPercent / 100) * 15),
120
+ 15 - Math.floor((weeklyPercent / 100) * 15),
121
+ weeklyPercent
122
+ );
123
+ contentLines.push(`${chalk.cyan('周用量:')} ${weeklyColor(weeklyProgress)} ${weeklyColor(weekly.percentage + '%')} (${weekly.used}/${weekly.total})`);
124
+ contentLines.push(`${chalk.dim(' 重置:')} ${weekly.text}`);
125
+ }
126
+
113
127
  // 添加到期行(如果可用)
114
128
  if (expiry) {
115
129
  const expiryText = `${expiry.date} (${expiry.text})`;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "minimax-status",
3
- "version": "1.1.7",
3
+ "version": "1.1.9",
4
4
  "description": "MiniMax Claude Code 使用状态监控工具",
5
5
  "bin": {
6
6
  "minimax-status": "cli/index.js",