aicq-openclaw-plugin 1.5.7 → 1.5.9

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/dist/index.js CHANGED
@@ -10359,6 +10359,7 @@ var AutoUpdateService = class {
10359
10359
  /**
10360
10360
  * Start the auto-update service.
10361
10361
  * Checks immediately, then periodically every 6 hours.
10362
+ * If the check fails (e.g. no network), it logs a warning and retries later.
10362
10363
  */
10363
10364
  start() {
10364
10365
  this.checkForUpdate().catch(() => {
@@ -11302,13 +11303,25 @@ function createToastContainer() {
11302
11303
  }
11303
11304
 
11304
11305
  // \u2500\u2500 API \u2500\u2500
11306
+ // Default timeout for API calls: 10 seconds (prevents UI hanging when server is unreachable)
11307
+ const API_TIMEOUT_MS = 10000;
11308
+
11305
11309
  async function api(path, opts = {}) {
11306
11310
  try {
11307
- const res = await fetch(API + path, { headers: { 'Content-Type': 'application/json', ...opts.headers }, ...opts });
11311
+ const controller = new AbortController();
11312
+ const timeout = setTimeout(() => controller.abort(), opts.timeout || API_TIMEOUT_MS);
11313
+ const res = await fetch(API + path, {
11314
+ headers: { 'Content-Type': 'application/json', ...opts.headers },
11315
+ signal: controller.signal,
11316
+ ...opts,
11317
+ });
11318
+ clearTimeout(timeout);
11308
11319
  const data = await res.json();
11309
11320
  if (!res.ok && !data.error) data.error = 'HTTP ' + res.status;
11310
11321
  return data;
11311
- } catch (e) { return { error: e.message }; }
11322
+ } catch (e) {
11323
+ return { error: e.name === 'AbortError' ? 'Request timed out (server unreachable)' : e.message };
11324
+ }
11312
11325
  }
11313
11326
 
11314
11327
  // \u2500\u2500 Utilities \u2500\u2500
@@ -11368,7 +11381,13 @@ async function loadDashboard() {
11368
11381
  const friends = results[1].status === 'fulfilled' ? results[1].value : { friends: [], error: true };
11369
11382
  const identity = results[2].status === 'fulfilled' ? results[2].value : { agentId: '\u2014', publicKeyFingerprint: '\u2014', serverUrl: '\u2014', connected: false };
11370
11383
  const mgmtUrl = results[3].status === 'fulfilled' ? results[3].value : { mgmtUrl: window.location.origin };
11371
- if (status.error) { html(el, '<div class="empty"><div class="icon">\u26A0\uFE0F</div><p>' + t('failed_connect') + '</p></div>'); return; }
11384
+
11385
+ // In offline mode or when status API fails, still render dashboard with available data
11386
+ const isOffline = !!(status.error || status.connected === false);
11387
+ if (isOffline && !status.agentId && !identity.agentId) {
11388
+ html(el, '<div class="empty"><div class="icon">\u{1F50C}</div><p>' + t('offline_msg') + '</p><p class="sub">' + t('failed_connect') + '</p></div>');
11389
+ return;
11390
+ }
11372
11391
  const connCls = status.connected ? 'dot-ok' : 'dot-err';
11373
11392
  const connText = status.connected ? t('connected') : t('disconnected');
11374
11393
  const friendList = friends.friends || [];
@@ -15336,7 +15355,7 @@ var plugin = definePluginEntry({
15336
15355
  error: (msg, ...args) => ocLog.error?.(msg, ...args) ?? console.error("[aicq-chat]", msg, ...args),
15337
15356
  debug: (msg, ...args) => ocLog.debug?.(msg, ...args) ?? console.log("[aicq-chat DEBUG]", msg, ...args)
15338
15357
  };
15339
- const pluginVersion = "1.5.7";
15358
+ const pluginVersion = "1.5.9";
15340
15359
  logger.info("\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550");
15341
15360
  logger.info(" AICQ Encrypted Chat Plugin v" + pluginVersion);
15342
15361
  logger.info("\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550");
@@ -173,7 +173,7 @@
173
173
  "group": "Advanced",
174
174
  "advanced": true
175
175
  }
176
- }
176
+ },
177
177
  },
178
178
  "uiHints": {
179
179
  "groups": [
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "aicq-openclaw-plugin",
3
- "version": "1.5.7",
3
+ "version": "1.5.9",
4
4
  "description": "AICQ OpenClaw plugin - end-to-end encrypted P2P chat for AI agents with offline queue support",
5
5
  "main": "dist/index.js",
6
6
  "type": "module",