claw-subagent-service 0.0.155 → 0.0.157

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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "claw-subagent-service",
3
- "version": "0.0.155",
3
+ "version": "0.0.157",
4
4
  "description": "虾说智能助手",
5
5
  "main": "cli.js",
6
6
  "bin": {
@@ -178,9 +178,16 @@ class RongyunMessageSender {
178
178
  let result;
179
179
  if (this.rongcloudClient.ServiceChatMessage && msgType.includes('service')) {
180
180
  // 客服相关消息使用 service_chat 自定义消息类型
181
+ // 对于客服消息,直接将业务内容放在顶层,方便前端解析
182
+ const serviceChatPayload = {
183
+ msg_type: msgType,
184
+ ...content, // 展开业务内容(status, content, sessionId, userId 等)
185
+ request_id: requestId || '',
186
+ timestamp: Math.floor(Date.now() / 1000),
187
+ };
181
188
  result = await this.rongcloudClient.sendCustomMessage(
182
189
  targetId,
183
- messagePayload,
190
+ serviceChatPayload,
184
191
  1, // PRIVATE
185
192
  'service_chat'
186
193
  );
package/service/worker.js CHANGED
@@ -391,6 +391,7 @@ async function initRongCloud() {
391
391
  ...parsed,
392
392
  ...innerContent, // 展开 content 中的字段(如 command, command_id 等)
393
393
  content: typeof innerContent === 'object' ? innerContent.content : innerContent,
394
+ source_im_id: parsed.source_im_id || msg.senderUserId, // 确保下游 handler 能取到 source_im_id
394
395
  senderUserId: parsed.source_im_id || msg.senderUserId,
395
396
  targetId: msg.targetId,
396
397
  conversationType: msg.conversationType,