@nextclaw/openclaw-compat 0.3.31 → 0.3.32

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.
Files changed (2) hide show
  1. package/dist/index.js +25 -18
  2. package/package.json +8 -8
package/dist/index.js CHANGED
@@ -352,9 +352,10 @@ async function startPluginChannelGateways(params) {
352
352
  );
353
353
  const finalAccountIds = accountIds.length > 0 ? accountIds : ["default"];
354
354
  for (const accountId of finalAccountIds) {
355
- try {
356
- const abortController = new AbortController();
357
- const started = await gateway.startAccount({
355
+ const abortController = new AbortController();
356
+ let stopGateway;
357
+ const startTask = Promise.resolve().then(
358
+ async () => await gateway.startAccount?.({
358
359
  accountId,
359
360
  channelId: binding.channelId,
360
361
  cfg: configView,
@@ -368,20 +369,15 @@ async function startPluginChannelGateways(params) {
368
369
  } : void 0,
369
370
  setStatus: () => void 0,
370
371
  log: logger
371
- });
372
- handles.push({
373
- pluginId: binding.pluginId,
374
- channelId: binding.channelId,
375
- accountId,
376
- abort: () => abortController.abort(),
377
- stop: async () => {
378
- abortController.abort();
379
- if (started && typeof started === "object" && "stop" in started && typeof started.stop === "function") {
380
- await started.stop();
381
- }
382
- }
383
- });
384
- } catch (error) {
372
+ })
373
+ ).then((started) => {
374
+ if (started && typeof started === "object" && "stop" in started && typeof started.stop === "function") {
375
+ stopGateway = started.stop.bind(started);
376
+ }
377
+ }).catch((error) => {
378
+ if (abortController.signal.aborted) {
379
+ return;
380
+ }
385
381
  const raw = String(error);
386
382
  const lower = raw.toLowerCase();
387
383
  const level = lower.includes("required") || lower.includes("not configured") || lower.includes("missing") ? "warn" : "error";
@@ -396,7 +392,18 @@ async function startPluginChannelGateways(params) {
396
392
  } else {
397
393
  logger?.warn(message);
398
394
  }
399
- }
395
+ });
396
+ handles.push({
397
+ pluginId: binding.pluginId,
398
+ channelId: binding.channelId,
399
+ accountId,
400
+ abort: () => abortController.abort(),
401
+ stop: async () => {
402
+ abortController.abort();
403
+ await startTask;
404
+ await stopGateway?.();
405
+ }
406
+ });
400
407
  }
401
408
  }
402
409
  return { handles, diagnostics };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nextclaw/openclaw-compat",
3
- "version": "0.3.31",
3
+ "version": "0.3.32",
4
4
  "private": false,
5
5
  "description": "OpenClaw plugin compatibility layer for NextClaw.",
6
6
  "type": "module",
@@ -20,20 +20,20 @@
20
20
  "jszip": "^3.10.1",
21
21
  "tar": "^7.4.3",
22
22
  "@nextclaw/channel-plugin-dingtalk": "0.2.16",
23
+ "@nextclaw/channel-plugin-feishu": "0.2.21",
23
24
  "@nextclaw/channel-plugin-discord": "0.2.16",
24
25
  "@nextclaw/channel-plugin-email": "0.2.16",
25
- "@nextclaw/channel-plugin-feishu": "0.2.20",
26
+ "@nextclaw/channel-plugin-qq": "0.2.16",
26
27
  "@nextclaw/channel-plugin-mochat": "0.2.16",
28
+ "@nextclaw/core": "0.11.1",
27
29
  "@nextclaw/channel-plugin-slack": "0.2.16",
30
+ "@nextclaw/channel-runtime": "0.4.2",
28
31
  "@nextclaw/channel-plugin-telegram": "0.2.16",
29
- "@nextclaw/channel-plugin-qq": "0.2.16",
30
- "@nextclaw/channel-plugin-weixin": "0.1.9",
32
+ "@nextclaw/ncp": "0.3.2",
31
33
  "@nextclaw/channel-plugin-wecom": "0.2.16",
34
+ "@nextclaw/ncp-toolkit": "0.4.2",
32
35
  "@nextclaw/channel-plugin-whatsapp": "0.2.16",
33
- "@nextclaw/channel-runtime": "0.4.2",
34
- "@nextclaw/core": "0.11.1",
35
- "@nextclaw/ncp": "0.3.2",
36
- "@nextclaw/ncp-toolkit": "0.4.2"
36
+ "@nextclaw/channel-plugin-weixin": "0.1.9"
37
37
  },
38
38
  "devDependencies": {
39
39
  "@types/node": "^20.17.6",