@hasna/mementos 0.4.29 → 0.4.30
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":"index.d.ts","sourceRoot":"","sources":["../../src/server/index.ts"],"names":[],"mappings":";AACA;;;GAGG;AA2qCH,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/server/index.ts"],"names":[],"mappings":";AACA;;;GAGG;AA2qCH,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CA6H9C"}
|
package/dist/server/index.js
CHANGED
|
@@ -2984,7 +2984,14 @@ function startServer(port) {
|
|
|
2984
2984
|
const { createRequire } = await import("module");
|
|
2985
2985
|
const req2 = createRequire(import.meta.url);
|
|
2986
2986
|
const pkg = req2("../../package.json");
|
|
2987
|
-
|
|
2987
|
+
const db = getDatabase();
|
|
2988
|
+
const total = db.query("SELECT COUNT(*) as c FROM memories WHERE status = 'active'").get().c;
|
|
2989
|
+
const expired = db.query("SELECT COUNT(*) as c FROM memories WHERE status = 'expired' OR (expires_at IS NOT NULL AND expires_at < datetime('now'))").get().c;
|
|
2990
|
+
const pinned = db.query("SELECT COUNT(*) as c FROM memories WHERE status = 'active' AND pinned = 1").get().c;
|
|
2991
|
+
const agents = db.query("SELECT COUNT(*) as c FROM agents").get().c;
|
|
2992
|
+
const projects = db.query("SELECT COUNT(*) as c FROM projects").get().c;
|
|
2993
|
+
const status = expired > 50 ? "warn" : "ok";
|
|
2994
|
+
return json({ status, version: pkg.version, profile: profile ?? "default", db_path: getDbPath2(), hostname, memories: { total, expired, pinned }, agents, projects });
|
|
2988
2995
|
}
|
|
2989
2996
|
if (pathname === "/api/profile" && req.method === "GET") {
|
|
2990
2997
|
const profile = getActiveProfile();
|