aicq-openclaw-plugin 1.0.1 → 1.0.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.
package/dist/index.js CHANGED
@@ -7769,6 +7769,7 @@ var require_dist = __commonJS({
7769
7769
  // dist/index.js
7770
7770
  var dotenv = __toESM(require_main(), 1);
7771
7771
  import * as path6 from "path";
7772
+ import * as http from "http";
7772
7773
  import { definePluginEntry } from "openclaw/plugin-sdk/core";
7773
7774
 
7774
7775
  // dist/config.js
@@ -10683,9 +10684,13 @@ var MODEL_PROVIDERS = [
10683
10684
  function findOpenClawConfig() {
10684
10685
  const candidates = [
10685
10686
  path5.join(process.cwd(), "openclaw.json"),
10687
+ path5.join(process.cwd(), "stableclaw.json"),
10686
10688
  path5.join(os.homedir(), ".config", "openclaw", "openclaw.json"),
10689
+ path5.join(os.homedir(), ".config", "stableclaw", "stableclaw.json"),
10687
10690
  path5.join(os.homedir(), ".openclaw", "openclaw.json"),
10688
- path5.join(os.homedir(), "openclaw.json")
10691
+ path5.join(os.homedir(), ".stableclaw", "stableclaw.json"),
10692
+ path5.join(os.homedir(), "openclaw.json"),
10693
+ path5.join(os.homedir(), "stableclaw.json")
10689
10694
  ];
10690
10695
  for (const p of candidates) {
10691
10696
  try {
@@ -10783,7 +10788,8 @@ function createManagementHandler(ctx) {
10783
10788
  const { store, identityService, serverClient, serverUrl, aicqAgentId, logger, html } = ctx;
10784
10789
  return async (req, res) => {
10785
10790
  const subPath = parseSubPath(req.url || "/", "/aicq-chat");
10786
- if (subPath === "/" || subPath === "/ui" || subPath === "") {
10791
+ const rawPath = req.url || "/";
10792
+ if (subPath === "/" || subPath === "/ui" || subPath === "" || rawPath === "/") {
10787
10793
  res.writeHead(200, { "Content-Type": "text/html; charset=utf-8" });
10788
10794
  res.end(html);
10789
10795
  return;
@@ -11615,28 +11621,52 @@ var plugin = definePluginEntry({
11615
11621
  });
11616
11622
  logger.info("[Init] Registered 13 gateway methods for management UI");
11617
11623
  }
11618
- if (api.registerHttpRoute) {
11619
- const managementHtml = getManagementHTML();
11620
- const managementHandler = createManagementHandler({
11621
- store,
11622
- identityService,
11623
- serverClient,
11624
- serverUrl,
11625
- aicqAgentId,
11626
- logger,
11627
- html: managementHtml
11624
+ const managementHtml = getManagementHTML();
11625
+ const managementHandler = createManagementHandler({
11626
+ store,
11627
+ identityService,
11628
+ serverClient,
11629
+ serverUrl,
11630
+ aicqAgentId,
11631
+ logger,
11632
+ html: managementHtml
11633
+ });
11634
+ const mgmtPort = parseInt(process.env.AICQ_MGMT_PORT || "8099", 10);
11635
+ const mgmtServer = http.createServer((req, res) => {
11636
+ managementHandler(req, res).catch((err) => {
11637
+ logger.error("[HTTP] Management server error: " + (err instanceof Error ? err.message : err));
11638
+ if (!res.headersSent) {
11639
+ res.writeHead(500, { "Content-Type": "text/plain" });
11640
+ }
11641
+ res.end("Internal Server Error");
11628
11642
  });
11643
+ });
11644
+ mgmtServer.listen(mgmtPort, "127.0.0.1", () => {
11645
+ logger.info("[Init] Management UI HTTP server running at http://127.0.0.1:" + mgmtPort + "/");
11646
+ });
11647
+ mgmtServer.on("error", (err) => {
11648
+ if (err.code === "EADDRINUSE") {
11649
+ logger.warn("[Init] Management UI port " + mgmtPort + " already in use, trying " + (mgmtPort + 1));
11650
+ mgmtServer.close();
11651
+ mgmtServer.listen(mgmtPort + 1, "127.0.0.1", () => {
11652
+ logger.info("[Init] Management UI HTTP server running at http://127.0.0.1:" + (mgmtPort + 1) + "/");
11653
+ });
11654
+ } else {
11655
+ logger.error("[Init] Management UI HTTP server error: " + err.message);
11656
+ }
11657
+ });
11658
+ if (api.registerHttpRoute) {
11629
11659
  api.registerHttpRoute({
11630
11660
  path: "/aicq-chat",
11631
11661
  auth: "gateway",
11632
11662
  match: "prefix",
11633
11663
  handler: managementHandler
11634
11664
  });
11635
- logger.info("[Init] Management UI registered at /plugins/aicq-chat/");
11665
+ logger.info("[Init] Management UI also registered via gateway at /plugins/aicq-chat/");
11636
11666
  }
11637
11667
  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");
11638
11668
  logger.info(" AICQ Plugin activated successfully!");
11639
- logger.info(" Management UI: /plugins/aicq-chat/");
11669
+ logger.info(" Management UI: http://127.0.0.1:" + mgmtPort + "/");
11640
11670
  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");
11641
11671
  }
11642
11672
  });
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "id": "aicq-chat",
3
3
  "name": "AICQ Encrypted Chat",
4
- "version": "1.0.1",
4
+ "version": "1.0.3",
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.0.1",
3
+ "version": "1.0.3",
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",