@elizaos/server 1.5.8-alpha.14 → 1.5.8-alpha.16
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.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"panels.d.ts","sourceRoot":"","sources":["../../../src/api/agents/panels.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AAEzD,OAAO,OAAO,MAAM,SAAS,CAAC;AAG9B;;GAEG;AACH,wBAAgB,uBAAuB,CAAC,MAAM,EAAE,GAAG,CAAC,IAAI,EAAE,aAAa,CAAC,GAAG,OAAO,CAAC,MAAM,
|
|
1
|
+
{"version":3,"file":"panels.d.ts","sourceRoot":"","sources":["../../../src/api/agents/panels.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AAEzD,OAAO,OAAO,MAAM,SAAS,CAAC;AAG9B;;GAEG;AACH,wBAAgB,uBAAuB,CAAC,MAAM,EAAE,GAAG,CAAC,IAAI,EAAE,aAAa,CAAC,GAAG,OAAO,CAAC,MAAM,CAwCxF"}
|
package/dist/api/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/api/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AAGzD,OAAO,OAAO,MAAM,SAAS,CAAC;AAE9B,OAAO,IAAI,MAAM,WAAW,CAAC;AAE7B,OAAO,EAAE,MAAM,IAAI,cAAc,EAAE,MAAM,WAAW,CAAC;AACrD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAkB5C;;;;GAIG;AAIH,wBAAgB,aAAa,CAC3B,MAAM,EAAE,IAAI,CAAC,MAAM,EACnB,MAAM,EAAE,GAAG,CAAC,IAAI,EAAE,aAAa,CAAC,EAChC,cAAc,EAAE,WAAW,GAC1B,cAAc,CAkBhB;AAyCD,wBAAgB,wBAAwB,CAAC,MAAM,EAAE,GAAG,CAAC,IAAI,EAAE,aAAa,CAAC,GAAG,OAAO,CAAC,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/api/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AAGzD,OAAO,OAAO,MAAM,SAAS,CAAC;AAE9B,OAAO,IAAI,MAAM,WAAW,CAAC;AAE7B,OAAO,EAAE,MAAM,IAAI,cAAc,EAAE,MAAM,WAAW,CAAC;AACrD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAkB5C;;;;GAIG;AAIH,wBAAgB,aAAa,CAC3B,MAAM,EAAE,IAAI,CAAC,MAAM,EACnB,MAAM,EAAE,GAAG,CAAC,IAAI,EAAE,aAAa,CAAC,EAChC,cAAc,EAAE,WAAW,GAC1B,cAAc,CAkBhB;AAyCD,wBAAgB,wBAAwB,CAAC,MAAM,EAAE,GAAG,CAAC,IAAI,EAAE,aAAa,CAAC,GAAG,OAAO,CAAC,cAAc,CA6NjG;AAED;;;;;GAKG;AACH,wBAAgB,eAAe,CAC7B,MAAM,EAAE,GAAG,CAAC,IAAI,EAAE,aAAa,CAAC,EAChC,cAAc,EAAE,WAAW,GAC1B,OAAO,CAAC,MAAM,CAuEhB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"logging.d.ts","sourceRoot":"","sources":["../../../src/api/runtime/logging.ts"],"names":[],"mappings":"AACA,OAAO,OAAO,MAAM,SAAS,CAAC;AA8B9B;;GAEG;AACH,wBAAgB,mBAAmB,IAAI,OAAO,CAAC,MAAM,
|
|
1
|
+
{"version":3,"file":"logging.d.ts","sourceRoot":"","sources":["../../../src/api/runtime/logging.ts"],"names":[],"mappings":"AACA,OAAO,OAAO,MAAM,SAAS,CAAC;AA8B9B;;GAEG;AACH,wBAAgB,mBAAmB,IAAI,OAAO,CAAC,MAAM,CAkKpD"}
|
package/dist/index.js
CHANGED
|
@@ -1731,9 +1731,9 @@ function createAgentPanelsRouter(agents) {
|
|
|
1731
1731
|
return sendError(res, 404, "NOT_FOUND", "Agent not found");
|
|
1732
1732
|
}
|
|
1733
1733
|
try {
|
|
1734
|
-
const publicPanels = runtime.
|
|
1734
|
+
const publicPanels = runtime.routes.filter((route) => route.public === true && route.type === "GET" && route.name).map((route) => ({
|
|
1735
1735
|
name: route.name,
|
|
1736
|
-
path: `/api${route.path.startsWith("/") ? route.path : `/${route.path}`}?agentId=${agentId}`
|
|
1736
|
+
path: `/api/agents/${agentId}/plugins${route.path.startsWith("/") ? route.path : `/${route.path}`}?agentId=${agentId}`
|
|
1737
1737
|
}));
|
|
1738
1738
|
sendSuccess(res, publicPanels);
|
|
1739
1739
|
} catch (error) {
|
|
@@ -5547,7 +5547,7 @@ function createHealthRouter(agents, serverInstance) {
|
|
|
5547
5547
|
}
|
|
5548
5548
|
|
|
5549
5549
|
// src/api/runtime/logging.ts
|
|
5550
|
-
import { logger as logger23 } from "@elizaos/core";
|
|
5550
|
+
import { logger as logger23, recentLogs } from "@elizaos/core";
|
|
5551
5551
|
import express24 from "express";
|
|
5552
5552
|
var LOG_LEVELS = {
|
|
5553
5553
|
fatal: 60,
|
|
@@ -5568,24 +5568,60 @@ function createLoggingRouter() {
|
|
|
5568
5568
|
const requestedAgentName = req.query.agentName?.toString() || "all";
|
|
5569
5569
|
const requestedAgentId = req.query.agentId?.toString() || "all";
|
|
5570
5570
|
const limit = Math.min(Number(req.query.limit) || 100, 1000);
|
|
5571
|
-
const destination = logger23[Symbol.for("pino-destination")];
|
|
5572
|
-
if (!destination?.recentLogs) {
|
|
5573
|
-
return res.status(500).json({
|
|
5574
|
-
error: "Logger destination not available",
|
|
5575
|
-
message: "The logger is not configured to maintain recent logs"
|
|
5576
|
-
});
|
|
5577
|
-
}
|
|
5578
5571
|
try {
|
|
5579
|
-
const
|
|
5572
|
+
const recentLogsString = recentLogs();
|
|
5573
|
+
let logEntries = [];
|
|
5574
|
+
if (recentLogsString) {
|
|
5575
|
+
const lines = recentLogsString.split(`
|
|
5576
|
+
`).filter((line) => line.trim());
|
|
5577
|
+
logEntries = lines.map((line, index) => {
|
|
5578
|
+
const cleanLine = line.replace(/\u001B\[[0-9;]*m/g, "");
|
|
5579
|
+
const logMatch = cleanLine.match(/^(\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}\.\d{3}Z)\s+(\w+)\s+(.+)$/);
|
|
5580
|
+
if (logMatch) {
|
|
5581
|
+
const [, timestamp, levelStr, message] = logMatch;
|
|
5582
|
+
let level = LOG_LEVELS.info;
|
|
5583
|
+
const levelLower = levelStr.trim().toLowerCase();
|
|
5584
|
+
if (levelLower === "error")
|
|
5585
|
+
level = LOG_LEVELS.error;
|
|
5586
|
+
else if (levelLower === "warn")
|
|
5587
|
+
level = LOG_LEVELS.warn;
|
|
5588
|
+
else if (levelLower === "info")
|
|
5589
|
+
level = LOG_LEVELS.info;
|
|
5590
|
+
else if (levelLower === "log")
|
|
5591
|
+
level = LOG_LEVELS.log;
|
|
5592
|
+
else if (levelLower === "progress")
|
|
5593
|
+
level = LOG_LEVELS.progress;
|
|
5594
|
+
else if (levelLower === "success")
|
|
5595
|
+
level = LOG_LEVELS.success;
|
|
5596
|
+
else if (levelLower === "debug")
|
|
5597
|
+
level = LOG_LEVELS.debug;
|
|
5598
|
+
else if (levelLower === "trace")
|
|
5599
|
+
level = LOG_LEVELS.trace;
|
|
5600
|
+
else if (levelLower === "fatal")
|
|
5601
|
+
level = LOG_LEVELS.fatal;
|
|
5602
|
+
return {
|
|
5603
|
+
time: new Date(timestamp).getTime(),
|
|
5604
|
+
level,
|
|
5605
|
+
msg: message.trim()
|
|
5606
|
+
};
|
|
5607
|
+
} else {
|
|
5608
|
+
return {
|
|
5609
|
+
time: Date.now() - (lines.length - index) * 1000,
|
|
5610
|
+
level: LOG_LEVELS.info,
|
|
5611
|
+
msg: line.trim()
|
|
5612
|
+
};
|
|
5613
|
+
}
|
|
5614
|
+
});
|
|
5615
|
+
}
|
|
5580
5616
|
const requestedLevelValue = requestedLevel === "all" ? 0 : LOG_LEVELS[requestedLevel] || LOG_LEVELS.info;
|
|
5581
|
-
const logsWithAgentNames =
|
|
5582
|
-
const logsWithAgentIds =
|
|
5583
|
-
const totalLogs =
|
|
5617
|
+
const logsWithAgentNames = logEntries.filter((l) => l.agentName).length;
|
|
5618
|
+
const logsWithAgentIds = logEntries.filter((l) => l.agentId).length;
|
|
5619
|
+
const totalLogs = logEntries.length;
|
|
5584
5620
|
const agentNamePopulationRate = totalLogs > 0 ? logsWithAgentNames / totalLogs : 0;
|
|
5585
5621
|
const agentIdPopulationRate = totalLogs > 0 ? logsWithAgentIds / totalLogs : 0;
|
|
5586
5622
|
const isAgentNameDataSparse = agentNamePopulationRate < 0.1;
|
|
5587
5623
|
const isAgentIdDataSparse = agentIdPopulationRate < 0.1;
|
|
5588
|
-
const filtered =
|
|
5624
|
+
const filtered = logEntries.filter((log) => {
|
|
5589
5625
|
const timeMatch = log.time >= since;
|
|
5590
5626
|
let levelMatch = true;
|
|
5591
5627
|
if (requestedLevel && requestedLevel !== "all") {
|
|
@@ -5609,27 +5645,11 @@ function createLoggingRouter() {
|
|
|
5609
5645
|
}
|
|
5610
5646
|
return timeMatch && levelMatch && agentNameMatch && agentIdMatch;
|
|
5611
5647
|
}).slice(-limit);
|
|
5612
|
-
logger23.debug(
|
|
5613
|
-
requestedLevel,
|
|
5614
|
-
requestedLevelValue,
|
|
5615
|
-
requestedAgentName,
|
|
5616
|
-
requestedAgentId,
|
|
5617
|
-
filteredCount: filtered.length,
|
|
5618
|
-
totalLogs: recentLogs.length,
|
|
5619
|
-
logsWithAgentNames,
|
|
5620
|
-
logsWithAgentIds,
|
|
5621
|
-
agentNamePopulationRate: Math.round(agentNamePopulationRate * 100) + "%",
|
|
5622
|
-
agentIdPopulationRate: Math.round(agentIdPopulationRate * 100) + "%",
|
|
5623
|
-
isAgentNameDataSparse,
|
|
5624
|
-
isAgentIdDataSparse,
|
|
5625
|
-
sampleLogAgentNames: recentLogs.slice(0, 5).map((log) => log.agentName),
|
|
5626
|
-
uniqueAgentNamesInLogs: [...new Set(recentLogs.map((log) => log.agentName))].filter(Boolean),
|
|
5627
|
-
exactAgentNameMatches: recentLogs.filter((log) => log.agentName === requestedAgentName).length
|
|
5628
|
-
}));
|
|
5648
|
+
logger23.debug(`Logs request processed: ${filtered.length}/${logEntries.length} logs returned ` + `(level: ${requestedLevel}, agent: ${requestedAgentName})`);
|
|
5629
5649
|
res.json({
|
|
5630
5650
|
logs: filtered,
|
|
5631
5651
|
count: filtered.length,
|
|
5632
|
-
total:
|
|
5652
|
+
total: logEntries.length,
|
|
5633
5653
|
requestedLevel,
|
|
5634
5654
|
agentName: requestedAgentName,
|
|
5635
5655
|
agentId: requestedAgentId,
|
|
@@ -5646,14 +5666,7 @@ function createLoggingRouter() {
|
|
|
5646
5666
|
router.post("/logs", logsHandler);
|
|
5647
5667
|
const logsClearHandler = (_req, res) => {
|
|
5648
5668
|
try {
|
|
5649
|
-
|
|
5650
|
-
if (!destination?.clear) {
|
|
5651
|
-
return res.status(500).json({
|
|
5652
|
-
error: "Logger clear method not available",
|
|
5653
|
-
message: "The logger is not configured to clear logs"
|
|
5654
|
-
});
|
|
5655
|
-
}
|
|
5656
|
-
destination.clear();
|
|
5669
|
+
logger23.clear();
|
|
5657
5670
|
logger23.debug("Logs cleared via API endpoint");
|
|
5658
5671
|
res.json({ status: "success", message: "Logs cleared successfully" });
|
|
5659
5672
|
} catch (error) {
|
|
@@ -5826,7 +5839,7 @@ import express29 from "express";
|
|
|
5826
5839
|
// package.json
|
|
5827
5840
|
var package_default = {
|
|
5828
5841
|
name: "@elizaos/server",
|
|
5829
|
-
version: "1.5.8-alpha.
|
|
5842
|
+
version: "1.5.8-alpha.16",
|
|
5830
5843
|
description: "ElizaOS Server - Core server infrastructure for ElizaOS agents",
|
|
5831
5844
|
publishConfig: {
|
|
5832
5845
|
access: "public",
|
|
@@ -6356,6 +6369,9 @@ function createPluginRouteHandler(agents) {
|
|
|
6356
6369
|
for (const route of runtime.routes) {
|
|
6357
6370
|
if (handled)
|
|
6358
6371
|
break;
|
|
6372
|
+
const methodMatches = req.method.toLowerCase() === route.type.toLowerCase();
|
|
6373
|
+
if (!methodMatches)
|
|
6374
|
+
continue;
|
|
6359
6375
|
const routePath = route.path;
|
|
6360
6376
|
if (routePath.endsWith("/*")) {
|
|
6361
6377
|
const baseRoute = routePath.slice(0, -1);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@elizaos/server",
|
|
3
|
-
"version": "1.5.8-alpha.
|
|
3
|
+
"version": "1.5.8-alpha.16",
|
|
4
4
|
"description": "ElizaOS Server - Core server infrastructure for ElizaOS agents",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public",
|
|
@@ -51,10 +51,10 @@
|
|
|
51
51
|
"which": "^4.0.0",
|
|
52
52
|
"ws": "^8.18.0"
|
|
53
53
|
},
|
|
54
|
-
"gitHead": "
|
|
54
|
+
"gitHead": "7a0dd58e941de32b231dd58fbfdccfdb96de05a9",
|
|
55
55
|
"dependencies": {
|
|
56
|
-
"@elizaos/core": "1.5.8-alpha.
|
|
57
|
-
"@elizaos/plugin-sql": "1.5.8-alpha.
|
|
56
|
+
"@elizaos/core": "1.5.8-alpha.16",
|
|
57
|
+
"@elizaos/plugin-sql": "1.5.8-alpha.16",
|
|
58
58
|
"@types/express": "^5.0.2",
|
|
59
59
|
"@types/helmet": "^4.0.0",
|
|
60
60
|
"@types/multer": "^1.4.13",
|