chaimi-keep-mcp 3.1.38 → 3.1.39-beta.0

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
@@ -141,6 +141,13 @@ AI 会自动调用 `save_income` 工具记录收入。
141
141
 
142
142
  ## 更新日志
143
143
 
144
+ ### v3.1.39 (2026-04-18)
145
+ - **新增** 店铺分类字段支持:`storeCategory`(一级分类)、`storeSubCategory`(二级分类)
146
+ - 小票记账时自动识别店铺分类(购物/美食/生活服务/其他)
147
+ - 支持二级细分类目(超市/便利店/中餐厅/药店等)
148
+ - 数据存储到 receipts 和 receipt_items 表,支持后续查询分析
149
+ - **修复** 日期格式提示:统一改为"毫秒级时间戳(13位数字)",与实际校验逻辑保持一致
150
+
144
151
  ### v3.1.38 (2026-04-16)
145
152
  - **优化** SKILL.md 时间戳说明:使用占位符避免 AI 抄写
146
153
  - 将示例时间戳改为占位符格式 `[毫秒时间戳]`
package/SKILL.md CHANGED
@@ -30,7 +30,7 @@ argument-hint: "[记账内容]"
30
30
  | **Cursor** | `Cmd+N` (Mac) / `Ctrl+N` (Windows) |
31
31
  | **Claude Desktop** | 点击 `+ New Chat` |
32
32
  | **OpenClaw** | 输入 `/new` |
33
- | **WorkBuddy** | 输入 `/new` |
33
+ | **WorkBuddy** | 输入 `/clear` |
34
34
  | **Trae** | `Cmd/Ctrl + N` 或点击 `+` 按钮 |
35
35
  | **其他 Agent** | 输入 `/new` 或菜单"新建会话" |
36
36
 
@@ -89,7 +89,8 @@ Agent 必须输出:
89
89
  Agent 根据当前环境,向用户说明开启新会话的具体操作方式:
90
90
  - **Cursor**: 按 `Cmd+N` (Mac) / `Ctrl+N` (Windows)
91
91
  - **Claude Desktop**: 点击 `+ New Chat`
92
- - **OpenClaw/WorkBuddy**: 输入 `/new`
92
+ - **OpenClaw**: 输入 `/new`
93
+ - **WorkBuddy**: 输入 `/clear`
93
94
  - **Trae**: 按 `Cmd/Ctrl + N` 或点击 `+` 按钮
94
95
  - **其他**: 输入 `/new` 或菜单"新建会话"
95
96
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "chaimi-keep-mcp",
3
- "version": "3.1.38",
3
+ "version": "3.1.39-beta.0",
4
4
  "description": "柴米记账 MCP Server - 支持 Claude、Cursor、OpenClaw、WorkBuddy 等 AI 工具直接记账",
5
5
  "main": "server.js",
6
6
  "bin": {
package/server.js CHANGED
@@ -187,6 +187,8 @@ server.setRequestHandler(ListToolsRequestSchema, async () => {
187
187
  originalAmount: { type: 'number', description: '(必填)应付金额(优惠前)' },
188
188
  discountAmount: { type: 'number', description: '(必填)优惠金额' },
189
189
  actualAmount: { type: 'number', description: '(必填)实付金额(优惠后)' },
190
+ storeCategory: { type: 'string', description: '【必填】店铺一级分类(购物/美食/生活服务/其他)' },
191
+ storeSubCategory: { type: 'string', description: '【必填】店铺二级分类(超市/便利店/中餐厅/药店等)' },
190
192
  paymentMethod: { type: 'string', description: '支付方式,如:微信支付、支付宝' },
191
193
  receiptNo: { type: 'string', description: '小票编号' },
192
194
  items: {
@@ -214,7 +216,7 @@ server.setRequestHandler(ListToolsRequestSchema, async () => {
214
216
  rawInput: { type: 'string', description: '【必填】用户的原始输入内容' },
215
217
  mcp_version: { type: 'string', description: '【自动填充】MCP Server版本号' },
216
218
  },
217
- required: ['store', 'items', 'agentType', 'apiProvider', 'rawInput'],
219
+ required: ['store', 'items', 'storeCategory', 'storeSubCategory', 'agentType', 'apiProvider', 'rawInput'],
218
220
  },
219
221
  },
220
222
  {
@@ -637,10 +639,10 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
637
639
  error: '日期格式无效',
638
640
  code: 400
639
641
  };
640
- userMessage = '❌ 记账失败:日期格式无效,请使用 ISO 8601 格式(如:2026-01-08T11:42:27)';
642
+ userMessage = '❌ 记账失败:日期格式无效,请使用毫秒级时间戳(13位数字,如:xxxxxxxxxxxxx)';
641
643
  break;
642
644
  }
643
-
645
+
644
646
  if (inputDate > now) {
645
647
  result = {
646
648
  success: false,
@@ -681,7 +683,7 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
681
683
 
682
684
  case 'save_receipt': {
683
685
  // P0: 数据完整性检查 - 必填字段验证(date 有兜底,不强制检查)
684
- const requiredFields = ['store', 'totalAmount', 'actualAmount', 'originalAmount', 'discountAmount'];
686
+ const requiredFields = ['store', 'totalAmount', 'actualAmount', 'originalAmount', 'discountAmount', 'storeCategory', 'storeSubCategory'];
685
687
  const missingFields = [];
686
688
 
687
689
  for (const field of requiredFields) {
@@ -696,7 +698,7 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
696
698
  error: `必填字段缺失:${missingFields.join(', ')}。请从 get_parse_prompt 的解析结果中提取并传递所有字段。`,
697
699
  code: 400
698
700
  };
699
- userMessage = `❌ 保存失败\n\n错误:缺少必填字段:${missingFields.join(', ')}\n\n💡 解决方案:\n1. 请检查是否从 get_parse_prompt 的解析结果中提取了所有信息\n2. 确保传递以下字段:store、totalAmount、actualAmount、originalAmount、discountAmount\n3. 参考 SKILL.md 中的"小票字段核对清单"`;
701
+ userMessage = `❌ 保存失败\n\n错误:缺少必填字段:${missingFields.join(', ')}\n\n💡 解决方案:\n1. 请检查是否从 get_parse_prompt 的解析结果中提取了所有信息\n2. 确保传递以下字段:store、totalAmount、actualAmount、originalAmount、discountAmount、storeCategory、storeSubCategory\n3. 参考 SKILL.md 中的"小票字段核对清单"`;
700
702
  break;
701
703
  }
702
704
 
@@ -774,7 +776,7 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
774
776
  error: '日期格式无效',
775
777
  code: 400
776
778
  };
777
- userMessage = '❌ 保存失败:日期格式无效,请使用 ISO 8601 格式(如:2026-01-08T11:42:27)';
779
+ userMessage = '❌ 保存失败:日期格式无效,请使用毫秒级时间戳(13位数字,如:xxxxxxxxxxxxx)';
778
780
  break;
779
781
  }
780
782