( memoryPath: string, id: string )
| 122 | } |
| 123 | |
| 124 | export async function removeMemory( |
| 125 | memoryPath: string, |
| 126 | id: string |
| 127 | ): Promise<{ status: 'removed' | 'not_found' }> { |
| 128 | const existing = await readMemoriesFile(memoryPath); |
| 129 | const index = existing.findIndex((m) => m.id === id); |
| 130 | if (index === -1) return { status: 'not_found' }; |
| 131 | existing.splice(index, 1); |
| 132 | await writeMemoriesFile(memoryPath, existing); |
| 133 | return { status: 'removed' }; |
| 134 | } |
| 135 | |
| 136 | export function filterMemories(memories: Memory[], filters: MemoryFilters): Memory[] { |
| 137 | const { category, type, query } = filters; |
no test coverage detected