(workspaceDir, filenames)
| 132 | * Load specified memory files' full content. |
| 133 | */ |
| 134 | export async function loadMemoryFiles(workspaceDir, filenames) { |
| 135 | if (!workspaceDir || !filenames?.length) return [] |
| 136 | const topicsPath = join(memoryDir(workspaceDir), TOPICS_DIR) |
| 137 | const results = [] |
| 138 | |
| 139 | for (const filename of filenames) { |
| 140 | const safe = basename(filename) |
| 141 | try { |
| 142 | const content = await readFile(join(topicsPath, safe), 'utf8') |
| 143 | const fm = parseFrontmatter(content) |
| 144 | results.push({ |
| 145 | filename: safe, |
| 146 | content, |
| 147 | frontmatter: { name: fm.name || '', description: fm.description || '', type: fm.type || '' }, |
| 148 | }) |
| 149 | } catch { /* skip */ } |
| 150 | } |
| 151 | return results |
| 152 | } |
| 153 | |
| 154 | /** |
| 155 | * Load daily logs for recent days. |
no test coverage detected