chaimi-bookkeeping-mcp 2.3.0 → 2.3.2

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 (3) hide show
  1. package/bin/cli.js +5 -1
  2. package/oauth.js +4 -2
  3. package/package.json +1 -1
package/bin/cli.js CHANGED
@@ -10,6 +10,10 @@ const fs = require('fs');
10
10
  const os = require('os');
11
11
  const { spawn } = require('child_process');
12
12
 
13
+ // 读取 package.json 获取版本
14
+ const packageJson = JSON.parse(fs.readFileSync(path.join(__dirname, '..', 'package.json'), 'utf8'));
15
+ const CURRENT_VERSION = packageJson.version;
16
+
13
17
  // 获取 server.js 的绝对路径
14
18
  const serverPath = path.join(__dirname, '..', 'server.js');
15
19
 
@@ -183,7 +187,7 @@ function configureAllAgents() {
183
187
  function showWelcome() {
184
188
  console.log('╔════════════════════════════════════════════════════════╗');
185
189
  console.log('║ ║');
186
- console.log('║ 柴米记账 MCP Server v2.1.0 ║');
190
+ console.log(`║ 柴米记账 MCP Server v${CURRENT_VERSION} ║`);
187
191
  console.log('║ ║');
188
192
  console.log('║ 支持: OpenClaw | WorkBuddy | Claude | Cursor ║');
189
193
  console.log('║ ║');
package/oauth.js CHANGED
@@ -101,10 +101,11 @@ class OAuthManager {
101
101
  console.log('');
102
102
  console.log('⏳ 等待用户授权,请勿关闭窗口...');
103
103
  console.log(' (请在手机微信中完成授权操作)');
104
+ console.log(' 授权完成后会自动继续,无需手动告知');
104
105
  console.log('');
105
106
  const token = await this.pollForToken(
106
107
  deviceCodeRes.deviceCode,
107
- deviceCodeRes.interval * 1000 || 5000
108
+ 2000 // 固定2秒轮询,更快响应
108
109
  );
109
110
 
110
111
  // 4. 存储 Token
@@ -332,7 +333,8 @@ class OAuthManager {
332
333
  // 处理错误
333
334
  if (result.error === 'authorization_pending') {
334
335
  // 仍在等待授权,继续轮询
335
- process.stdout.write('.');
336
+ const elapsedSeconds = attempts * (interval / 1000);
337
+ process.stdout.write(`\r 等待中... ${elapsedSeconds}秒(请在小程完成授权)`);
336
338
  continue;
337
339
  }
338
340
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "chaimi-bookkeeping-mcp",
3
- "version": "2.3.0",
3
+ "version": "2.3.2",
4
4
  "description": "柴米记账 MCP Server - 支持 Claude、Cursor、OpenClaw、WorkBuddy 等 AI 工具直接记账",
5
5
  "main": "server.js",
6
6
  "bin": {