@vheins/local-memory-mcp 0.18.12 → 0.18.13
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/{chunk-UWAZ66N5.js → chunk-BK2QIQXS.js} +312 -268
- package/dist/dashboard/public/assets/index-DWRMdSsg.js +150 -0
- package/dist/dashboard/public/index.html +1 -1
- package/dist/dashboard/server.js +25 -2
- package/dist/mcp/server.js +1031 -1020
- package/package.json +1 -1
- package/dist/dashboard/public/assets/index-BA3gfiDm.js +0 -149
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
<link rel="preconnect" href="https://fonts.googleapis.com">
|
|
9
9
|
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
|
|
10
10
|
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=JetBrains+Mono:wght@400;500&display=swap" rel="stylesheet">
|
|
11
|
-
<script type="module" crossorigin src="/assets/index-
|
|
11
|
+
<script type="module" crossorigin src="/assets/index-DWRMdSsg.js"></script>
|
|
12
12
|
<link rel="stylesheet" crossorigin href="/assets/index-wAYh22Zy.css">
|
|
13
13
|
</head>
|
|
14
14
|
<body>
|
package/dist/dashboard/server.js
CHANGED
|
@@ -16,7 +16,7 @@ import {
|
|
|
16
16
|
handleTaskClaim,
|
|
17
17
|
listResources,
|
|
18
18
|
logger
|
|
19
|
-
} from "../chunk-
|
|
19
|
+
} from "../chunk-BK2QIQXS.js";
|
|
20
20
|
|
|
21
21
|
// src/dashboard/server.ts
|
|
22
22
|
import express from "express";
|
|
@@ -1334,6 +1334,30 @@ app.use((req, res, next) => {
|
|
|
1334
1334
|
});
|
|
1335
1335
|
next();
|
|
1336
1336
|
});
|
|
1337
|
+
function authMiddleware(req, res, next) {
|
|
1338
|
+
const token = process.env.DASHBOARD_TOKEN;
|
|
1339
|
+
if (!token) {
|
|
1340
|
+
return next();
|
|
1341
|
+
}
|
|
1342
|
+
if (req.path === "/" && req.method === "GET") {
|
|
1343
|
+
return next();
|
|
1344
|
+
}
|
|
1345
|
+
if (!req.path.startsWith("/api")) {
|
|
1346
|
+
return next();
|
|
1347
|
+
}
|
|
1348
|
+
const authHeader = req.headers.authorization;
|
|
1349
|
+
if (!authHeader || !authHeader.startsWith("Bearer ")) {
|
|
1350
|
+
res.status(401).json({ error: "Unauthorized: missing or invalid token" });
|
|
1351
|
+
return;
|
|
1352
|
+
}
|
|
1353
|
+
const providedToken = authHeader.slice(7);
|
|
1354
|
+
if (providedToken !== token) {
|
|
1355
|
+
res.status(401).json({ error: "Unauthorized: invalid token" });
|
|
1356
|
+
return;
|
|
1357
|
+
}
|
|
1358
|
+
next();
|
|
1359
|
+
}
|
|
1360
|
+
app.use(authMiddleware);
|
|
1337
1361
|
app.use("/api", routes_default);
|
|
1338
1362
|
function getStaticRoot() {
|
|
1339
1363
|
const possibleRoots = [
|
|
@@ -1394,7 +1418,6 @@ app.use((err, req, res, next) => {
|
|
|
1394
1418
|
if (err.status === 404) return res.status(404).end();
|
|
1395
1419
|
logger.error("Unhandled error", { error: err.message });
|
|
1396
1420
|
res.status(500).end();
|
|
1397
|
-
next();
|
|
1398
1421
|
});
|
|
1399
1422
|
if (process.env.DASHBOARD_ENABLE_MCP === "true") {
|
|
1400
1423
|
mcpClient.start().catch((e) => logger.error("MCP Client failed", { error: e.message }));
|