@coclaw/openclaw-coclaw 0.3.0 → 0.3.1

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/index.js CHANGED
@@ -70,7 +70,7 @@ const plugin = {
70
70
 
71
71
  api.registerGatewayMethod('coclaw.refreshBridge', async ({ respond }) => {
72
72
  try {
73
- await refreshRealtimeBridge();
73
+ await refreshRealtimeBridge({ logger, pluginConfig: api.pluginConfig });
74
74
  respond(true, { status: 'refreshed' });
75
75
  }
76
76
  catch (err) {
@@ -148,7 +148,7 @@ const plugin = {
148
148
  code: positionals[0],
149
149
  serverUrl,
150
150
  });
151
- await refreshRealtimeBridge();
151
+ await refreshRealtimeBridge({ logger, pluginConfig: api.pluginConfig });
152
152
  return { text: bindOk(result) };
153
153
  }
154
154
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@coclaw/openclaw-coclaw",
3
- "version": "0.3.0",
3
+ "version": "0.3.1",
4
4
  "type": "module",
5
5
  "license": "Apache-2.0",
6
6
  "description": "OpenClaw CoClaw channel plugin for remote chat",
@@ -721,8 +721,12 @@ export async function startRealtimeBridge(opts) {
721
721
  await singleton.start(opts);
722
722
  }
723
723
 
724
- export async function refreshRealtimeBridge() {
724
+ export async function refreshRealtimeBridge(opts) {
725
725
  if (!singleton) {
726
+ // stop 后 singleton 被清除,需重新创建(如 bind 后重连)
727
+ if (opts) {
728
+ await startRealtimeBridge(opts);
729
+ }
726
730
  return;
727
731
  }
728
732
  await singleton.refresh();