chaimi-keep-mcp 3.3.3-beta.14 → 3.3.3-beta.16

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/README.md +8 -0
  2. package/package.json +1 -1
  3. package/server.js +20 -19
package/README.md CHANGED
@@ -89,6 +89,14 @@ export MCP_PROMPT_URL="你的Prompt服务地址"
89
89
 
90
90
  ## Changelog
91
91
 
92
+ ### v3.3.3-beta.16 (2026-04-30)
93
+ - **修复** npm 发布版本号冲突 - 重新发布,解决版本号已被占用问题
94
+
95
+ ### v3.3.3-beta.15 (2026-04-30)
96
+ - **修复** mcp-server-local case 重复问题 - 修复 convertParams 中第二个 `case 'save_receipt'` 实际应该是 `case 'get_expenses'` 的严重问题
97
+ - **优化** save_expense 字段支持 - 新增 `productCategory` 和 `productSubCategory` 字段支持,与 save_receipt 保持一致
98
+ - **优化** 文本记账 prompt 更新 - 更新 mcpPrompt 文本记账 prompt,新增商品分类体系说明
99
+
92
100
  ### v3.3.3-beta.13 (2026-04-30)
93
101
  - **变更** 多端记账分类统一 - 支持商品分类和记账分类分离
94
102
  - 保持 `category`(记账分类,43个标准分类)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "chaimi-keep-mcp",
3
- "version": "3.3.3-beta.14",
3
+ "version": "3.3.3-beta.16",
4
4
  "description": "柴米AI记账 MCP Server - 支持 Claude、Cursor、OpenClaw、WorkBuddy 等 AI 工具直接记账",
5
5
  "main": "server.js",
6
6
  "bin": {
package/server.js CHANGED
@@ -1194,10 +1194,10 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
1194
1194
  if (invalidItems.length > 0) {
1195
1195
  result = {
1196
1196
  success: false,
1197
- error: `商品数据不完整:${invalidItems.join('; ')}。每个商品必须包含:name, amount, price, quantity, category`,
1197
+ error: `商品数据不完整:${invalidItems.join('; ')}。每个商品必须包含:name, amount, price, quantity, productCategory, category`,
1198
1198
  code: 400
1199
1199
  };
1200
- userMessage = `❌ 保存失败\n\n错误:商品数据格式不完整\n\n${invalidItems.join('\n')}\n\n💡 解决方案:\n1. 请更新您的柴米AI记账 MCP Skill\n2. 确保每个商品包含完整的5个字段:name, amount, price, quantity, category\n3. category 是记账的基本信息,不能为空`;
1200
+ userMessage = `❌ 保存失败\n\n错误:商品数据格式不完整\n\n${invalidItems.join('\n')}\n\n💡 解决方案:\n1. 请更新您的柴米AI记账 MCP Skill\n2. 确保每个商品包含完整的6个字段:name, amount, price, quantity, productCategory, category\n3. productCategory 是商品分类,category 是记账分类,都是必填项`;
1201
1201
  break;
1202
1202
  }
1203
1203
 
@@ -2117,6 +2117,8 @@ function convertParams(toolName, args) {
2117
2117
  amount: amount,
2118
2118
  price: amount,
2119
2119
  quantity: 1,
2120
+ productCategory: sanitizeString(args.productCategory, 50) || '其他',
2121
+ productSubCategory: sanitizeString(args.productSubCategory, 50) || '',
2120
2122
  category: sanitizeString(args.category, 50) || '其他',
2121
2123
  unit: sanitizeString(args.unit, 20) || '',
2122
2124
  weight: '',
@@ -2154,22 +2156,21 @@ function convertParams(toolName, args) {
2154
2156
  const marketPrice = sanitizeString(item.marketPrice, 50) || calculateMarketPrice(amount, weight);
2155
2157
 
2156
2158
  return {
2157
- itemIndex: index,
2158
- name: sanitizeString(item.name, 100),
2159
- originalName: sanitizeString(item.originalName, 200) || sanitizeString(item.name, 100),
2160
- amount: amount,
2161
- // 【改造】新字段
2162
- productCategory: sanitizeString(item.productCategory, 50) || '其他',
2163
- productSubCategory: sanitizeString(item.productSubCategory, 50) || '',
2164
- category: sanitizeString(item.category, 50) || '其他',
2165
- transactionType: sanitizeString(item.transactionType, 50) || 'expense',
2166
- price: validateAmount(item.price),
2167
- quantity: item.quantity ? String(item.quantity).substring(0, 20) : '1',
2168
- unit: sanitizeString(item.unit, 20),
2169
- weight: weight,
2170
- marketPrice: marketPrice,
2171
- note: sanitizeString(item.note, 500),
2172
- };
2159
+ itemIndex: index,
2160
+ name: sanitizeString(item.name, 100),
2161
+ originalName: sanitizeString(item.originalName, 200) || sanitizeString(item.name, 100),
2162
+ amount: amount,
2163
+ productCategory: sanitizeString(item.productCategory, 50) || '其他',
2164
+ productSubCategory: sanitizeString(item.productSubCategory, 50) || '',
2165
+ category: sanitizeString(item.category, 50) || '其他',
2166
+ transactionType: sanitizeString(item.transactionType, 50) || 'expense',
2167
+ price: validateAmount(item.price),
2168
+ quantity: item.quantity ? String(item.quantity).substring(0, 20) : '1',
2169
+ unit: sanitizeString(item.unit, 20),
2170
+ weight: weight,
2171
+ marketPrice: marketPrice,
2172
+ note: sanitizeString(item.note, 500),
2173
+ };
2173
2174
  }),
2174
2175
  store: sanitizeString(args.store, 100),
2175
2176
  receiptNo: sanitizeString(args.receiptNo, 50),
@@ -2193,7 +2194,7 @@ function convertParams(toolName, args) {
2193
2194
  };
2194
2195
  }
2195
2196
 
2196
- case 'save_receipt': {
2197
+ case 'get_expenses': {
2197
2198
  // 【新增】支持 period 参数
2198
2199
  const periodDates = args.period ? parsePeriod(args.period) : {};
2199
2200
  return {