()
| 11 | |
| 12 | /** Prompt history shared across sessions, oldest first (like shell history). */ |
| 13 | export function loadPromptHistory(): string[] { |
| 14 | try { |
| 15 | const data = JSON.parse(fs.readFileSync(historyPath(), "utf8")) |
| 16 | return Array.isArray(data) ? data.filter((e): e is string => typeof e === "string") : [] |
| 17 | } catch { |
| 18 | return [] |
| 19 | } |
| 20 | } |
| 21 | |
| 22 | export function appendPromptHistory(entry: string): void { |
| 23 | try { |
no test coverage detected