MCPcopy
hub / github.com/OpenCoworkAI/open-codesign / listDiagnosticEvents

Function listDiagnosticEvents

apps/desktop/src/main/snapshots-db.ts:585–596  ·  view source on GitHub ↗
(
  db: Database,
  opts?: { limit?: number; includeTransient?: boolean },
)

Source from the content-addressed store, hash-verified

583}
584
585export function listDiagnosticEvents(
586 db: Database,
587 opts?: { limit?: number; includeTransient?: boolean },
588): DiagnosticEventRow[] {
589 const limit = opts?.limit ?? 100;
590 const includeTransient = opts?.includeTransient ?? false;
591 return readStore(db)
592 .diagnosticEvents.filter((event) => includeTransient || !event.transient)
593 .sort((a, b) => b.ts - a.ts || b.id - a.id)
594 .slice(0, limit)
595 .map(rowToDiagnosticEvent);
596}
597
598export function pruneDiagnosticEvents(db: Database, maxRows: number): number {
599 return mutateStore(db, (data) => {

Callers 3

registerDiagnosticsIpcFunction · 0.90

Calls 1

readStoreFunction · 0.85

Tested by

no test coverage detected