@clawling/clawchat-plugin-openclaw 2026.7.6-1 → 2026.7.6-3

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.
@@ -24,6 +24,13 @@ export const MIN_REFRESH_INTERVAL_MS = 30_000;
24
24
  export const PROACTIVE_JITTER_MS = 5 * MINUTE_MS;
25
25
  /** §A.0 — fallback access-token TTL when `exp` is unparseable. */
26
26
  export const ACCESS_TOKEN_TTL_MS = 24 * HOUR_MS;
27
+ /**
28
+ * §A.1 — Node stores a `setTimeout` delay in a signed 32-bit int; a delay above
29
+ * this silently clamps to 1ms and fires *immediately*. Long-lived (~30-day)
30
+ * access tokens push `refresh_at - now` well past this, so the proactive wait is
31
+ * chunked into at-most-this-long sleeps that re-arm until the real time.
32
+ */
33
+ export const MAX_TIMER_DELAY_MS = 2_147_483_647; // 2^31 - 1
27
34
  /**
28
35
  * §A.0/§A.1 — compute the absolute epoch-ms at which to proactively refresh.
29
36
  * `refresh_at = exp - max(30min, min(2h, 0.25 * (exp - iat)))` plus jitter.
@@ -204,6 +211,18 @@ export class RefreshManager {
204
211
  jitterMs,
205
212
  });
206
213
  const delayMs = Math.max(0, refreshAtMs - this.now());
214
+ if (delayMs > MAX_TIMER_DELAY_MS) {
215
+ // Too far out for a single setTimeout without 32-bit overflow (which would
216
+ // fire at 1ms and trigger an immediate refresh + WS reconnect, cancelling
217
+ // any in-flight send). Sleep one max chunk, then re-arm from the still-live
218
+ // token for the remaining wait.
219
+ this.ports.log?.debug?.(`clawchat-plugin-openclaw proactive timer chunked delayMs=${delayMs} chunk=${MAX_TIMER_DELAY_MS}`);
220
+ this.proactiveTimer = this.setTimer(() => {
221
+ this.proactiveTimer = null;
222
+ this.armProactiveTimer(activatedAtMs);
223
+ }, MAX_TIMER_DELAY_MS);
224
+ return;
225
+ }
207
226
  this.ports.log?.debug?.(`clawchat-plugin-openclaw proactive timer armed delayMs=${delayMs}`);
208
227
  this.proactiveTimer = this.setTimer(() => {
209
228
  this.proactiveTimer = null;
@@ -62,7 +62,7 @@ export const MAX_SKILL_BYTES = 256 * 1024;
62
62
  /** This adapter's host target inside `skills/manifest.json`. */
63
63
  export const SKILL_TARGET = "openclaw";
64
64
  /** Skill ids this OpenClaw plugin bundles and can hot-update. */
65
- export const OPENCLAW_SKILL_IDS = ["clawchat", "liveware-app"];
65
+ export const OPENCLAW_SKILL_IDS = ["clawchat-core", "clawchat-liveware"];
66
66
  // ---------------------------------------------------------------------------
67
67
  // Strict semver compare (ported from install-cli `metadata.ts`).
68
68
  // ---------------------------------------------------------------------------
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@clawling/clawchat-plugin-openclaw",
3
- "version": "2026.7.6-1",
3
+ "version": "2026.7.6-3",
4
4
  "description": "OpenClaw ClawChat channel plugin",
5
5
  "license": "MIT",
6
6
  "author": "CLAWLING PTE. LTD.",
@@ -50,7 +50,7 @@
50
50
  },
51
51
  "devDependencies": {
52
52
  "@types/node": "^25.5.0",
53
- "openclaw": "2026.5.4",
53
+ "openclaw": "2026.6.11",
54
54
  "typescript": "^5.4.0",
55
55
  "vitest": "^4.1.5"
56
56
  },
@@ -1,7 +1,7 @@
1
1
  ---
2
- name: clawchat
3
- description: Use when a request involves ClawChat profile, friends, user search, moments/dynamics, comments, reactions, avatar, media, memory, output visibility, read-only conversation lookup, or plugin install/update/activation.
2
+ name: clawchat-core
4
3
  version: 1.0.0
4
+ description: Use when a request involves ClawChat profile, friends, user search, moments/dynamics, comments, reactions, avatar, media, memory, output visibility, read-only conversation lookup, or plugin install/update/activation.
5
5
  ---
6
6
 
7
7
  # ClawChat
@@ -1,7 +1,7 @@
1
1
  ---
2
- name: liveware-app
3
- description: Use when the user wants to expose this agent's local web service to the public internet via the liveware CLI and make it appear as an app in their ClawChat chat with this agent. Covers logging in to liveware with the ClawChat account, creating a liveware app, binding a tunnel to a local port, and registering the public URL to ClawChat.
2
+ name: clawchat-liveware
4
3
  version: 1.0.0
4
+ description: Use when the user wants to expose this agent's local web service to the public internet via the liveware CLI and make it appear as an app in their ClawChat chat with this agent. Covers logging in to liveware with the ClawChat account, creating a liveware app, binding a tunnel to a local port, and registering the public URL to ClawChat.
5
5
  ---
6
6
 
7
7
  # liveware App Hosting
@@ -32,6 +32,13 @@ export const MIN_REFRESH_INTERVAL_MS = 30_000;
32
32
  export const PROACTIVE_JITTER_MS = 5 * MINUTE_MS;
33
33
  /** §A.0 — fallback access-token TTL when `exp` is unparseable. */
34
34
  export const ACCESS_TOKEN_TTL_MS = 24 * HOUR_MS;
35
+ /**
36
+ * §A.1 — Node stores a `setTimeout` delay in a signed 32-bit int; a delay above
37
+ * this silently clamps to 1ms and fires *immediately*. Long-lived (~30-day)
38
+ * access tokens push `refresh_at - now` well past this, so the proactive wait is
39
+ * chunked into at-most-this-long sleeps that re-arm until the real time.
40
+ */
41
+ export const MAX_TIMER_DELAY_MS = 2_147_483_647; // 2^31 - 1
35
42
 
36
43
  /** Opaque timer handle — `setTimeout` returns a `Timeout` in node, a number in others. */
37
44
  export type TimerHandle = ReturnType<typeof setTimeout> | number;
@@ -296,6 +303,20 @@ export class RefreshManager {
296
303
  jitterMs,
297
304
  });
298
305
  const delayMs = Math.max(0, refreshAtMs - this.now());
306
+ if (delayMs > MAX_TIMER_DELAY_MS) {
307
+ // Too far out for a single setTimeout without 32-bit overflow (which would
308
+ // fire at 1ms and trigger an immediate refresh + WS reconnect, cancelling
309
+ // any in-flight send). Sleep one max chunk, then re-arm from the still-live
310
+ // token for the remaining wait.
311
+ this.ports.log?.debug?.(
312
+ `clawchat-plugin-openclaw proactive timer chunked delayMs=${delayMs} chunk=${MAX_TIMER_DELAY_MS}`,
313
+ );
314
+ this.proactiveTimer = this.setTimer(() => {
315
+ this.proactiveTimer = null;
316
+ this.armProactiveTimer(activatedAtMs);
317
+ }, MAX_TIMER_DELAY_MS);
318
+ return;
319
+ }
299
320
  this.ports.log?.debug?.(
300
321
  `clawchat-plugin-openclaw proactive timer armed delayMs=${delayMs}`,
301
322
  );
@@ -70,7 +70,7 @@ export const MAX_SKILL_BYTES = 256 * 1024;
70
70
  export const SKILL_TARGET = "openclaw";
71
71
 
72
72
  /** Skill ids this OpenClaw plugin bundles and can hot-update. */
73
- export const OPENCLAW_SKILL_IDS = ["clawchat", "liveware-app"] as const;
73
+ export const OPENCLAW_SKILL_IDS = ["clawchat-core", "clawchat-liveware"] as const;
74
74
  export type OpenclawSkillId = (typeof OPENCLAW_SKILL_IDS)[number];
75
75
 
76
76
  // ---------------------------------------------------------------------------