minimax-status 1.0.3 → 1.0.5
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/.github/workflows/build-vscode-extension.yml +77 -0
- package/README.md +34 -0
- package/cli/api.js +37 -3
- package/cli/index.js +65 -1
- package/cli/status.js +2 -2
- package/package.json +3 -3
- package/vscode-extension/.eslintrc.json +18 -0
- package/vscode-extension/.vscodeignore +10 -0
- package/vscode-extension/LICENSE +21 -0
- package/vscode-extension/README.md +161 -0
- package/vscode-extension/api.js +6 -5
- package/vscode-extension/extension.js +255 -23
- package/vscode-extension/package-lock.json +3546 -0
- package/vscode-extension/package.json +23 -4
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
name: Build and Release VSCode Extension
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [ main ]
|
|
6
|
+
paths:
|
|
7
|
+
- 'vscode-extension/**'
|
|
8
|
+
- '.github/workflows/build-vscode-extension.yml'
|
|
9
|
+
workflow_dispatch:
|
|
10
|
+
|
|
11
|
+
jobs:
|
|
12
|
+
build:
|
|
13
|
+
runs-on: ubuntu-latest
|
|
14
|
+
|
|
15
|
+
steps:
|
|
16
|
+
- name: Checkout code
|
|
17
|
+
uses: actions/checkout@v4
|
|
18
|
+
|
|
19
|
+
- name: Setup Node.js
|
|
20
|
+
uses: actions/setup-node@v4
|
|
21
|
+
with:
|
|
22
|
+
node-version: '18'
|
|
23
|
+
cache: 'npm'
|
|
24
|
+
cache-dependency-path: 'vscode-extension/package-lock.json'
|
|
25
|
+
|
|
26
|
+
- name: Install dependencies
|
|
27
|
+
working-directory: ./vscode-extension
|
|
28
|
+
run: npm ci
|
|
29
|
+
|
|
30
|
+
# - name: Run tests
|
|
31
|
+
# working-directory: ./vscode-extension
|
|
32
|
+
# run: npm test
|
|
33
|
+
# Note: Tests temporarily disabled due to missing mocha dependency
|
|
34
|
+
|
|
35
|
+
- name: Build VSIX
|
|
36
|
+
working-directory: ./vscode-extension
|
|
37
|
+
run: npx vsce package --allow-missing-repository
|
|
38
|
+
|
|
39
|
+
- name: Get version
|
|
40
|
+
id: version
|
|
41
|
+
working-directory: ./vscode-extension
|
|
42
|
+
run: |
|
|
43
|
+
VERSION=$(node -p "require('./package.json').version")
|
|
44
|
+
echo "VERSION=$VERSION" >> $GITHUB_OUTPUT
|
|
45
|
+
echo "Version: $VERSION"
|
|
46
|
+
|
|
47
|
+
- name: Create Release
|
|
48
|
+
uses: softprops/action-gh-release@v1
|
|
49
|
+
with:
|
|
50
|
+
tag_name: vscode-v${{ steps.version.outputs.VERSION }}
|
|
51
|
+
name: VSCode Extension v${{ steps.version.outputs.VERSION }}
|
|
52
|
+
body: |
|
|
53
|
+
MiniMax Status - VSCode Extension v${{ steps.version.outputs.VERSION }}
|
|
54
|
+
|
|
55
|
+
## 安装说明
|
|
56
|
+
|
|
57
|
+
1. 点击下方 `minimax-status-vscode-${{ steps.version.outputs.VERSION }}.vsix` 下载扩展包
|
|
58
|
+
2. 在 VS Code 中按 `Ctrl+Shift+P`
|
|
59
|
+
3. 输入 "Extensions: Install from VSIX..."
|
|
60
|
+
4. 选择下载的 `.vsix` 文件
|
|
61
|
+
|
|
62
|
+
## 更新内容
|
|
63
|
+
|
|
64
|
+
请查看 [完整更新日志](https://github.com/JochenYang/minimax-status/commits/main)
|
|
65
|
+
files: |
|
|
66
|
+
vscode-extension/minimax-status-vscode-${{ steps.version.outputs.VERSION }}.vsix
|
|
67
|
+
draft: false
|
|
68
|
+
prerelease: false
|
|
69
|
+
env:
|
|
70
|
+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
71
|
+
|
|
72
|
+
- name: Upload VSIX artifact
|
|
73
|
+
uses: actions/upload-artifact@v4
|
|
74
|
+
with:
|
|
75
|
+
name: minimax-status-vscode-${{ steps.version.outputs.VERSION }}
|
|
76
|
+
path: vscode-extension/minimax-status-vscode-${{ steps.version.outputs.VERSION }}.vsix
|
|
77
|
+
retention-days: 30
|
package/README.md
CHANGED
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
[](https://www.npmjs.com/package/minimax-status)
|
|
4
4
|
[](https://www.npmjs.com/package/minimax-status)
|
|
5
5
|
[](https://opensource.org/licenses/MIT)
|
|
6
|
+
[](https://github.com/JochenYang/minimax-status/actions/workflows/build-vscode-extension.yml)
|
|
6
7
|
|
|
7
8
|
MiniMax coding-plan 使用状态监控工具,支持 CLI 命令和 Claude Code 状态栏集成。
|
|
8
9
|
|
|
@@ -53,6 +54,39 @@ minimax status --compact
|
|
|
53
54
|
minimax status --watch
|
|
54
55
|
```
|
|
55
56
|
|
|
57
|
+
## VSCode 扩展
|
|
58
|
+
|
|
59
|
+
提供 VSCode 扩展版本,支持在 VSCode 底部状态栏显示使用状态。
|
|
60
|
+
|
|
61
|
+
### 安装方式
|
|
62
|
+
|
|
63
|
+
**方式一:下载 VSIX 文件**
|
|
64
|
+
|
|
65
|
+
1. 访问 [GitHub Releases](https://github.com/JochenYang/minimax-status/releases)
|
|
66
|
+
2. 下载最新的 `.vsix` 文件
|
|
67
|
+
3. 在 VSCode 中按 `Ctrl+Shift+P`
|
|
68
|
+
4. 输入 "Extensions: Install from VSIX..."
|
|
69
|
+
5. 选择下载的 VSIX 文件
|
|
70
|
+
|
|
71
|
+
**方式二:从源码构建**
|
|
72
|
+
|
|
73
|
+
```bash
|
|
74
|
+
git clone https://github.com/JochenYang/minimax-status.git
|
|
75
|
+
cd minimax-status/vscode-extension
|
|
76
|
+
npm install
|
|
77
|
+
npm run package
|
|
78
|
+
# 在 VSCode 中安装生成的 .vsix 文件
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
### 配置步骤
|
|
82
|
+
|
|
83
|
+
1. 安装扩展后,点击状态栏的 "MiniMax 未配置" 按钮
|
|
84
|
+
2. 或使用命令 "MiniMax Status: 配置向导"
|
|
85
|
+
3. 输入您的 API Key 和 GroupID
|
|
86
|
+
4. 配置完成后,状态栏将显示实时使用状态
|
|
87
|
+
|
|
88
|
+
> **注意**: 扩展尚未发布到 VSCode 市场,需要手动安装
|
|
89
|
+
|
|
56
90
|
## Claude Code 集成
|
|
57
91
|
|
|
58
92
|
将 MiniMax 使用状态显示在 Claude Code 底部状态栏。
|
package/cli/api.js
CHANGED
|
@@ -1,12 +1,18 @@
|
|
|
1
1
|
const axios = require('axios');
|
|
2
2
|
const fs = require('fs');
|
|
3
3
|
const path = require('path');
|
|
4
|
+
const chalk = require('chalk').default;
|
|
4
5
|
|
|
5
6
|
class MinimaxAPI {
|
|
6
7
|
constructor() {
|
|
7
8
|
this.token = null;
|
|
8
9
|
this.groupId = null;
|
|
9
10
|
this.configPath = path.join(process.env.HOME || process.env.USERPROFILE, '.minimax-config.json');
|
|
11
|
+
this.cache = {
|
|
12
|
+
data: null,
|
|
13
|
+
timestamp: 0
|
|
14
|
+
};
|
|
15
|
+
this.cacheTimeout = 8000; // 8秒缓存
|
|
10
16
|
this.loadConfig();
|
|
11
17
|
}
|
|
12
18
|
|
|
@@ -42,11 +48,18 @@ class MinimaxAPI {
|
|
|
42
48
|
this.saveConfig();
|
|
43
49
|
}
|
|
44
50
|
|
|
45
|
-
async getUsageStatus() {
|
|
51
|
+
async getUsageStatus(forceRefresh = false) {
|
|
46
52
|
if (!this.token || !this.groupId) {
|
|
47
53
|
throw new Error('Missing credentials. Please run "minimax-status auth <token> <groupId>" first');
|
|
48
54
|
}
|
|
49
55
|
|
|
56
|
+
// 检查缓存
|
|
57
|
+
const now = Date.now();
|
|
58
|
+
if (!forceRefresh && this.cache.data && (now - this.cache.timestamp) < this.cacheTimeout) {
|
|
59
|
+
return this.cache.data;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
const startTime = Date.now();
|
|
50
63
|
try {
|
|
51
64
|
const response = await axios.get(
|
|
52
65
|
`https://www.minimaxi.com/v1/api/openplatform/coding_plan/remains`,
|
|
@@ -55,19 +68,39 @@ class MinimaxAPI {
|
|
|
55
68
|
headers: {
|
|
56
69
|
'Authorization': `Bearer ${this.token}`,
|
|
57
70
|
'Accept': 'application/json'
|
|
58
|
-
}
|
|
71
|
+
},
|
|
72
|
+
timeout: 10000 // 10秒超时
|
|
59
73
|
}
|
|
60
74
|
);
|
|
61
75
|
|
|
76
|
+
const responseTime = Date.now() - startTime;
|
|
77
|
+
console.log(chalk.gray(`API 响应时间: ${responseTime}ms`));
|
|
78
|
+
|
|
79
|
+
// 更新缓存
|
|
80
|
+
this.cache.data = response.data;
|
|
81
|
+
this.cache.timestamp = now;
|
|
82
|
+
|
|
62
83
|
return response.data;
|
|
63
84
|
} catch (error) {
|
|
64
85
|
if (error.response?.status === 401) {
|
|
65
86
|
throw new Error('Invalid token or unauthorized. Please check your credentials.');
|
|
87
|
+
} else if (error.code === 'ECONNABORTED') {
|
|
88
|
+
throw new Error('Request timeout. Please check your network connection.');
|
|
89
|
+
} else if (error.code === 'ENOTFOUND' || error.code === 'ECONNREFUSED') {
|
|
90
|
+
throw new Error('Network error. Please check your internet connection.');
|
|
66
91
|
}
|
|
67
92
|
throw new Error(`API request failed: ${error.message}`);
|
|
68
93
|
}
|
|
69
94
|
}
|
|
70
95
|
|
|
96
|
+
// 清除缓存
|
|
97
|
+
clearCache() {
|
|
98
|
+
this.cache = {
|
|
99
|
+
data: null,
|
|
100
|
+
timestamp: 0
|
|
101
|
+
};
|
|
102
|
+
}
|
|
103
|
+
|
|
71
104
|
parseUsageData(apiData) {
|
|
72
105
|
if (!apiData.model_remains || apiData.model_remains.length === 0) {
|
|
73
106
|
throw new Error('No usage data available');
|
|
@@ -114,7 +147,8 @@ class MinimaxAPI {
|
|
|
114
147
|
text: hours > 0 ? `${hours} 小时 ${minutes} 分钟后重置` : `${minutes} 分钟后重置`
|
|
115
148
|
},
|
|
116
149
|
usage: {
|
|
117
|
-
used:
|
|
150
|
+
used: usedCount, // 修复:显示已使用次数,不是剩余次数
|
|
151
|
+
remaining: remainingCount, // 新增:剩余次数
|
|
118
152
|
total: modelData.current_interval_total_count,
|
|
119
153
|
percentage: usedPercentage
|
|
120
154
|
}
|
package/cli/index.js
CHANGED
|
@@ -25,6 +25,70 @@ program
|
|
|
25
25
|
console.log(chalk.green("✓ 认证信息已保存"));
|
|
26
26
|
});
|
|
27
27
|
|
|
28
|
+
// Health check command
|
|
29
|
+
program
|
|
30
|
+
.command("health")
|
|
31
|
+
.description("检查配置和连接状态")
|
|
32
|
+
.action(async () => {
|
|
33
|
+
const spinner = ora("正在检查...").start();
|
|
34
|
+
let checks = {
|
|
35
|
+
config: false,
|
|
36
|
+
token: false,
|
|
37
|
+
groupId: false,
|
|
38
|
+
api: false
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
// 检查配置文件
|
|
42
|
+
try {
|
|
43
|
+
const configPath = require('path').join(
|
|
44
|
+
process.env.HOME || process.env.USERPROFILE,
|
|
45
|
+
'.minimax-config.json'
|
|
46
|
+
);
|
|
47
|
+
if (require('fs').existsSync(configPath)) {
|
|
48
|
+
checks.config = true;
|
|
49
|
+
}
|
|
50
|
+
spinner.succeed("配置文件检查");
|
|
51
|
+
} catch (error) {
|
|
52
|
+
spinner.fail("配置文件检查失败");
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
// 检查Token
|
|
56
|
+
if (api.token) {
|
|
57
|
+
checks.token = true;
|
|
58
|
+
console.log(chalk.green("✓ Token: ") + chalk.gray("已配置"));
|
|
59
|
+
} else {
|
|
60
|
+
console.log(chalk.red("✗ Token: ") + chalk.gray("未配置"));
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
// 检查GroupID
|
|
64
|
+
if (api.groupId) {
|
|
65
|
+
checks.groupId = true;
|
|
66
|
+
console.log(chalk.green("✓ GroupID: ") + chalk.gray("已配置"));
|
|
67
|
+
} else {
|
|
68
|
+
console.log(chalk.red("✗ GroupID: ") + chalk.gray("未配置"));
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
// 测试API连接
|
|
72
|
+
if (checks.token && checks.groupId) {
|
|
73
|
+
try {
|
|
74
|
+
await api.getUsageStatus();
|
|
75
|
+
checks.api = true;
|
|
76
|
+
console.log(chalk.green("✓ API连接: ") + chalk.gray("正常"));
|
|
77
|
+
} catch (error) {
|
|
78
|
+
console.log(chalk.red("✗ API连接: ") + chalk.gray(error.message));
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
// 总结
|
|
83
|
+
console.log("\n" + chalk.bold("健康检查结果:"));
|
|
84
|
+
const allPassed = Object.values(checks).every(v => v);
|
|
85
|
+
if (allPassed) {
|
|
86
|
+
console.log(chalk.green("✓ 所有检查通过,配置正常!"));
|
|
87
|
+
} else {
|
|
88
|
+
console.log(chalk.yellow("⚠ 发现问题,请检查上述错误信息"));
|
|
89
|
+
}
|
|
90
|
+
});
|
|
91
|
+
|
|
28
92
|
// Status command
|
|
29
93
|
program
|
|
30
94
|
.command("status")
|
|
@@ -289,7 +353,7 @@ program
|
|
|
289
353
|
statusLine += `${usageColor(percentage + '%')} | `;
|
|
290
354
|
|
|
291
355
|
// 剩余次数
|
|
292
|
-
statusLine += `${chalk.yellow('↻')} ${chalk.white(usage.
|
|
356
|
+
statusLine += `${chalk.yellow('↻')} ${chalk.white(usage.remaining + '/' + usage.total)} | `;
|
|
293
357
|
|
|
294
358
|
// 上下文使用情况(参考ccline:⚡ 百分比 · token数/总大小)
|
|
295
359
|
if (contextUsageTokens) {
|
package/cli/status.js
CHANGED
|
@@ -27,7 +27,7 @@ class StatusBar {
|
|
|
27
27
|
`│ ${chalk.cyan('剩余时间:')} ${remaining.text}${' '.repeat(30 - remaining.text.length)} ${chalk.dim('│')}`,
|
|
28
28
|
`│ ${chalk.dim('│')}`,
|
|
29
29
|
`│ ${chalk.cyan('已用额度:')} ${progressBar} ${usage.percentage}% ${chalk.dim('│')}`,
|
|
30
|
-
`│ ${chalk.dim(' 剩余:')} ${usage.
|
|
30
|
+
`│ ${chalk.dim(' 剩余:')} ${usage.remaining}/${usage.total} 次调用`.padEnd(43) + chalk.dim('│'),
|
|
31
31
|
`│ ${chalk.dim('│')}`,
|
|
32
32
|
this.getStatusLine(usage.percentage),
|
|
33
33
|
chalk.bold.blue('└─────────────────────────────────────────────────────────────┘')
|
|
@@ -100,7 +100,7 @@ class StatusBar {
|
|
|
100
100
|
color = chalk.green;
|
|
101
101
|
}
|
|
102
102
|
|
|
103
|
-
return `${color('●')} ${modelName} ${usage.percentage}% ${chalk.dim(`(${usage.
|
|
103
|
+
return `${color('●')} ${modelName} ${usage.percentage}% ${chalk.dim(`(${usage.remaining}/${usage.total})`)} ${chalk.gray('•')} ${remaining.text} ${chalk.gray('•')} ${status}`;
|
|
104
104
|
}
|
|
105
105
|
}
|
|
106
106
|
|
package/package.json
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "minimax-status",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.5",
|
|
4
4
|
"description": "MiniMax Claude Code 使用状态监控工具",
|
|
5
5
|
"bin": {
|
|
6
|
-
"minimax-status": "
|
|
7
|
-
"minimax": "
|
|
6
|
+
"minimax-status": "cli/index.js",
|
|
7
|
+
"minimax": "cli/index.js"
|
|
8
8
|
},
|
|
9
9
|
"scripts": {
|
|
10
10
|
"test": "echo \"Error: no test specified\" && exit 1"
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
{
|
|
2
|
+
"env": {
|
|
3
|
+
"browser": true,
|
|
4
|
+
"es2021": true,
|
|
5
|
+
"node": true,
|
|
6
|
+
"mocha": true
|
|
7
|
+
},
|
|
8
|
+
"extends": "eslint:recommended",
|
|
9
|
+
"parserOptions": {
|
|
10
|
+
"ecmaVersion": "latest",
|
|
11
|
+
"sourceType": "module"
|
|
12
|
+
},
|
|
13
|
+
"globals": {
|
|
14
|
+
"suite": "readonly",
|
|
15
|
+
"test": "readonly"
|
|
16
|
+
},
|
|
17
|
+
"rules": {}
|
|
18
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 Jochen Yang
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
# MiniMax Status - VS Code 扩展
|
|
2
|
+
|
|
3
|
+
MiniMax coding-plan 使用状态监控 VS Code 扩展,在底部状态栏实时显示你的使用额度。
|
|
4
|
+
|
|
5
|
+
## 功能特性
|
|
6
|
+
|
|
7
|
+
- ✅ **实时状态栏显示** - 在 VS Code 底部状态栏显示当前使用状态
|
|
8
|
+
- ✅ **多信息展示** - 显示目录、模型、使用率、剩余次数、上下文窗口
|
|
9
|
+
- ✅ **智能颜色提示** - 根据使用率自动变色(绿色/黄色/红色)
|
|
10
|
+
- ✅ **可配置设置** - 支持自定义刷新间隔和显示选项
|
|
11
|
+
- ✅ **悬停提示** - 鼠标悬停查看详细信息
|
|
12
|
+
|
|
13
|
+
## 安装扩展
|
|
14
|
+
|
|
15
|
+
### 手动安装 VSIX 文件
|
|
16
|
+
|
|
17
|
+
目前扩展尚未发布到 VS Code 市场,请按以下步骤手动安装:
|
|
18
|
+
|
|
19
|
+
#### 方法一:下载最新 VSIX 文件
|
|
20
|
+
|
|
21
|
+
1. 访问 [GitHub Releases 页面](https://github.com/JochenYang/minimax-status/releases)
|
|
22
|
+
2. 下载最新的 `.vsix` 文件(例如:`minimax-status-vscode-1.0.0.vsix`)
|
|
23
|
+
3. 在 VS Code 中按 `Ctrl+Shift+P`
|
|
24
|
+
4. 输入 "Extensions: Install from VSIX..."
|
|
25
|
+
5. 选择下载的 `.vsix` 文件
|
|
26
|
+
|
|
27
|
+
#### 方法二:从源码构建
|
|
28
|
+
|
|
29
|
+
1. 克隆本仓库:`git clone https://github.com/JochenYang/minimax-status.git`
|
|
30
|
+
2. 进入扩展目录:`cd vscode-extension`
|
|
31
|
+
3. 安装依赖:`npm install`
|
|
32
|
+
4. 打包扩展:`npm run package`
|
|
33
|
+
5. 在 VS Code 中安装生成的 `.vsix` 文件
|
|
34
|
+
|
|
35
|
+
## 快速开始
|
|
36
|
+
|
|
37
|
+
### 1. 配置认证信息
|
|
38
|
+
|
|
39
|
+
安装后,你需要配置 MiniMax 的访问令牌:
|
|
40
|
+
|
|
41
|
+
1. 使用命令 "MiniMax Status: 配置向导" 打开设置界面
|
|
42
|
+
2. 或点击状态栏的"需要配置"按钮
|
|
43
|
+
|
|
44
|
+
#### 必需配置
|
|
45
|
+
|
|
46
|
+
- **MiniMax API Key**: 你的 API 访问令牌
|
|
47
|
+
- **MiniMax GroupID**: 你的组 ID
|
|
48
|
+
|
|
49
|
+
#### 可选配置
|
|
50
|
+
|
|
51
|
+
- **刷新间隔**: 默认 30 秒(建议 10-30 秒)
|
|
52
|
+
- **显示提示**: 默认开启(鼠标悬停显示详细信息)
|
|
53
|
+
|
|
54
|
+
### 2. 获取认证信息
|
|
55
|
+
|
|
56
|
+
#### 获取 API Key
|
|
57
|
+
|
|
58
|
+
1. 访问 [MiniMax 开放平台](https://platform.minimaxi.com/user-center/payment/coding-plan)
|
|
59
|
+
2. 登录你的账户
|
|
60
|
+
3. 进入 "Coding Plan" 页面
|
|
61
|
+
4. 创建或获取 API Key
|
|
62
|
+
|
|
63
|
+
#### 获取 GroupID
|
|
64
|
+
|
|
65
|
+
1. 在用户中心或账户信息页面
|
|
66
|
+
2. 复制你的 **GroupID**
|
|
67
|
+
|
|
68
|
+
### 3. 查看状态栏
|
|
69
|
+
|
|
70
|
+
配置完成后,VS Code 底部状态栏将显示:
|
|
71
|
+
|
|
72
|
+
```
|
|
73
|
+
⏰ MiniMax-M2 8%
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
### 4. 鼠标悬停查看详情
|
|
77
|
+
|
|
78
|
+
将鼠标悬停在状态栏上,可查看详细的使用信息:
|
|
79
|
+
|
|
80
|
+
- 当前模型
|
|
81
|
+
- 使用进度
|
|
82
|
+
- 剩余时间
|
|
83
|
+
- 上下文窗口大小
|
|
84
|
+
|
|
85
|
+
## 状态说明
|
|
86
|
+
|
|
87
|
+
### 颜色编码
|
|
88
|
+
|
|
89
|
+
- 🟢 **绿色(< 60%)**: 正常使用
|
|
90
|
+
- 🟡 **黄色(60-85%)**: 注意使用
|
|
91
|
+
- 🔴 **红色(≥ 85%)**: 接近限制
|
|
92
|
+
|
|
93
|
+
### 状态图标
|
|
94
|
+
|
|
95
|
+
- ✓ 正常状态
|
|
96
|
+
- ⚡ 注意使用
|
|
97
|
+
- ⚠ 危险状态(即将达到限制)
|
|
98
|
+
|
|
99
|
+
## 显示信息说明
|
|
100
|
+
|
|
101
|
+
| 显示项 | 示例 | 说明 |
|
|
102
|
+
| ---------- | ------------ | ---------------------- |
|
|
103
|
+
| 📁 目录 | `my-project` | 当前工作目录 |
|
|
104
|
+
| 🤖 模型 | `MiniMax-M2` | 当前使用的模型 |
|
|
105
|
+
| 使用率 | `40%` | 已使用额度百分比 |
|
|
106
|
+
| ↻ 剩余次数 | `2690/4500` | 剩余次数 / 总次数 |
|
|
107
|
+
| 上下文窗口 | `200K` | 当前模型的上下文大小 |
|
|
108
|
+
| ⏱ 剩余时间 | `35m` | 距离额度重置的剩余时间 |
|
|
109
|
+
|
|
110
|
+
## 常见问题
|
|
111
|
+
|
|
112
|
+
### Q: 状态栏不显示?
|
|
113
|
+
|
|
114
|
+
**A**: 请检查:
|
|
115
|
+
|
|
116
|
+
1. 是否已正确配置 Token 和 GroupId
|
|
117
|
+
2. 扩展是否已激活(重启 VS Code)
|
|
118
|
+
3. 网络连接是否正常
|
|
119
|
+
|
|
120
|
+
### Q: 显示 "未配置" 或 "错误"?
|
|
121
|
+
|
|
122
|
+
**A**:
|
|
123
|
+
|
|
124
|
+
1. 检查 Token 是否正确(应以 `sk-` 开头)
|
|
125
|
+
2. 检查 GroupId 是否正确
|
|
126
|
+
3. 确认 MiniMax 账户有足够的额度
|
|
127
|
+
|
|
128
|
+
### Q: 状态更新不及时?
|
|
129
|
+
|
|
130
|
+
**A**:
|
|
131
|
+
|
|
132
|
+
1. 调整设置中的 "刷新间隔"(建议 10-30 秒)
|
|
133
|
+
2. 重启 VS Code
|
|
134
|
+
3. 手动触发:按 `Ctrl+Shift+P` → 输入 "MiniMax Status: Refresh"
|
|
135
|
+
|
|
136
|
+
### Q: 如何卸载扩展?
|
|
137
|
+
|
|
138
|
+
**A**:
|
|
139
|
+
|
|
140
|
+
1. 按 `Ctrl+Shift+X` 打开扩展商店
|
|
141
|
+
2. 找到 "MiniMax Status"
|
|
142
|
+
3. 点击 "卸载"
|
|
143
|
+
|
|
144
|
+
## 设置选项
|
|
145
|
+
|
|
146
|
+
### 完整设置列表
|
|
147
|
+
|
|
148
|
+
在 VS Code 设置中搜索 "MiniMax Status":
|
|
149
|
+
|
|
150
|
+
- **minimaxStatus.token**: MiniMax 访问令牌
|
|
151
|
+
- **minimaxStatus.groupId**: MiniMax Group ID
|
|
152
|
+
- **minimaxStatus.refreshInterval**: 刷新间隔(秒,范围 5-300)
|
|
153
|
+
- **minimaxStatus.showTooltip**: 是否显示详细提示信息(布尔值)
|
|
154
|
+
|
|
155
|
+
## 相关链接
|
|
156
|
+
|
|
157
|
+
- [MiniMax 开放平台](https://platform.minimaxi.com/)
|
|
158
|
+
|
|
159
|
+
---
|
|
160
|
+
|
|
161
|
+
**注意**: 本扩展仅用于显示 MiniMax Claude Code 使用状态,不存储或传输任何用户数据。认证信息仅保存在本地 VS Code 设置中。
|
package/vscode-extension/api.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
const axios = require('axios');
|
|
2
|
+
const vscode = require('vscode');
|
|
2
3
|
|
|
3
4
|
class MinimaxAPI {
|
|
4
5
|
constructor(context) {
|
|
@@ -49,10 +50,10 @@ class MinimaxAPI {
|
|
|
49
50
|
const startTime = new Date(modelData.start_time);
|
|
50
51
|
const endTime = new Date(modelData.end_time);
|
|
51
52
|
|
|
52
|
-
// Calculate used percentage
|
|
53
|
-
const
|
|
54
|
-
const
|
|
55
|
-
const usedPercentage = Math.round((
|
|
53
|
+
// Calculate used percentage based on usage count
|
|
54
|
+
const used = modelData.current_interval_total_count - modelData.current_interval_usage_count;
|
|
55
|
+
const total = modelData.current_interval_total_count;
|
|
56
|
+
const usedPercentage = Math.round((used / total) * 100);
|
|
56
57
|
|
|
57
58
|
// Calculate remaining time
|
|
58
59
|
const remainingMs = modelData.remains_time;
|
|
@@ -82,7 +83,7 @@ class MinimaxAPI {
|
|
|
82
83
|
text: hours > 0 ? `${hours} 小时 ${minutes} 分钟后重置` : `${minutes} 分钟后重置`
|
|
83
84
|
},
|
|
84
85
|
usage: {
|
|
85
|
-
used: modelData.current_interval_usage_count,
|
|
86
|
+
used: modelData.current_interval_total_count - modelData.current_interval_usage_count,
|
|
86
87
|
total: modelData.current_interval_total_count,
|
|
87
88
|
percentage: usedPercentage
|
|
88
89
|
}
|