MCPcopy Create free account
hub / github.com/EvoMap/evolver / readJsonl

Function readJsonl

src/webui/observer/jsonl.js:16–34  ·  view source on GitHub ↗
(filePath, opts = {})

Source from the content-addressed store, hash-verified

14}
15
16function readJsonl(filePath, opts = {}) {
17 try {
18 if (!filePath || !fs.existsSync(filePath)) return [];
19 const raw = fs.readFileSync(filePath, 'utf8');
20 const lines = raw.split('\n').map((line) => line.trim()).filter(Boolean);
21 const selected = opts.last ? lines.slice(-toPositiveInt(opts.last, lines.length)) : lines;
22 const rows = [];
23 for (const line of selected) {
24 try {
25 rows.push(JSON.parse(line));
26 } catch {
27 // Corrupt JSONL rows should not break the dashboard.
28 }
29 }
30 return rows;
31 } catch {
32 return [];
33 }
34}
35
36function tailText(filePath, maxLines) {
37 try {

Callers 12

getAssetOverviewFunction · 0.70
listEventsFunction · 0.70
listCandidatesFunction · 0.70
listAssetCallsFunction · 0.70
getLineageFunction · 0.70
readGenesFunction · 0.70
readCapsulesFunction · 0.70
getMemoryGraphFunction · 0.70
readPipelineEventsFunction · 0.70
readMailboxMessagesFunction · 0.70
getRunFunction · 0.70
buildRunsFunction · 0.70

Calls 2

toPositiveIntFunction · 0.85
parseMethod · 0.80

Tested by

no test coverage detected