@occum-net/occumclaw 0.2.0 → 0.2.2

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.ts CHANGED
@@ -288,6 +288,11 @@ function createOccumChannelPlugin(logger: PluginLogger) {
288
288
  // Track processed events to avoid re-dispatch
289
289
  const processedEvents = new Set<string>();
290
290
 
291
+ // Only send the connect greeting once per version (not on every reconnect)
292
+ let greetedVersion: string | null = null;
293
+ // Only notify about a specific update version once
294
+ let notifiedUpdateVersion: string | null = null;
295
+
291
296
  const wsClient = new OccumWsClient({
292
297
  apiUrl: account.apiUrl,
293
298
  agentToken: account.agentToken,
@@ -305,8 +310,9 @@ function createOccumChannelPlugin(logger: PluginLogger) {
305
310
  connected: true,
306
311
  });
307
312
 
308
- // Send a greeting to the control channel on connect
309
- if (controlChannelId) {
313
+ // Send a greeting to the control channel only once per version
314
+ if (controlChannelId && greetedVersion !== PLUGIN_VERSION) {
315
+ greetedVersion = PLUGIN_VERSION;
310
316
  try {
311
317
  await apiRequest(config, `/channels/${controlChannelId}/messages`, {
312
318
  method: "POST",
@@ -318,18 +324,21 @@ function createOccumChannelPlugin(logger: PluginLogger) {
318
324
  }
319
325
  }
320
326
 
321
- // Check for updates in the background
322
- checkLatestVersion().then((latest) => {
323
- if (!latest || latest === PLUGIN_VERSION) return;
324
- const msg = `Update available: v${PLUGIN_VERSION} → v${latest}. Run: openclaw plugins install ${NPM_PACKAGE}`;
325
- log?.warn?.(msg);
326
- if (controlChannelId) {
327
+ // Check for updates in the background on every reconnect,
328
+ // but only notify the user once per discovered version
329
+ if (controlChannelId) {
330
+ checkLatestVersion().then((latest) => {
331
+ if (!latest || latest === PLUGIN_VERSION) return;
332
+ if (latest === notifiedUpdateVersion) return;
333
+ notifiedUpdateVersion = latest;
334
+ const msg = `Update available: v${PLUGIN_VERSION} → v${latest}. Run:\ncurl -fsSL https://occum.net/update-open-claw.sh | bash`;
335
+ log?.warn?.(msg);
327
336
  apiRequest(config, `/channels/${controlChannelId}/messages`, {
328
337
  method: "POST",
329
338
  body: JSON.stringify({ text: msg }),
330
339
  }).catch(() => {});
331
- }
332
- });
340
+ });
341
+ }
333
342
  },
334
343
 
335
344
  onEvent: (event: OccumEvent) => {
@@ -11,7 +11,7 @@
11
11
  "agentToken": { "type": "string" },
12
12
  "apiUrl": { "type": "string", "default": "https://api.occum.net" }
13
13
  },
14
- "required": ["agentToken"]
14
+ "required": []
15
15
  },
16
16
  "uiHints": {
17
17
  "agentToken": { "label": "Agent Token", "sensitive": true },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@occum-net/occumclaw",
3
- "version": "0.2.0",
3
+ "version": "0.2.2",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },