(query = {})
| 21 | } |
| 22 | |
| 23 | function getMemoryGraph(query = {}) { |
| 24 | const limit = Math.min(Number(query.limit) || 50, 500); |
| 25 | const graphPath = path.join(getEvolutionDir(), 'memory_graph.jsonl'); |
| 26 | if (!fs.existsSync(graphPath)) return { exists: false, items: [] }; |
| 27 | const rows = readJsonl(graphPath, { last: limit }).map(redactValue); |
| 28 | return { |
| 29 | exists: true, |
| 30 | total: countLines(graphPath), |
| 31 | items: rows.reverse(), |
| 32 | }; |
| 33 | } |
| 34 | |
| 35 | function countLines(filePath) { |
| 36 | try { |
nothing calls this directly
no test coverage detected