@usex/mikrotik-mcp 3.53.0 → 3.55.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/cli.js +12 -26
- package/dist/index.js +1 -1
- package/dist/shared/{cli-ewkttc56.js → cli-44v6pb38.js} +22206 -22034
- package/dist/shared/{cli-thdzk64q.js → cli-yxah49n1.js} +1 -1
- package/dist/shared/{library-n3yvjpkm.js → library-83q9t27c.js} +7251 -7084
- package/dist/shared/{library-4npjv6jq.js → library-cs13jqp9.js} +1 -1
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -25,6 +25,7 @@ import {
|
|
|
25
25
|
buildChangePlan,
|
|
26
26
|
capture,
|
|
27
27
|
closeAll,
|
|
28
|
+
closeMemoryStore,
|
|
28
29
|
commandUnsupported,
|
|
29
30
|
configureRecorder,
|
|
30
31
|
createContext,
|
|
@@ -41,6 +42,7 @@ import {
|
|
|
41
42
|
getConfig,
|
|
42
43
|
getConfigSource,
|
|
43
44
|
getEventStore,
|
|
45
|
+
getMemoryStore,
|
|
44
46
|
getRadiusIncoming,
|
|
45
47
|
getS3Client,
|
|
46
48
|
getUmSettings,
|
|
@@ -57,7 +59,6 @@ import {
|
|
|
57
59
|
makeDeviceStatic,
|
|
58
60
|
moduleCatalog,
|
|
59
61
|
normalizeExport,
|
|
60
|
-
openMemoryStore,
|
|
61
62
|
openSnapshotStore,
|
|
62
63
|
parseKeyValues,
|
|
63
64
|
parseLeadingNumber,
|
|
@@ -75,7 +76,7 @@ import {
|
|
|
75
76
|
removeDeviceLease,
|
|
76
77
|
renameBackup,
|
|
77
78
|
renderPlan,
|
|
78
|
-
|
|
79
|
+
reopenMemoryStore,
|
|
79
80
|
resetRadiusCounters,
|
|
80
81
|
resolveDeviceName,
|
|
81
82
|
restoreLocalBackup,
|
|
@@ -95,7 +96,7 @@ import {
|
|
|
95
96
|
toggleAaaEntity,
|
|
96
97
|
updateAaaEntity,
|
|
97
98
|
writeBackup
|
|
98
|
-
} from "./shared/cli-
|
|
99
|
+
} from "./shared/cli-44v6pb38.js";
|
|
99
100
|
|
|
100
101
|
// src/cli.ts
|
|
101
102
|
import { existsSync as existsSync2 } from "fs";
|
|
@@ -1300,20 +1301,6 @@ async function driftRoutes(req, url) {
|
|
|
1300
1301
|
}
|
|
1301
1302
|
|
|
1302
1303
|
// src/observability/memory-routes.ts
|
|
1303
|
-
var storePromise2 = null;
|
|
1304
|
-
function getStore2() {
|
|
1305
|
-
if (!storePromise2) {
|
|
1306
|
-
const cfg = getConfig();
|
|
1307
|
-
storePromise2 = openMemoryStore(cfg.memory.dbPath);
|
|
1308
|
-
}
|
|
1309
|
-
return storePromise2;
|
|
1310
|
-
}
|
|
1311
|
-
function closeMemoryStore() {
|
|
1312
|
-
if (storePromise2) {
|
|
1313
|
-
storePromise2.then((s) => s.close()).catch(() => {});
|
|
1314
|
-
storePromise2 = null;
|
|
1315
|
-
}
|
|
1316
|
-
}
|
|
1317
1304
|
var JSON_HEADERS2 = { "content-type": "application/json; charset=utf-8" };
|
|
1318
1305
|
function json2(body, status = 200) {
|
|
1319
1306
|
return new Response(JSON.stringify(body), { status, headers: JSON_HEADERS2 });
|
|
@@ -1332,7 +1319,7 @@ async function memoryRoutes(req, url) {
|
|
|
1332
1319
|
if (p === "/api/memory/config" && req.method === "GET") {
|
|
1333
1320
|
let stats = null;
|
|
1334
1321
|
try {
|
|
1335
|
-
const store2 = await
|
|
1322
|
+
const store2 = await getMemoryStore();
|
|
1336
1323
|
stats = store2.stats();
|
|
1337
1324
|
} catch {}
|
|
1338
1325
|
return json2({
|
|
@@ -1345,15 +1332,13 @@ async function memoryRoutes(req, url) {
|
|
|
1345
1332
|
const body = await bodyJson2(req);
|
|
1346
1333
|
const updates = {};
|
|
1347
1334
|
if (body.dbPath !== undefined && typeof body.dbPath === "string" && body.dbPath !== cfg.memory.dbPath) {
|
|
1348
|
-
closeMemoryStore();
|
|
1349
|
-
resetMemoryStore();
|
|
1350
1335
|
updates.dbPath = body.dbPath;
|
|
1351
|
-
storePromise2 = openMemoryStore(body.dbPath);
|
|
1352
1336
|
try {
|
|
1353
|
-
await
|
|
1337
|
+
await reopenMemoryStore(body.dbPath);
|
|
1354
1338
|
} catch (e) {
|
|
1355
|
-
|
|
1356
|
-
|
|
1339
|
+
return json2({
|
|
1340
|
+
error: `Failed to open memory DB at ${body.dbPath}: ${e instanceof Error ? e.message : String(e)}`
|
|
1341
|
+
}, 400);
|
|
1357
1342
|
}
|
|
1358
1343
|
}
|
|
1359
1344
|
if (body.enabled !== undefined && typeof body.enabled === "boolean") {
|
|
@@ -1370,7 +1355,7 @@ async function memoryRoutes(req, url) {
|
|
|
1370
1355
|
}
|
|
1371
1356
|
let stats = null;
|
|
1372
1357
|
try {
|
|
1373
|
-
const store2 = await
|
|
1358
|
+
const store2 = await getMemoryStore();
|
|
1374
1359
|
stats = store2.stats();
|
|
1375
1360
|
} catch {}
|
|
1376
1361
|
return json2({
|
|
@@ -1380,7 +1365,7 @@ async function memoryRoutes(req, url) {
|
|
|
1380
1365
|
stats
|
|
1381
1366
|
});
|
|
1382
1367
|
}
|
|
1383
|
-
const store = await
|
|
1368
|
+
const store = await getMemoryStore();
|
|
1384
1369
|
if (p === "/api/memory/graph" && req.method === "GET") {
|
|
1385
1370
|
return json2(store.readGraph());
|
|
1386
1371
|
}
|
|
@@ -3062,6 +3047,7 @@ async function main() {
|
|
|
3062
3047
|
shuttingDown = true;
|
|
3063
3048
|
logger.info(`Received ${signal}, shutting down\u2026`);
|
|
3064
3049
|
closeAll();
|
|
3050
|
+
closeMemoryStore();
|
|
3065
3051
|
process.exit(0);
|
|
3066
3052
|
};
|
|
3067
3053
|
process.on("SIGINT", () => shutdown("SIGINT"));
|
package/dist/index.js
CHANGED
|
@@ -22,7 +22,7 @@ import {
|
|
|
22
22
|
resolveDeviceName,
|
|
23
23
|
selectToolModules,
|
|
24
24
|
setConfig
|
|
25
|
-
} from "./shared/library-
|
|
25
|
+
} from "./shared/library-83q9t27c.js";
|
|
26
26
|
// src/server.ts
|
|
27
27
|
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
28
28
|
import { ListToolsRequestSchema } from "@modelcontextprotocol/sdk/types.js";
|