claw-subagent-service 0.0.65 → 0.0.66

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.65",
3
+ "version": "0.0.66",
4
4
  "description": "虾说智能助手",
5
5
  "main": "cli.js",
6
6
  "bin": {
@@ -61,7 +61,7 @@ class DashboardReporter {
61
61
 
62
62
  start(getMacAddress) {
63
63
  const interval = 30000; // 30秒
64
- this.log?.info(`[DashboardReporter] 启动仪表盘上报定时器,间隔: ${interval}ms`);
64
+ // this.log?.info(`[DashboardReporter] 启动仪表盘上报定时器,间隔: ${interval}ms`);
65
65
 
66
66
  this.timer = setInterval(async () => {
67
67
  if (!this.rongcloudClient?.isConnected) return;
@@ -125,7 +125,7 @@ class DashboardReporter {
125
125
  try {
126
126
  const sent = await this.messageSender.sendProtocolMessage(msgType, data);
127
127
  if (sent) {
128
- this.log?.info(`[DashboardReporter] ${msgType} 发送成功`);
128
+ // this.log?.info(`[DashboardReporter] ${msgType} 发送成功`);
129
129
  } else {
130
130
  this.log?.warn(`[DashboardReporter] ${msgType} 发送失败`);
131
131
  }
@@ -438,8 +438,13 @@ class OpenClawClient {
438
438
 
439
439
  try {
440
440
  const data = JSON.parse(dataStr);
441
- const delta = data.choices?.[0]?.delta?.content;
442
- if (delta) {
441
+ // 尝试多个可能的内容字段,兼容不同版本 OpenClaw
442
+ const delta = data.choices?.[0]?.delta?.content
443
+ ?? data.choices?.[0]?.message?.content
444
+ ?? data.choices?.[0]?.text
445
+ ?? data.content
446
+ ?? data.delta;
447
+ if (typeof delta === 'string' && delta) {
443
448
  fullText += delta;
444
449
  try {
445
450
  await onDelta?.(delta);
@@ -447,6 +452,9 @@ class OpenClawClient {
447
452
  reject(err);
448
453
  return;
449
454
  }
455
+ } else {
456
+ // 调试:打印未识别的 SSE 数据结构
457
+ this.log?.info(`[OpenClawClient] SSE 原始数据(无delta): ${JSON.stringify(data).substring(0, 200)}`);
450
458
  }
451
459
  } catch {
452
460
  // 忽略无法解析的 JSON 行
@@ -226,7 +226,7 @@ class RongCloudClient {
226
226
  ? (RongIMLib.ConversationType?.GROUP || ConversationType.GROUP)
227
227
  : (RongIMLib.ConversationType?.PRIVATE || ConversationType.PRIVATE);
228
228
 
229
- this.log?.info(`[RongCloudClient] 发送消息 -> ${targetId} (Type: ${convType}): ${content.substring(0, 50)}`);
229
+ // this.log?.info(`[RongCloudClient] 发送消息 -> ${targetId} (Type: ${convType}): ${content.substring(0, 50)}`);
230
230
 
231
231
  const result = await RongIMLib.sendTextMessage(
232
232
  { conversationType: convType, targetId },
@@ -237,7 +237,7 @@ class RongCloudClient {
237
237
 
238
238
  if (result.code === 0 || result.code === 200) {
239
239
  const sentUId = result.data?.messageUId;
240
- this.log?.info(`[RongCloudClient] 发送成功, messageUId: ${sentUId}`);
240
+ // this.log?.info(`[RongCloudClient] 发送成功, messageUId: ${sentUId}`);
241
241
  // 将发送成功的 messageUId 加入短期缓存,用于过滤 SDK 回传的自己消息
242
242
  if (sentUId) {
243
243
  this.sentMessageUIds.add(sentUId);