@mcpcn/mcp-notification 1.1.2 → 1.1.3

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 (2) hide show
  1. package/dist/index.js +5 -4
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -12,11 +12,11 @@ function resolveChatSessionId(request) {
12
12
  }
13
13
  return undefined;
14
14
  };
15
- return (pick(request?.params?.arguments, ['chatSessionId', 'chatSessionID']) ??
16
- pick(request?.meta, ['chatSessionId', 'chatSessionID']) ??
17
- pick(request?.params?._meta, ['chatSessionId', 'chatSessionID']) ??
15
+ return (pick(request?.meta, ['chatSessionId', 'chatSessionID']) ??
18
16
  pick(request?.params?.meta, ['chatSessionId', 'chatSessionID']) ??
19
- pick(request?._meta, ['chatSessionId', 'chatSessionID']));
17
+ pick(request?.params?._meta, ['chatSessionId', 'chatSessionID']) ??
18
+ pick(request?._meta, ['chatSessionId', 'chatSessionID']) ??
19
+ pick(request?.params?.arguments, ['chatSessionId', 'chatSessionID']));
20
20
  }
21
21
  async function postJson(path, body, chatSessionId) {
22
22
  const headers = { 'Content-Type': 'application/json', Accept: 'application/json' };
@@ -142,6 +142,7 @@ class ReminderServer {
142
142
  }
143
143
  const name = request.params.name;
144
144
  const args = request.params.arguments;
145
+ console.error(`收到工具调用请求: ${name}, 输入: ${JSON.stringify(args)}`);
145
146
  const chatSessionId = resolveChatSessionId(request);
146
147
  if (!chatSessionId) {
147
148
  console.error('通知工具未在请求中检测到 chatSessionId(meta.chatSessionId)');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mcpcn/mcp-notification",
3
- "version": "1.1.2",
3
+ "version": "1.1.3",
4
4
  "description": "系统通知MCP服务器",
5
5
  "packageManager": "yarn@1.22.22",
6
6
  "main": "dist/index.js",