chaimi-keep-mcp 3.1.43 → 3.1.44-beta.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 (4) hide show
  1. package/README.md +12 -0
  2. package/SKILL.md +1 -0
  3. package/package.json +1 -1
  4. package/server.js +21 -10
package/README.md CHANGED
@@ -141,6 +141,18 @@ AI 会自动调用 `save_income` 工具记录收入。
141
141
 
142
142
  ## 更新日志
143
143
 
144
+ ### v3.1.44-beta.1 (2026-04-20)
145
+ - **重构** `get_text_parse_prompt` 工具改为云端实现
146
+ - 新增 `mcpPrompt` 云函数 `getTextParsePrompt` 工具
147
+ - Prompt 包含43个标准分类(与手动记账分类完全一致)
148
+ - 返回字段格式符合入库标准(`date` 使用毫秒时间戳)
149
+ - **修复** MCP 调用日志字段缺失问题
150
+ - 在 `ListToolsRequestSchema` 中为 `get_text_parse_prompt` 添加 `agentType`/`apiProvider` 参数定义
151
+ - 确保日志记录时能正确采集调用来源信息
152
+ - **修复** Agent 超时和僵尸进程问题
153
+ - 原实现调用不存在的 `getTextParsePrompt` 云函数导致挂起
154
+ - 改为调用 `mcpPrompt` 云函数的正确接口
155
+
144
156
  ### v3.1.39 (2026-04-18)
145
157
  - **新增** 店铺分类字段支持:`storeCategory`(一级分类)、`storeSubCategory`(二级分类)
146
158
  - 小票记账时自动识别店铺分类(购物/美食/生活服务/其他)
package/SKILL.md CHANGED
@@ -162,6 +162,7 @@ Agent 必须输出:
162
162
 
163
163
  ### 辅助工具
164
164
  - **get_skill** - 【记账前必须调用】获取 Skill 文档
165
+ - **get_text_parse_prompt** - 获取文字记账解析模板(云端实现,包含43个标准分类)
165
166
  - **get_parse_prompt** - 获取小票解析模板
166
167
  - **get_expenses** - 查询支出记录(支持周/月周期!)
167
168
  - 新增 `period` 参数:支持 `this_week`、`last_week`、`this_month`、`last_month`
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "chaimi-keep-mcp",
3
- "version": "3.1.43",
3
+ "version": "3.1.44-beta.2",
4
4
  "description": "柴米记账 MCP Server - 支持 Claude、Cursor、OpenClaw、WorkBuddy 等 AI 工具直接记账",
5
5
  "main": "server.js",
6
6
  "bin": {
package/server.js CHANGED
@@ -320,6 +320,17 @@ server.setRequestHandler(ListToolsRequestSchema, async () => {
320
320
  required: ['name', 'amount', 'category', 'agentType', 'apiProvider', 'rawInput'],
321
321
  },
322
322
  },
323
+ {
324
+ name: 'get_text_parse_prompt',
325
+ description: '获取文字记账解析的Prompt模板,用于指导大模型如何解析用户输入的记账文字。返回的Prompt应作为system message,配合用户输入的记账文字作为user message调用大模型',
326
+ inputSchema: {
327
+ type: 'object',
328
+ properties: {
329
+ agentType: { type: 'string', description: '【推荐自动填充】Agent类型,如:claude-desktop、cursor、openclaw、workbuddy、trae' },
330
+ apiProvider: { type: 'string', description: '【推荐自动填充】AI服务提供商,如:anthropic、openai、doubao、aliyun' },
331
+ },
332
+ },
333
+ },
323
334
  {
324
335
  name: 'get_parse_prompt',
325
336
  description: '获取小票图片解析的Prompt模板,用于指导大模型如何格式化输出小票信息。返回的Prompt应作为system message,配合小票图片作为user message调用大模型',
@@ -1357,23 +1368,23 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
1357
1368
  }
1358
1369
 
1359
1370
  case 'get_text_parse_prompt': {
1360
- // 获取文字记账解析 Prompt
1361
- const textParseResult = await callMcpHubWithLogging('getTextParsePrompt', {}, token, traceId, startTime, osInfo);
1371
+ // 调用 mcpPrompt 云函数获取文字记账解析 Prompt
1372
+ const promptResult = await callMcpPrompt('getTextParsePrompt', {}, token);
1362
1373
 
1363
- if (textParseResult.success) {
1374
+ if (promptResult.success) {
1364
1375
  result = {
1365
1376
  success: true,
1366
1377
  data: {
1367
- prompt: textParseResult.data.prompt,
1368
- currentDate: textParseResult.data.currentDate,
1369
- currentTime: textParseResult.data.currentTime,
1370
- instructions: '请将返回的 prompt 作为 system message,把用户输入的记账文字作为 user message,调用大模型解析。解析完成后,调用 save_expense 或 save_income 工具保存结果。'
1378
+ prompt: promptResult.data.prompt,
1379
+ currentDate: promptResult.data.currentDate,
1380
+ currentTime: promptResult.data.currentTime,
1381
+ instructions: promptResult.data.instructions
1371
1382
  }
1372
1383
  };
1373
- userMessage = `✅ 获取文字记账解析 Prompt 成功\n\n当前日期: ${textParseResult.data.currentDate}\n当前时间: ${textParseResult.data.currentTime}\n\n## Prompt\n\n请将以下内容作为 system message 发送给大模型:\n\n\`\`\`\n${textParseResult.data.prompt}\n\`\`\`\n\n## 使用说明\n\n1. 将上面的 Prompt 作为 system message\n2. 将用户输入的记账文字(如"午餐 24块")作为 user message\n3. 调用大模型解析,获取 JSON 结果\n4. 解析完成后,调用 save_expense 或 save_income 工具保存结果\n\n## 解析结果示例\n\n\`\`\`json\n{\n "name": "午餐",\n "amount": 24,\n "category": "餐饮",\n "datetime": "2026-04-14T12:30:00+08:00",\n "transactionType": "expense"\n}\n\`\`\``;
1384
+ userMessage = `✅ 获取文字记账解析 Prompt 成功\n\n当前日期: ${promptResult.data.currentDate}\n当前时间: ${promptResult.data.currentTime}\n\n## Prompt\n\n请将以下内容作为 system message 发送给大模型:\n\n\`\`\`\n${promptResult.data.prompt}\n\`\`\`\n\n## 使用说明\n\n1. 将上面的 Prompt 作为 system message\n2. 将用户输入的记账文字(如"午餐 24块")作为 user message\n3. 调用大模型解析,获取 JSON 结果\n4. 解析完成后,调用 save_expense 或 save_income 工具保存结果`;
1374
1385
  } else {
1375
- result = { success: false, error: textParseResult.error };
1376
- userMessage = `❌ 获取文字记账解析 Prompt 失败:${textParseResult.error}`;
1386
+ result = { success: false, error: promptResult.error };
1387
+ userMessage = `❌ 获取文字记账解析 Prompt 失败:${promptResult.error}`;
1377
1388
  }
1378
1389
  break;
1379
1390
  }