()
| 84 | * Load custom session memory template from file if it exists |
| 85 | */ |
| 86 | export async function loadSessionMemoryTemplate(): Promise<string> { |
| 87 | const templatePath = join( |
| 88 | getClaudeConfigHomeDir(), |
| 89 | 'session-memory', |
| 90 | 'config', |
| 91 | 'template.md', |
| 92 | ) |
| 93 | |
| 94 | try { |
| 95 | return await readFile(templatePath, { encoding: 'utf-8' }) |
| 96 | } catch (e: unknown) { |
| 97 | const code = getErrnoCode(e) |
| 98 | if (code === 'ENOENT') { |
| 99 | return DEFAULT_SESSION_MEMORY_TEMPLATE |
| 100 | } |
| 101 | logError(toError(e)) |
| 102 | return DEFAULT_SESSION_MEMORY_TEMPLATE |
| 103 | } |
| 104 | } |
| 105 | |
| 106 | /** |
| 107 | * Load custom session memory prompt from file if it exists |
no test coverage detected