()
| 49 | } |
| 50 | |
| 51 | export async function loadAllSessions(): Promise<ContextEntry[]> { |
| 52 | const dir = await getDevCtxDir(); |
| 53 | const sessionsDir = path.join(dir, "sessions"); |
| 54 | |
| 55 | if (!fs.existsSync(sessionsDir)) return []; |
| 56 | |
| 57 | const files = fs.readdirSync(sessionsDir).filter((f) => f.endsWith(".json")).sort().reverse(); |
| 58 | return files.map((f) => JSON.parse(fs.readFileSync(path.join(sessionsDir, f), "utf-8"))); |
| 59 | } |
| 60 | |
| 61 | /** |
| 62 | * Merge context entries from multiple sources (e.g., after git pull). |
no test coverage detected