claw-subagent-service 0.0.141 → 0.0.142

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.141",
3
+ "version": "0.0.142",
4
4
  "description": "虾说智能助手",
5
5
  "main": "cli.js",
6
6
  "bin": {
@@ -224,8 +224,9 @@ class RongyunMessageHandler {
224
224
  // 使用解析后的 content(聊天内容),如果没有则使用原始 content
225
225
  const content = data.content || data._raw_content;
226
226
  const requestId = data.request_id;
227
+ const sourceId = data.source_im_id;
227
228
 
228
- this.logInfo(`[RongyunMessageHandler] 收到聊天消息, roomId=${roomId}, sessionId=${sessionId}`);
229
+ this.logInfo(`[RongyunMessageHandler] 收到聊天消息, roomId=${roomId}, sessionId=${sessionId}, from=${sourceId}`);
229
230
 
230
231
  if (!roomId || !sessionId || !content) {
231
232
  await this.sendResponse(RongyunMessageTypeEnum.CHAT_MESSAGE, {
@@ -233,7 +234,7 @@ class RongyunMessageHandler {
233
234
  message: '缺少必要参数',
234
235
  content: '[错误] 缺少必要参数',
235
236
  metadata: {}
236
- }, requestId);
237
+ }, requestId, sourceId);
237
238
  return;
238
239
  }
239
240
 
@@ -258,7 +259,7 @@ class RongyunMessageHandler {
258
259
  message: 'Response received',
259
260
  content: fullResponse,
260
261
  metadata: {}
261
- }, requestId);
262
+ }, requestId, sourceId);
262
263
  } catch (e) {
263
264
  const msg = e instanceof Error ? e.message : String(e);
264
265
  this.logError(`聊天消息处理异常: ${msg}`);
@@ -267,15 +268,16 @@ class RongyunMessageHandler {
267
268
  message: msg,
268
269
  content: `[错误] 转发失败: ${msg}`,
269
270
  metadata: {}
270
- }, requestId);
271
+ }, requestId, sourceId);
271
272
  }
272
273
  }
273
274
 
274
275
  async handleCreateSession(data) {
275
276
  const requestId = data.request_id;
276
277
  const title = data.title || '新会话';
278
+ const sourceId = data.source_im_id;
277
279
 
278
- this.logInfo(`[RongyunMessageHandler] 创建会话, title=${title}`);
280
+ this.logInfo(`[RongyunMessageHandler] 创建会话, title=${title}, from=${sourceId}`);
279
281
 
280
282
  try {
281
283
  const session = await createOpencodeSession(title);
@@ -283,14 +285,14 @@ class RongyunMessageHandler {
283
285
  await this.sendResponse(RongyunMessageTypeEnum.OPENCODE_SESSION_CREATED, {
284
286
  status: 'success',
285
287
  opencode_session_id: session.id
286
- }, requestId);
288
+ }, requestId, sourceId);
287
289
  } catch (e) {
288
290
  const msg = e instanceof Error ? e.message : String(e);
289
291
  this.logError(`创建会话失败: ${msg}`);
290
292
  await this.sendResponse(RongyunMessageTypeEnum.OPENCODE_SESSION_CREATED, {
291
293
  status: 'error',
292
294
  message: msg
293
- }, requestId);
295
+ }, requestId, sourceId);
294
296
  }
295
297
  }
296
298