rol-websocket-channel 1.8.5 → 1.8.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/index.js CHANGED
@@ -307,7 +307,7 @@ const WebSocketChannel = {
307
307
  if (targetTopic.endsWith("#")) {
308
308
  targetTopic = targetTopic.slice(0, -1) + "bot";
309
309
  }
310
- conn.ws.publish(targetTopic, message, { retain: true });
310
+ conn.ws.publish(targetTopic, message, { retain: false });
311
311
  return { ok: true };
312
312
  },
313
313
  // sendMedia:框架传入字段见 ChannelMessageSendMediaContext(to = senderId,无 sessionKey/trace_id)
@@ -337,7 +337,7 @@ const WebSocketChannel = {
337
337
  if (targetTopic.endsWith("#")) {
338
338
  targetTopic = targetTopic.slice(0, -1) + "bot";
339
339
  }
340
- conn.ws.publish(targetTopic, message, { retain: true });
340
+ conn.ws.publish(targetTopic, message, { retain: false });
341
341
  return { ok: true };
342
342
  },
343
343
  },
@@ -400,7 +400,7 @@ const WebSocketChannel = {
400
400
  if (targetTopic.endsWith("#")) {
401
401
  targetTopic = targetTopic.slice(0, -1) + "bot";
402
402
  }
403
- conn.ws.publish(targetTopic, replyMessage, { retain: true });
403
+ conn.ws.publish(targetTopic, replyMessage, { retain: false });
404
404
  return {
405
405
  content: [{ type: "text", text: JSON.stringify({ ok: true }) }],
406
406
  details: {},
@@ -624,7 +624,7 @@ async function handleIncomingMessage(payload, account, cfg, runtime, log, mqttTo
624
624
  targetTopic = targetTopic.slice(0, -1) + 'app';
625
625
  }
626
626
  targetTopic = targetTopic.replace('device', 'app').replace('bot', 'app');
627
- conn.ws.publish(targetTopic, JSON.stringify(replyMessage), { retain: true });
627
+ conn.ws.publish(targetTopic, JSON.stringify(replyMessage), { retain: false });
628
628
  },
629
629
  onError: (err) => {
630
630
  log?.error(`[rol-websocket-channel] Delivery error: ${err.message} ${err.stack}`);
@@ -768,7 +768,7 @@ function publishCustomMessageResponse(response, innerData, mqttTopic) {
768
768
  targetTopic = targetTopic.slice(0, -1) + 'app';
769
769
  }
770
770
  targetTopic = targetTopic.replace('device', 'app').replace('bot', 'app');
771
- conn.ws.publish(targetTopic, JSON.stringify(response), { retain: true });
771
+ conn.ws.publish(targetTopic, JSON.stringify(response), { retain: false });
772
772
  }
773
773
  }
774
774
  // ============================================
package/index.ts CHANGED
@@ -375,7 +375,7 @@ const WebSocketChannel: any = {
375
375
  targetTopic = targetTopic.slice(0, -1) + "bot";
376
376
  }
377
377
 
378
- conn.ws.publish(targetTopic, message, { retain: true });
378
+ conn.ws.publish(targetTopic, message, { retain: false });
379
379
  return { ok: true };
380
380
  },
381
381
 
@@ -410,7 +410,7 @@ const WebSocketChannel: any = {
410
410
  targetTopic = targetTopic.slice(0, -1) + "bot";
411
411
  }
412
412
 
413
- conn.ws.publish(targetTopic, message, { retain: true });
413
+ conn.ws.publish(targetTopic, message, { retain: false });
414
414
  return { ok: true };
415
415
  },
416
416
  },
@@ -481,7 +481,7 @@ const WebSocketChannel: any = {
481
481
  targetTopic = targetTopic.slice(0, -1) + "bot";
482
482
  }
483
483
 
484
- conn.ws.publish(targetTopic, replyMessage, { retain: true });
484
+ conn.ws.publish(targetTopic, replyMessage, { retain: false });
485
485
 
486
486
  return {
487
487
  content: [{ type: "text" as const, text: JSON.stringify({ ok: true }) }],
@@ -782,7 +782,7 @@ async function handleIncomingMessage(
782
782
  }
783
783
  targetTopic = targetTopic.replace('device', 'app').replace('bot', 'app');
784
784
 
785
- conn.ws.publish(targetTopic, JSON.stringify(replyMessage), { retain: true });
785
+ conn.ws.publish(targetTopic, JSON.stringify(replyMessage), { retain: false });
786
786
  },
787
787
  onError: (err: Error) => {
788
788
  log?.error(`[rol-websocket-channel] Delivery error: ${err.message} ${err.stack}`);
@@ -960,7 +960,7 @@ function publishCustomMessageResponse(response: any, innerData: any, mqttTopic:
960
960
  }
961
961
  targetTopic = targetTopic.replace('device', 'app').replace('bot', 'app');
962
962
 
963
- conn.ws.publish(targetTopic, JSON.stringify(response), { retain: true });
963
+ conn.ws.publish(targetTopic, JSON.stringify(response), { retain: false });
964
964
  }
965
965
  }
966
966
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rol-websocket-channel",
3
- "version": "1.8.5",
3
+ "version": "1.8.7",
4
4
  "description": "Unified OpenClaw plugin: MQTT Channel + Admin Bridge for remote management",
5
5
  "license": "MIT",
6
6
  "author": "nixgnehc",