@elizaos/server 1.1.3 → 1.1.4
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 +30 -17
- package/dist/index.js.map +1 -1
- package/package.json +4 -4
package/dist/index.js
CHANGED
|
@@ -3816,7 +3816,7 @@ import express28 from "express";
|
|
|
3816
3816
|
// package.json
|
|
3817
3817
|
var package_default = {
|
|
3818
3818
|
name: "@elizaos/server",
|
|
3819
|
-
version: "1.1.
|
|
3819
|
+
version: "1.1.4",
|
|
3820
3820
|
description: "ElizaOS Server - Core server infrastructure for ElizaOS agents",
|
|
3821
3821
|
publishConfig: {
|
|
3822
3822
|
access: "public",
|
|
@@ -3868,10 +3868,10 @@ var package_default = {
|
|
|
3868
3868
|
which: "^4.0.0",
|
|
3869
3869
|
ws: "^8.18.0"
|
|
3870
3870
|
},
|
|
3871
|
-
gitHead: "
|
|
3871
|
+
gitHead: "06db8f7642156822f010efef3377af4c6161f2c8",
|
|
3872
3872
|
dependencies: {
|
|
3873
|
-
"@elizaos/core": "1.1.
|
|
3874
|
-
"@elizaos/plugin-sql": "1.1.
|
|
3873
|
+
"@elizaos/core": "1.1.4",
|
|
3874
|
+
"@elizaos/plugin-sql": "1.1.4",
|
|
3875
3875
|
"@types/express": "^5.0.2",
|
|
3876
3876
|
"@types/helmet": "^4.0.0",
|
|
3877
3877
|
"@types/multer": "^1.4.13",
|
|
@@ -4393,6 +4393,11 @@ function createPluginRouteHandler(agents) {
|
|
|
4393
4393
|
if (req.path.startsWith("/api/messages/")) {
|
|
4394
4394
|
return next();
|
|
4395
4395
|
}
|
|
4396
|
+
const clientRoutePattern = /^\/(chat|settings|agents|profile|dashboard|login|register|admin|home|about)\b/i;
|
|
4397
|
+
if (clientRoutePattern.test(req.path)) {
|
|
4398
|
+
logger25.debug(`Skipping client-side route in plugin handler: ${req.path}`);
|
|
4399
|
+
return next();
|
|
4400
|
+
}
|
|
4396
4401
|
if (req.path.endsWith(".js") || req.path.includes(".js?") || req.path.match(/index-[A-Za-z0-9]{8}\.js/)) {
|
|
4397
4402
|
logger25.debug(`JavaScript request in plugin handler: ${req.method} ${req.path}`);
|
|
4398
4403
|
res.setHeader("Content-Type", "application/javascript");
|
|
@@ -4494,25 +4499,33 @@ function createPluginRouteHandler(agents) {
|
|
|
4494
4499
|
logger25.warn(
|
|
4495
4500
|
`Agent ID ${agentIdFromQuery} provided in query, but agent runtime not found. Path: ${reqPath}.`
|
|
4496
4501
|
);
|
|
4497
|
-
|
|
4502
|
+
if (reqPath.startsWith("/api/")) {
|
|
4503
|
+
res.status(404).json({
|
|
4504
|
+
success: false,
|
|
4505
|
+
error: {
|
|
4506
|
+
message: "Agent not found",
|
|
4507
|
+
code: "AGENT_NOT_FOUND"
|
|
4508
|
+
}
|
|
4509
|
+
});
|
|
4510
|
+
return;
|
|
4511
|
+
} else {
|
|
4512
|
+
return next();
|
|
4513
|
+
}
|
|
4514
|
+
}
|
|
4515
|
+
} else if (agentIdFromQuery && !validateUuid21(agentIdFromQuery)) {
|
|
4516
|
+
logger25.warn(`Invalid Agent ID format in query: ${agentIdFromQuery}. Path: ${reqPath}.`);
|
|
4517
|
+
if (reqPath.startsWith("/api/")) {
|
|
4518
|
+
res.status(400).json({
|
|
4498
4519
|
success: false,
|
|
4499
4520
|
error: {
|
|
4500
|
-
message: "
|
|
4501
|
-
code: "
|
|
4521
|
+
message: "Invalid agent ID format",
|
|
4522
|
+
code: "INVALID_AGENT_ID"
|
|
4502
4523
|
}
|
|
4503
4524
|
});
|
|
4504
4525
|
return;
|
|
4526
|
+
} else {
|
|
4527
|
+
return next();
|
|
4505
4528
|
}
|
|
4506
|
-
} else if (agentIdFromQuery && !validateUuid21(agentIdFromQuery)) {
|
|
4507
|
-
logger25.warn(`Invalid Agent ID format in query: ${agentIdFromQuery}. Path: ${reqPath}.`);
|
|
4508
|
-
res.status(400).json({
|
|
4509
|
-
success: false,
|
|
4510
|
-
error: {
|
|
4511
|
-
message: "Invalid agent ID format",
|
|
4512
|
-
code: "INVALID_AGENT_ID"
|
|
4513
|
-
}
|
|
4514
|
-
});
|
|
4515
|
-
return;
|
|
4516
4529
|
} else {
|
|
4517
4530
|
logger25.debug(`No valid agentId in query. Trying global match for path: ${reqPath}`);
|
|
4518
4531
|
for (const [_, runtime] of agents) {
|