openclaw-clawtown-plugin 1.1.26 → 1.1.27
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/openclaw.plugin.json +1 -1
- package/package.json +1 -1
- package/reporter.ts +18 -0
package/openclaw.plugin.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"id": "openclaw-clawtown-plugin",
|
|
3
3
|
"name": "OpenClaw Clawtown Plugin",
|
|
4
4
|
"description": "Connects an OpenClaw agent to OpenClaw Forum and reports forum actions",
|
|
5
|
-
"version": "1.1.
|
|
5
|
+
"version": "1.1.27",
|
|
6
6
|
"main": "./index.ts",
|
|
7
7
|
"configSchema": {
|
|
8
8
|
"type": "object",
|
package/package.json
CHANGED
package/reporter.ts
CHANGED
|
@@ -58,6 +58,15 @@ try {
|
|
|
58
58
|
setDefaultResultOrder("ipv4first");
|
|
59
59
|
} catch {}
|
|
60
60
|
|
|
61
|
+
function isCurrentPluginUninstallInvocation(argv = process.argv.slice(2)) {
|
|
62
|
+
const tokens = Array.isArray(argv)
|
|
63
|
+
? argv.map((token) => String(token ?? "").trim()).filter(Boolean)
|
|
64
|
+
: [];
|
|
65
|
+
if (tokens.length < 2) return false;
|
|
66
|
+
if (tokens[0] !== "plugins" || tokens[1] !== "uninstall") return false;
|
|
67
|
+
return tokens.includes(PLUGIN_ID) || tokens.includes(LEGACY_PLUGIN_ID);
|
|
68
|
+
}
|
|
69
|
+
|
|
61
70
|
function normalizeServerUrl(raw: string) {
|
|
62
71
|
const input = String(raw ?? "").trim() || "http://127.0.0.1:3679";
|
|
63
72
|
try {
|
|
@@ -235,8 +244,15 @@ class Reporter {
|
|
|
235
244
|
private autoProvisionPromise: Promise<boolean> | null = null;
|
|
236
245
|
private lastPairingStatusShown = "";
|
|
237
246
|
private pairingStatusProbeOnly = false;
|
|
247
|
+
private suppressLifecycleForCliCommand = false;
|
|
238
248
|
|
|
239
249
|
constructor() {
|
|
250
|
+
if (isCurrentPluginUninstallInvocation()) {
|
|
251
|
+
this.bridgeDisabled = true;
|
|
252
|
+
this.suppressLifecycleForCliCommand = true;
|
|
253
|
+
console.log("[forum-reporter-v2] lifecycle suppressed during uninstall command");
|
|
254
|
+
return;
|
|
255
|
+
}
|
|
240
256
|
const legacyRuntime = handleLegacyRuntimeConflict(this.reporterRuntime);
|
|
241
257
|
if (legacyRuntime.summary) {
|
|
242
258
|
console.warn(`[forum-reporter-v2] ${legacyRuntime.summary}`);
|
|
@@ -309,6 +325,7 @@ class Reporter {
|
|
|
309
325
|
}
|
|
310
326
|
|
|
311
327
|
start() {
|
|
328
|
+
if (this.suppressLifecycleForCliCommand) return;
|
|
312
329
|
if (this.pairingStatusProbeOnly) {
|
|
313
330
|
return;
|
|
314
331
|
}
|
|
@@ -333,6 +350,7 @@ class Reporter {
|
|
|
333
350
|
}
|
|
334
351
|
|
|
335
352
|
async onHeartbeat(_agentId: string) {
|
|
353
|
+
if (this.suppressLifecycleForCliCommand) return;
|
|
336
354
|
if (this.bridgeDisabled) return;
|
|
337
355
|
this.start();
|
|
338
356
|
await this.syncProfile();
|