@danainnovations/cortex-mcp 1.0.81 → 1.0.82
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/cli.js +9 -0
- package/dist/cli.js.map +1 -1
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -2292,6 +2292,7 @@ function startWizardServer(options) {
|
|
|
2292
2292
|
const onComplete = () => {
|
|
2293
2293
|
completionResolve();
|
|
2294
2294
|
};
|
|
2295
|
+
const connections = /* @__PURE__ */ new Set();
|
|
2295
2296
|
const server = http.createServer(async (req, res) => {
|
|
2296
2297
|
const url = new URL(req.url || "/", `http://localhost`);
|
|
2297
2298
|
const path = url.pathname;
|
|
@@ -2319,11 +2320,19 @@ function startWizardServer(options) {
|
|
|
2319
2320
|
res.writeHead(200, { "Content-Type": "text/html; charset=utf-8" });
|
|
2320
2321
|
res.end(getWizardHtml());
|
|
2321
2322
|
});
|
|
2323
|
+
server.on("connection", (socket) => {
|
|
2324
|
+
connections.add(socket);
|
|
2325
|
+
socket.on("close", () => connections.delete(socket));
|
|
2326
|
+
});
|
|
2322
2327
|
server.listen(0, "127.0.0.1", () => {
|
|
2323
2328
|
const addr = server.address();
|
|
2324
2329
|
resolve2({
|
|
2325
2330
|
port: addr.port,
|
|
2326
2331
|
close: () => new Promise((r) => {
|
|
2332
|
+
for (const socket of connections) {
|
|
2333
|
+
socket.destroy();
|
|
2334
|
+
}
|
|
2335
|
+
connections.clear();
|
|
2327
2336
|
server.close(() => r());
|
|
2328
2337
|
}),
|
|
2329
2338
|
waitForCompletion: () => completionPromise
|