chaimi-keep-mcp 3.1.44-beta.3 → 3.1.44-beta.4

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 +12 -0
  2. package/package.json +1 -1
  3. package/server.js +14 -14
package/README.md CHANGED
@@ -141,6 +141,18 @@ AI 会自动调用 `save_income` 工具记录收入。
141
141
 
142
142
  ## 更新日志
143
143
 
144
+ ### v3.1.44-beta.4 (2026-04-21)
145
+ - **优化** 统一字段命名规范
146
+ - 将 `mcp_version` 改为 `mcpVersion`,统一使用驼峰命名法
147
+ - 符合项目 JavaScript 代码规范
148
+
149
+ ### v3.1.44-beta.3 (2026-04-21)
150
+ - **修复** MCP 调用日志字段缺失问题(完整修复)
151
+ - 修复所有日志记录阶段(request_received/cloud_calling/cloud_success/cloud_failed/validation_failed/mcp_error)
152
+ - 补充缺失字段:agentType、apiProvider、mcp_version、params
153
+ - 修改 callMcpHubWithLogging 函数签名,添加 agentType/apiProvider 参数
154
+ - 更新所有调用处(8处),正确传递元数据字段
155
+
144
156
  ### v3.1.44-beta.2 (2026-04-20)
145
157
  - **重构** `get_text_parse_prompt` 工具改为云端实现
146
158
  - 新增 `mcpPrompt` 云函数 `getTextParsePrompt` 工具
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "chaimi-keep-mcp",
3
- "version": "3.1.44-beta.3",
3
+ "version": "3.1.44-beta.4",
4
4
  "description": "柴米记账 MCP Server - 支持 Claude、Cursor、OpenClaw、WorkBuddy 等 AI 工具直接记账",
5
5
  "main": "server.js",
6
6
  "bin": {
package/server.js CHANGED
@@ -170,7 +170,7 @@ server.setRequestHandler(ListToolsRequestSchema, async () => {
170
170
  agentType: { type: 'string', description: '【必填】Agent类型,如:claude-desktop、cursor、openclaw、workbuddy、trae' },
171
171
  apiProvider: { type: 'string', description: '【必填】AI服务提供商,如:anthropic、openai、doubao、aliyun' },
172
172
  rawInput: { type: 'string', description: '【必填】用户的原始输入内容,用于记录用户原始请求' },
173
- mcp_version: { type: 'string', description: 'MCP Server 版本号(自动填充)' },
173
+ mcpVersion: { type: 'string', description: 'MCP Server 版本号(自动填充)' },
174
174
  },
175
175
  required: ['name', 'amount', 'category', 'agentType', 'apiProvider', 'rawInput'],
176
176
  },
@@ -214,7 +214,7 @@ server.setRequestHandler(ListToolsRequestSchema, async () => {
214
214
  agentType: { type: 'string', description: '【必填】Agent类型:claude-desktop、cursor、openclaw、workbuddy、trae' },
215
215
  apiProvider: { type: 'string', description: '【必填】AI服务提供商:anthropic、openai、doubao、aliyun' },
216
216
  rawInput: { type: 'string', description: '【必填】用户的原始输入内容' },
217
- mcp_version: { type: 'string', description: '【自动填充】MCP Server版本号' },
217
+ mcpVersion: { type: 'string', description: '【自动填充】MCP Server版本号' },
218
218
  },
219
219
  required: ['store', 'items', 'storeCategory', 'storeSubCategory', 'agentType', 'apiProvider', 'rawInput'],
220
220
  },
@@ -315,7 +315,7 @@ server.setRequestHandler(ListToolsRequestSchema, async () => {
315
315
  agentType: { type: 'string', description: '【必填】Agent类型,如:claude-desktop、cursor、openclaw、workbuddy、trae' },
316
316
  apiProvider: { type: 'string', description: '【必填】AI服务提供商,如:anthropic、openai、doubao、aliyun' },
317
317
  rawInput: { type: 'string', description: '【必填】用户的原始输入内容,用于记录用户原始请求' },
318
- mcp_version: { type: 'string', description: 'MCP Server 版本号(自动填充)' },
318
+ mcpVersion: { type: 'string', description: 'MCP Server 版本号(自动填充)' },
319
319
  },
320
320
  required: ['name', 'amount', 'category', 'agentType', 'apiProvider', 'rawInput'],
321
321
  },
@@ -547,7 +547,7 @@ async function callMcpHubWithLogging(tool, params, token, traceId, startTime, os
547
547
  params: sanitizeLogParams(params),
548
548
  agentType: agentType || '',
549
549
  apiProvider: apiProvider || '',
550
- mcp_version: MCP_VERSION,
550
+ mcpVersion: MCP_VERSION,
551
551
  osType: osInfo?.osType,
552
552
  osVersion: osInfo?.osVersion,
553
553
  timestamp: new Date().toISOString(),
@@ -565,7 +565,7 @@ async function callMcpHubWithLogging(tool, params, token, traceId, startTime, os
565
565
  duration: Date.now() - startTime,
566
566
  agentType: agentType || '',
567
567
  apiProvider: apiProvider || '',
568
- mcp_version: MCP_VERSION,
568
+ mcpVersion: MCP_VERSION,
569
569
  osType: osInfo?.osType,
570
570
  osVersion: osInfo?.osVersion,
571
571
  timestamp: new Date().toISOString(),
@@ -583,7 +583,7 @@ async function callMcpHubWithLogging(tool, params, token, traceId, startTime, os
583
583
  duration: Date.now() - startTime,
584
584
  agentType: agentType || '',
585
585
  apiProvider: apiProvider || '',
586
- mcp_version: MCP_VERSION,
586
+ mcpVersion: MCP_VERSION,
587
587
  osType: osInfo?.osType,
588
588
  osVersion: osInfo?.osVersion,
589
589
  timestamp: new Date().toISOString(),
@@ -682,7 +682,7 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
682
682
  params: sanitizeLogParams(args),
683
683
  agentType: args.agentType || process.env.AGENT_TYPE || process.env.MCP_AGENT_TYPE || '',
684
684
  apiProvider: args.apiProvider || process.env.API_PROVIDER || process.env.MCP_API_PROVIDER || '',
685
- mcp_version: MCP_VERSION,
685
+ mcpVersion: MCP_VERSION,
686
686
  osType: osInfo.osType,
687
687
  osVersion: osInfo.osVersion,
688
688
  timestamp: new Date().toISOString(),
@@ -703,7 +703,7 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
703
703
  duration: Date.now() - startTime,
704
704
  agentType: args.agentType || process.env.AGENT_TYPE || process.env.MCP_AGENT_TYPE || '',
705
705
  apiProvider: args.apiProvider || process.env.API_PROVIDER || process.env.MCP_API_PROVIDER || '',
706
- mcp_version: MCP_VERSION,
706
+ mcpVersion: MCP_VERSION,
707
707
  osType: osInfo.osType,
708
708
  osVersion: osInfo.osVersion,
709
709
  timestamp: new Date().toISOString(),
@@ -1414,7 +1414,7 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
1414
1414
  context: processedArgs.context || '',
1415
1415
  agentType: processedArgs.agentType || '',
1416
1416
  apiProvider: processedArgs.apiProvider || '',
1417
- mcp_version: MCP_VERSION,
1417
+ mcpVersion: MCP_VERSION,
1418
1418
  userAgent: request.headers?.['user-agent'] || ''
1419
1419
  };
1420
1420
 
@@ -1447,7 +1447,7 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
1447
1447
  const fullResponse = {
1448
1448
  userMessage: userMessage,
1449
1449
  result: result,
1450
- mcp_version: MCP_VERSION
1450
+ mcpVersion: MCP_VERSION
1451
1451
  };
1452
1452
 
1453
1453
  return {
@@ -1468,7 +1468,7 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
1468
1468
  duration: Date.now() - startTime,
1469
1469
  agentType: agentType || '',
1470
1470
  apiProvider: apiProvider || '',
1471
- mcp_version: MCP_VERSION,
1471
+ mcpVersion: MCP_VERSION,
1472
1472
  osType: osInfo.osType,
1473
1473
  osVersion: osInfo.osVersion,
1474
1474
  timestamp: new Date().toISOString(),
@@ -1709,7 +1709,7 @@ function convertParams(toolName, args) {
1709
1709
  rawInput: sanitizeString(args.rawInput, 1000) || '',
1710
1710
  agentType: args.agentType || '',
1711
1711
  apiProvider: args.apiProvider || '',
1712
- mcp_version: args.mcp_version || MCP_VERSION,
1712
+ mcpVersion: MCP_VERSION,
1713
1713
  source: 'mcp_txt_expense',
1714
1714
  };
1715
1715
  }
@@ -1763,7 +1763,7 @@ function convertParams(toolName, args) {
1763
1763
  rawInput: sanitizeString(args.rawInput, 2000),
1764
1764
  agentType: args.agentType || '',
1765
1765
  apiProvider: args.apiProvider || '',
1766
- mcp_version: args.mcp_version || MCP_VERSION,
1766
+ mcpVersion: MCP_VERSION,
1767
1767
  source: 'mcp_receipt',
1768
1768
  storeCategory: sanitizeString(args.storeCategory, 50) || '其他',
1769
1769
  storeSubCategory: sanitizeString(args.storeSubCategory, 50) || '其他',
@@ -1795,7 +1795,7 @@ function convertParams(toolName, args) {
1795
1795
  rawInput: sanitizeString(args.rawInput, 1000),
1796
1796
  agentType: args.agentType || '',
1797
1797
  apiProvider: args.apiProvider || '',
1798
- mcp_version: args.mcp_version || MCP_VERSION,
1798
+ mcpVersion: MCP_VERSION,
1799
1799
  source: 'mcp_txt_income',
1800
1800
  };
1801
1801