@youdu/openclaw-youdu 2026.5.6 → 2026.5.7
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/src/channel.js +1 -1
- package/dist/src/monitor.d.ts +2 -2
- package/dist/src/monitor.js +12 -5
- package/package.json +2 -2
package/dist/src/channel.js
CHANGED
package/dist/src/monitor.d.ts
CHANGED
package/dist/src/monitor.js
CHANGED
|
@@ -19,7 +19,11 @@ import { getDefaultMediaLocalRoots, resolveStateDir } from './openclaw-compat.js
|
|
|
19
19
|
function buildMessageContext(frame, account, config, text, mediaList) {
|
|
20
20
|
const core = getYouDuRuntime();
|
|
21
21
|
const body = frame.body;
|
|
22
|
-
const
|
|
22
|
+
const senderId = String(body.from.userId).trim();
|
|
23
|
+
const senderAccount = String(body.from.account).trim();
|
|
24
|
+
const senderName = String(body.from.name ?? "").trim();
|
|
25
|
+
const senderDisplay = senderName ? `${senderAccount} (${senderName})` : senderAccount;
|
|
26
|
+
const chatId = body.chatid || senderAccount;
|
|
23
27
|
const chatType = body.chattype === 'group' ? 'group' : 'direct';
|
|
24
28
|
const route = core.channel.routing.resolveAgentRoute({
|
|
25
29
|
cfg: config,
|
|
@@ -30,7 +34,9 @@ function buildMessageContext(frame, account, config, text, mediaList) {
|
|
|
30
34
|
id: chatId,
|
|
31
35
|
},
|
|
32
36
|
});
|
|
33
|
-
const fromLabel = chatType === 'group'
|
|
37
|
+
const fromLabel = chatType === 'group'
|
|
38
|
+
? `group:${chatId}`
|
|
39
|
+
: `user:${senderDisplay}`;
|
|
34
40
|
// 当只有媒体没有文本时,使用占位符标识媒体类型
|
|
35
41
|
const hasImages = mediaList.some((m) => m.contentType?.startsWith("image/"));
|
|
36
42
|
const messageBody = text || (mediaList.length > 0 ? (hasImages ? MEDIA_IMAGE_PLACEHOLDER : MEDIA_DOCUMENT_PLACEHOLDER) : "");
|
|
@@ -44,9 +50,10 @@ function buildMessageContext(frame, account, config, text, mediaList) {
|
|
|
44
50
|
RawBody: messageBody,
|
|
45
51
|
CommandBody: messageBody,
|
|
46
52
|
MessageSid: body.msgid,
|
|
47
|
-
From: chatType === 'group' ? `${CHANNEL_ID}:group:${chatId}` : `${CHANNEL_ID}:${
|
|
53
|
+
From: chatType === 'group' ? `${CHANNEL_ID}:group:${chatId}` : `${CHANNEL_ID}:${senderId}`,
|
|
48
54
|
To: `${CHANNEL_ID}:${chatId}`,
|
|
49
|
-
SenderId:
|
|
55
|
+
SenderId: senderId,
|
|
56
|
+
SenderName: senderDisplay,
|
|
50
57
|
SessionKey: route.sessionKey,
|
|
51
58
|
AccountId: account.accountId,
|
|
52
59
|
ChatType: chatType,
|
|
@@ -77,7 +84,7 @@ async function processYouDuMessage(params) {
|
|
|
77
84
|
const { frame, account, config, runtime, wsClient } = params;
|
|
78
85
|
const body = frame.body;
|
|
79
86
|
const chatId = body.chatid;
|
|
80
|
-
const youduAccount = body.from.account;
|
|
87
|
+
const youduAccount = String(body.from.account).trim();
|
|
81
88
|
const chatType = body.chattype === 'group' ? 'group' : 'direct';
|
|
82
89
|
const messageId = body.msgid;
|
|
83
90
|
const youduConfig = resolveYouDuAccount(config).config;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@youdu/openclaw-youdu",
|
|
3
|
-
"version": "2026.5.
|
|
3
|
+
"version": "2026.5.7",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "dist/index.esm.js",
|
|
6
6
|
"module": "dist/index.esm.js",
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
"channel": {
|
|
37
37
|
"id": "youdu",
|
|
38
38
|
"label": "有度",
|
|
39
|
-
"selectionLabel": "有度
|
|
39
|
+
"selectionLabel": "有度",
|
|
40
40
|
"docsPath": "/channels/youdu",
|
|
41
41
|
"docsLabel": "openclaw-youdu",
|
|
42
42
|
"blurb": "有度机器人接入插件",
|