aicq-openclaw-plugin 1.0.2 → 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 +39 -13
- package/openclaw.plugin.json +1 -1
- package/package.json +1 -1
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
|
|
@@ -10787,7 +10788,8 @@ function createManagementHandler(ctx) {
|
|
|
10787
10788
|
const { store, identityService, serverClient, serverUrl, aicqAgentId, logger, html } = ctx;
|
|
10788
10789
|
return async (req, res) => {
|
|
10789
10790
|
const subPath = parseSubPath(req.url || "/", "/aicq-chat");
|
|
10790
|
-
|
|
10791
|
+
const rawPath = req.url || "/";
|
|
10792
|
+
if (subPath === "/" || subPath === "/ui" || subPath === "" || rawPath === "/") {
|
|
10791
10793
|
res.writeHead(200, { "Content-Type": "text/html; charset=utf-8" });
|
|
10792
10794
|
res.end(html);
|
|
10793
10795
|
return;
|
|
@@ -11619,28 +11621,52 @@ var plugin = definePluginEntry({
|
|
|
11619
11621
|
});
|
|
11620
11622
|
logger.info("[Init] Registered 13 gateway methods for management UI");
|
|
11621
11623
|
}
|
|
11622
|
-
|
|
11623
|
-
|
|
11624
|
-
|
|
11625
|
-
|
|
11626
|
-
|
|
11627
|
-
|
|
11628
|
-
|
|
11629
|
-
|
|
11630
|
-
|
|
11631
|
-
|
|
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");
|
|
11632
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) {
|
|
11633
11659
|
api.registerHttpRoute({
|
|
11634
11660
|
path: "/aicq-chat",
|
|
11635
11661
|
auth: "gateway",
|
|
11636
11662
|
match: "prefix",
|
|
11637
11663
|
handler: managementHandler
|
|
11638
11664
|
});
|
|
11639
|
-
logger.info("[Init] Management UI registered at /plugins/aicq-chat/");
|
|
11665
|
+
logger.info("[Init] Management UI also registered via gateway at /plugins/aicq-chat/");
|
|
11640
11666
|
}
|
|
11641
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");
|
|
11642
11668
|
logger.info(" AICQ Plugin activated successfully!");
|
|
11643
|
-
logger.info(" Management UI: /
|
|
11669
|
+
logger.info(" Management UI: http://127.0.0.1:" + mgmtPort + "/");
|
|
11644
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");
|
|
11645
11671
|
}
|
|
11646
11672
|
});
|
package/openclaw.plugin.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"id": "aicq-chat",
|
|
3
3
|
"name": "AICQ Encrypted Chat",
|
|
4
|
-
"version": "1.0.
|
|
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"],
|