chaimi-keep-mcp 3.3.1-beta.0 → 3.3.1-beta.1

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 +7 -7
  2. package/package.json +1 -1
  3. package/server.js +18 -5
package/bin/cli.js CHANGED
@@ -293,13 +293,13 @@ function configureAllAgents() {
293
293
  * 注意:使用 console.error,避免污染 stdout(MCP 协议通信使用 stdout)
294
294
  */
295
295
  function showWelcome() {
296
- console.error('╔════════════════════════════════════════════════════════╗');
297
- console.error('║ ║');
298
- console.error(`║ 柴米记账 MCP Server v${CURRENT_VERSION} ║`);
299
- console.error('║ ║');
300
- console.error('║ 支持: OpenClaw | WorkBuddy | Claude | Cursor ║');
301
- console.error('║ ║');
302
- console.error('╚════════════════════════════════════════════════════════╝');
296
+ console.error('╔══════════════════════════════════════════════════════════════════════════════════╗');
297
+ console.error('║ ║');
298
+ console.error(`║ 柴米记账 MCP Server v${CURRENT_VERSION} ║`);
299
+ console.error('║ ║');
300
+ console.error('║ 支持: OpenClaw|hermes | WorkBuddy等国产小龙虾 | Claude | Cursor等支持 mcp的agent ║');
301
+ console.error('║ ║');
302
+ console.error('╚══════════════════════════════════════════════════════════════════════════════════╝');
303
303
  console.error('');
304
304
  }
305
305
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "chaimi-keep-mcp",
3
- "version": "3.3.1-beta.0",
3
+ "version": "3.3.1-beta.1",
4
4
  "description": "柴米记账 MCP Server - 支持 Claude、Cursor、OpenClaw、WorkBuddy 等 AI 工具直接记账",
5
5
  "main": "server.js",
6
6
  "bin": {
package/server.js CHANGED
@@ -23,9 +23,18 @@ const os = require('os');
23
23
  const fs = require('fs');
24
24
  const crypto = require('crypto');
25
25
 
26
- // 读取 package.json 获取版本
27
- const packageJson = JSON.parse(fs.readFileSync(path.join(__dirname, 'package.json'), 'utf8'));
28
- const MCP_VERSION = packageJson.version;
26
+ // 读取版本文件获取版本号
27
+ function getVersion() {
28
+ try {
29
+ const verFilePath = path.join(__dirname, 'VERSION');
30
+ return fs.readFileSync(verFilePath, 'utf8').trim();
31
+ } catch (e) {
32
+ // 如果版本文件不存在,从 package.json 兜底
33
+ const pkgJson = JSON.parse(fs.readFileSync(path.join(__dirname, 'package.json'), 'utf8'));
34
+ return pkgJson.version;
35
+ }
36
+ }
37
+ const MCP_VERSION = getVersion();
29
38
 
30
39
  // 导入 OAuth 模块
31
40
  const { OAuthManager, FileTokenStorage } = require('./oauth.js');
@@ -266,7 +275,7 @@ server.setRequestHandler(ListToolsRequestSchema, async () => {
266
275
  },
267
276
  {
268
277
  name: 'save_receipt',
269
- description: '【强制验证Token】【必须上传图片】保存购物小票/发票/收据图片。⚠️ 注意:必须是图片才能使用此工具记账,文字描述请用 save_expense。前置要求:先调用 get_skill 和 get_parse_prompt。items为商品数组,字段列表见 get_parse_prompt 返回的模板.',返回的模板。',
278
+ description: '【强制验证Token】【必须上传图片】保存购物小票/发票/收据图片。⚠️ 注意:必须是图片才能使用此工具记账,文字描述请用 save_expense。前置要求:先调用 get_skill 和 get_parse_prompt。items为商品数组,字段列表见 get_parse_prompt 返回的模板.',
270
279
  inputSchema: {
271
280
  type: 'object',
272
281
  properties: {
@@ -1073,7 +1082,11 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
1073
1082
  docs: '调用 get_skill() 获取详细使用指南'
1074
1083
  }
1075
1084
  };
1076
- userMessage = `❌ 保存失败\n\n错误:缺少必填字段:${missingFields.join(', ')}\n\n💡 解决方案:\n1. 请检查是否从 get_parse_prompt 的解析结果中提取了所有信息\n2. 确保传递以下字段:store、totalAmount、actualAmount、originalAmount、discountAmount、storeCategory、storeSubCategory\n3. 参考 SKILL.md 中的"小票字段核对清单"`;\n break;\n }\n \n // 数值校验
1085
+ userMessage = `❌ 保存失败\n\n错误:缺少必填字段:${missingFields.join(', ')}\n\n💡 解决方案:\n1. 请检查是否从 get_parse_prompt 的解析结果中提取了所有信息\n2. 确保传递以下字段:store、totalAmount、actualAmount、originalAmount、discountAmount、storeCategory、storeSubCategory\n3. 参考 SKILL.md 中的小票字段核对清单`;
1086
+ break;
1087
+ }
1088
+
1089
+ // 数值校验
1077
1090
  const amountFields = ['totalAmount', 'actualAmount', 'originalAmount'];
1078
1091
  for (const field of amountFields) {
1079
1092
  if (typeof processedArgs[field] !== 'number' || processedArgs[field] <= 0) {