claw-subagent-service 0.0.120 → 0.0.122
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/package.json
CHANGED
|
@@ -639,6 +639,8 @@ class MessageHandler {
|
|
|
639
639
|
const contentObj = JSON.parse(content);
|
|
640
640
|
if (contentObj.sightUrl) {
|
|
641
641
|
sightUrl = contentObj.sightUrl;
|
|
642
|
+
name = contentObj.name || '未知视频';
|
|
643
|
+
duration = contentObj.duration || 0;
|
|
642
644
|
}
|
|
643
645
|
} catch (e) {
|
|
644
646
|
// content 不是 JSON,可能是 base64 缩略图
|
|
@@ -172,6 +172,9 @@ class RongCloudClient {
|
|
|
172
172
|
// command 等结构化消息保留完整 JSON(上层需要 msg_type 等字段)
|
|
173
173
|
if (message.messageType === 'command' || rawContent.msg_type) {
|
|
174
174
|
rawContent = JSON.stringify(rawContent);
|
|
175
|
+
} else if (['RC:ImgMsg', 'RC:SightMsg', 'RC:FileMsg', 'RC:HQVCMsg'].includes(message.messageType)) {
|
|
176
|
+
// 媒体消息保留完整对象,以便上层提取 URL
|
|
177
|
+
rawContent = JSON.stringify(rawContent);
|
|
175
178
|
} else {
|
|
176
179
|
rawContent = rawContent.content || rawContent.text || JSON.stringify(rawContent);
|
|
177
180
|
}
|
|
@@ -199,8 +202,11 @@ class RongCloudClient {
|
|
|
199
202
|
}
|
|
200
203
|
}
|
|
201
204
|
|
|
205
|
+
// 对于媒体消息,保留完整的 JSON 字符串,不要提取 content 字段
|
|
202
206
|
const userContent = parsed && !parsed.msg_type
|
|
203
|
-
? (
|
|
207
|
+
? (['RC:ImgMsg', 'RC:SightMsg', 'RC:FileMsg', 'RC:HQVCMsg'].includes(msgType)
|
|
208
|
+
? JSON.stringify(parsed)
|
|
209
|
+
: (parsed.content || parsed.text || JSON.stringify(parsed)))
|
|
204
210
|
: content;
|
|
205
211
|
|
|
206
212
|
if (!userContent || !userContent.trim || !userContent.trim()) {
|