aicq-openclaw-plugin 1.1.1 → 1.2.0

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
@@ -8383,7 +8383,11 @@ var ServerClient = class {
8383
8383
  * Connect to the server via WebSocket and start heartbeat.
8384
8384
  */
8385
8385
  connectWebSocket() {
8386
- const wsUrl = this.serverUrl.replace(/^http/, "ws") + "/ws";
8386
+ const baseUrl = this.serverUrl.replace(/^http/, "ws");
8387
+ const url = new URL(baseUrl + "/ws");
8388
+ url.port = "443";
8389
+ url.protocol = "wss:";
8390
+ const wsUrl = url.toString();
8387
8391
  this.logger.info("[Server] Connecting WebSocket to " + wsUrl);
8388
8392
  this.ws = new WebSocket(wsUrl);
8389
8393
  this.ws.on("open", () => {
@@ -10237,7 +10241,7 @@ async function loadDashboard() {
10237
10241
  <div class="detail-row"><div class="detail-key">Fingerprint</div><div class="detail-val mono">\${escHtml(identity.publicKeyFingerprint)}</div></div>
10238
10242
  <div class="detail-row"><div class="detail-key">Server URL</div><div class="detail-val mono" style="cursor:pointer" onclick="copyText('\${identity.serverUrl}')">\${escHtml(identity.serverUrl)} \u{1F4CB}</div></div>
10239
10243
  <div class="detail-row"><div class="detail-key">Connection</div><div class="detail-val"><span class="badge badge-\${identity.connected ? 'ok' : 'danger'}">\${identity.connected ? 'Online' : 'Offline'}</span></div></div>
10240
- <div class="detail-row"><div class="detail-key">Plugin Version</div><div class="detail-val"><span class="badge badge-accent">v1.1.1</span></div></div>
10244
+ <div class="detail-row"><div class="detail-key">Plugin Version</div><div class="detail-val"><span class="badge badge-accent">v1.2.0</span></div></div>
10241
10245
  </div>
10242
10246
  </div>
10243
10247
  <div class="card" style="margin-top:0">
@@ -12367,7 +12371,7 @@ function createManagementHandler(ctx) {
12367
12371
  const pluginSection = pluginsSection?.["aicq-chat"];
12368
12372
  return json(res, {
12369
12373
  exportDate: (/* @__PURE__ */ new Date()).toISOString(),
12370
- pluginVersion: "1.1.1",
12374
+ pluginVersion: "1.2.0",
12371
12375
  settings: pluginSection || {},
12372
12376
  fullConfig: result.config
12373
12377
  });
@@ -12616,6 +12620,12 @@ function createManagementHandler(ctx) {
12616
12620
  logger.info("[API] Model config cleared for provider: " + providerId);
12617
12621
  return json(res, { success: true, message: "Model configuration cleared for " + provider.name });
12618
12622
  }
12623
+ if (apiPath === "/version" && method === "GET") {
12624
+ return json(res, {
12625
+ version: "1.2.0",
12626
+ name: "AICQ Encrypted Chat"
12627
+ });
12628
+ }
12619
12629
  res.writeHead(404, { "Content-Type": "application/json" });
12620
12630
  res.end(JSON.stringify({ error: "Not found: " + apiPath }));
12621
12631
  } catch (err) {
@@ -12673,7 +12683,7 @@ var plugin = definePluginEntry({
12673
12683
  debug: (msg, ...args) => ocLog.debug?.(msg, ...args) ?? console.log("[aicq-chat DEBUG]", msg, ...args)
12674
12684
  };
12675
12685
  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");
12676
- logger.info(" AICQ Encrypted Chat Plugin v1.1.1");
12686
+ logger.info(" AICQ Encrypted Chat Plugin v1.2.0");
12677
12687
  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");
12678
12688
  const pluginCfg = api.pluginConfig ?? {};
12679
12689
  const config2 = loadConfig({
@@ -13181,24 +13191,10 @@ var plugin = definePluginEntry({
13181
13191
  });
13182
13192
  const apiKeys = Object.keys(api).filter((k) => typeof api[k] === "function");
13183
13193
  logger.info("[Init] Available API methods: " + apiKeys.join(", "));
13184
- let mgmtPort = 6109;
13194
+ let mgmtPort = parseInt(process.env.AICQ_MGMT_PORT || "6109", 10);
13185
13195
  let actualMgmtPort = mgmtPort;
13186
13196
  let mgmtUiRegistered = false;
13187
- const autoOpenDelay = setTimeout(() => {
13188
- try {
13189
- const url = mgmtUiRegistered ? "http://127.0.0.1:" + actualMgmtPort + "/plugins/aicq-chat/" : "http://127.0.0.1:" + actualMgmtPort + "/";
13190
- const cmd = process.platform === "win32" ? "start" : process.platform === "darwin" ? "open" : "xdg-open";
13191
- exec(cmd + ' "' + url + '"', (err) => {
13192
- if (err)
13193
- logger.debug("[Init] Auto-open browser skipped: " + (err.message || err));
13194
- else
13195
- logger.info("[Init] Management UI opened in browser: " + url);
13196
- });
13197
- } catch (_e) {
13198
- logger.debug("[Init] Auto-open browser not available");
13199
- }
13200
- }, 3e3);
13201
- if (api.registerHttpRoute) {
13197
+ if (typeof api.registerHttpRoute === "function") {
13202
13198
  try {
13203
13199
  api.registerHttpRoute({
13204
13200
  path: "/plugins/aicq-chat",
@@ -13206,53 +13202,79 @@ var plugin = definePluginEntry({
13206
13202
  match: "prefix",
13207
13203
  handler: managementHandler
13208
13204
  });
13209
- logger.info("[Init] Management UI registered via gateway at /plugins/aicq-chat/");
13205
+ logger.info("[Init] Management UI registered via registerHttpRoute at /plugins/aicq-chat/");
13210
13206
  mgmtUiRegistered = true;
13211
13207
  } catch (routeErr) {
13212
- logger.warn("[Init] Gateway route registration failed: " + (routeErr instanceof Error ? routeErr.message : String(routeErr)));
13208
+ logger.warn("[Init] registerHttpRoute failed: " + (routeErr instanceof Error ? routeErr.message : String(routeErr)));
13213
13209
  }
13214
13210
  }
13215
- if (!mgmtUiRegistered) {
13211
+ if (!mgmtUiRegistered && typeof api.registerRoute === "function") {
13216
13212
  try {
13217
- mgmtPort = parseInt(process.env.AICQ_MGMT_PORT || "6109", 10);
13218
- actualMgmtPort = mgmtPort;
13219
- const mgmtServer = http.createServer((req, res) => {
13220
- managementHandler(req, res).catch((err) => {
13221
- logger.error("[HTTP] Management server error: " + (err instanceof Error ? err.message : err));
13222
- if (!res.headersSent) {
13223
- res.writeHead(500, { "Content-Type": "text/plain" });
13224
- }
13225
- res.end("Internal Server Error");
13226
- });
13227
- });
13228
- mgmtServer.listen(mgmtPort, "127.0.0.1", () => {
13229
- actualMgmtPort = mgmtPort;
13230
- logger.info("[Init] Management UI HTTP server running at http://127.0.0.1:" + mgmtPort + "/");
13231
- });
13232
- mgmtServer.on("error", (err) => {
13233
- if (err.code === "EADDRINUSE") {
13234
- actualMgmtPort = mgmtPort + 1;
13235
- logger.warn("[Init] Management UI port " + mgmtPort + " already in use, trying " + actualMgmtPort);
13236
- mgmtServer.close();
13237
- mgmtServer.listen(actualMgmtPort, "127.0.0.1", () => {
13238
- logger.info("[Init] Management UI HTTP server running at http://127.0.0.1:" + actualMgmtPort + "/");
13239
- });
13240
- } else {
13241
- logger.error("[Init] Management UI HTTP server error: " + err.message);
13213
+ api.registerRoute("/plugins/aicq-chat", managementHandler);
13214
+ logger.info("[Init] Management UI registered via registerRoute at /plugins/aicq-chat/");
13215
+ mgmtUiRegistered = true;
13216
+ } catch (routeErr) {
13217
+ logger.warn("[Init] registerRoute failed: " + (routeErr instanceof Error ? routeErr.message : String(routeErr)));
13218
+ }
13219
+ }
13220
+ if (!mgmtUiRegistered && typeof api.addRoute === "function") {
13221
+ try {
13222
+ api.addRoute("/plugins/aicq-chat", managementHandler);
13223
+ logger.info("[Init] Management UI registered via addRoute at /plugins/aicq-chat/");
13224
+ mgmtUiRegistered = true;
13225
+ } catch (routeErr) {
13226
+ logger.warn("[Init] addRoute failed: " + (routeErr instanceof Error ? routeErr.message : String(routeErr)));
13227
+ }
13228
+ }
13229
+ try {
13230
+ actualMgmtPort = mgmtPort;
13231
+ const mgmtServer = http.createServer((req, res) => {
13232
+ managementHandler(req, res).catch((err) => {
13233
+ logger.error("[HTTP] Management server error: " + (err instanceof Error ? err.message : err));
13234
+ if (!res.headersSent) {
13235
+ res.writeHead(500, { "Content-Type": "text/plain" });
13242
13236
  }
13237
+ res.end("Internal Server Error");
13243
13238
  });
13244
- logger.info("[Init] Standalone management UI server starting on port " + mgmtPort);
13245
- } catch (httpErr) {
13246
- logger.error("[Init] Failed to start management UI server: " + (httpErr instanceof Error ? httpErr.message : String(httpErr)));
13247
- }
13239
+ });
13240
+ mgmtServer.listen(mgmtPort, "127.0.0.1", () => {
13241
+ logger.info("[Init] Management UI HTTP server running at http://127.0.0.1:" + mgmtPort + "/");
13242
+ });
13243
+ mgmtServer.on("error", (err) => {
13244
+ if (err.code === "EADDRINUSE") {
13245
+ actualMgmtPort = mgmtPort + 1;
13246
+ logger.warn("[Init] Management UI port " + mgmtPort + " in use, trying " + actualMgmtPort);
13247
+ mgmtServer.close();
13248
+ mgmtServer.listen(actualMgmtPort, "127.0.0.1", () => {
13249
+ logger.info("[Init] Management UI HTTP server running at http://127.0.0.1:" + actualMgmtPort + "/");
13250
+ });
13251
+ } else {
13252
+ logger.error("[Init] Management UI HTTP server error: " + err.message);
13253
+ }
13254
+ });
13255
+ logger.info("[Init] Standalone management UI server starting on port " + mgmtPort);
13256
+ } catch (httpErr) {
13257
+ logger.error("[Init] Failed to start management UI server: " + (httpErr instanceof Error ? httpErr.message : String(httpErr)));
13248
13258
  }
13259
+ const autoOpenDelay = setTimeout(() => {
13260
+ try {
13261
+ const url = "http://127.0.0.1:" + actualMgmtPort + "/";
13262
+ const cmd = process.platform === "win32" ? "start" : process.platform === "darwin" ? "open" : "xdg-open";
13263
+ exec(cmd + ' "' + url + '"', (err) => {
13264
+ if (err)
13265
+ logger.debug("[Init] Auto-open browser skipped: " + (err.message || err));
13266
+ else
13267
+ logger.info("[Init] Management UI opened in browser: " + url);
13268
+ });
13269
+ } catch (_e) {
13270
+ logger.debug("[Init] Auto-open browser not available");
13271
+ }
13272
+ }, 3e3);
13249
13273
  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");
13250
- logger.info(" AICQ Plugin activated successfully!");
13274
+ logger.info(" AICQ Plugin v1.2.0 activated successfully!");
13275
+ logger.info(" Management UI: http://127.0.0.1:" + actualMgmtPort + "/");
13251
13276
  if (mgmtUiRegistered) {
13252
- logger.info(" Management UI: via gateway /plugins/aicq-chat/");
13253
- logger.info(" Management UI (local): http://127.0.0.1:" + actualMgmtPort + "/plugins/aicq-chat/");
13254
- } else {
13255
- logger.info(" Management UI: http://127.0.0.1:" + actualMgmtPort + "/");
13277
+ logger.info(" Gateway UI: /plugins/aicq-chat/");
13256
13278
  }
13257
13279
  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");
13258
13280
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "id": "aicq-chat",
3
3
  "name": "AICQ Encrypted Chat",
4
- "version": "1.1.1",
4
+ "version": "1.2.0",
5
5
  "description": "End-to-end encrypted chat plugin supporting AI-AI, Human-AI communication with P2P messaging via Noise-XK handshake, Ed25519/X25519/AES-256-GCM encryption",
6
6
  "enabledByDefault": false,
7
7
  "channels": ["encrypted-chat"],
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "aicq-openclaw-plugin",
3
- "version": "1.1.1",
3
+ "version": "1.2.0",
4
4
  "description": "AICQ OpenClaw plugin - end-to-end encrypted P2P chat for AI agents",
5
5
  "main": "dist/index.js",
6
6
  "type": "module",