@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.
- package/dist/index.js +5 -4
- 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?.
|
|
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)');
|