You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: packages/server/src/api/system.ts
+84Lines changed: 84 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -167,6 +167,90 @@ export function registerSystemRoutes(app: FastifyInstance, cortex: CortexApp): v
167
167
return{ok: false,error: e.message};
168
168
}
169
169
});
170
+
// Component health status
171
+
app.get('/api/v1/health/components',async()=>{
172
+
constdb=getDb();
173
+
constconfig=getConfig();
174
+
constcomponents: any[]=[];
175
+
176
+
// 1. Extraction LLM
177
+
try{
178
+
constlast=db.prepare(`SELECT channel, created_at, latency_ms, memories_written, memories_deduped FROM extraction_logs ORDER BY created_at DESC LIMIT 1`).get()asany;
179
+
consterrorCount=(db.prepare(`SELECT COUNT(*) as c FROM extraction_logs WHERE memories_written = 0 AND created_at > datetime('now', '-24 hours')`).get()asany)?.c||0;
180
+
consttotalLast24h=(db.prepare(`SELECT COUNT(*) as c FROM extraction_logs WHERE created_at > datetime('now', '-24 hours')`).get()asany)?.c||0;
constlast=db.prepare(`SELECT action, executed_at, details FROM lifecycle_log WHERE action = 'lifecycle_run' ORDER BY executed_at DESC LIMIT 1`).get()asany;
0 commit comments