* Reads the current content of the memory file
()
| 145 | * Reads the current content of the memory file |
| 146 | */ |
| 147 | async function readMemoryFileContent(): Promise<string> { |
| 148 | try { |
| 149 | return await fs.readFile(getGlobalMemoryFilePath(), 'utf-8'); |
| 150 | } catch (err) { |
| 151 | const error = err as Error & { code?: string }; |
| 152 | if (!(error instanceof Error) || error.code !== 'ENOENT') throw err; |
| 153 | return ''; |
| 154 | } |
| 155 | } |
| 156 | |
| 157 | /** |
| 158 | * Computes the new content that would result from adding a memory entry |
no test coverage detected