(threadId: string)
| 25 | import { handledAction, unhandledAction } from './action-router-result.ts' |
| 26 | |
| 27 | async function deletePersistedThread(threadId: string) { |
| 28 | const sessionPath = getThreadSessionPath(threadId) |
| 29 | if (sessionPath) { |
| 30 | try { |
| 31 | await unlink(sessionPath) |
| 32 | } catch (error) { |
| 33 | if ( |
| 34 | typeof error !== 'object' || |
| 35 | error === null || |
| 36 | !('code' in error) || |
| 37 | error.code !== 'ENOENT' |
| 38 | ) { |
| 39 | throw error |
| 40 | } |
| 41 | } |
| 42 | } |
| 43 | |
| 44 | if (sessionPath) { |
| 45 | deleteArtifactsForConversation(sessionPath) |
| 46 | deleteChatThread(sessionPath) |
| 47 | } |
| 48 | deleteThreadRecord(threadId) |
| 49 | } |
| 50 | |
| 51 | async function deletePersistedThreads(threadIds: string[]) { |
| 52 | const deletedThreadIds: string[] = [] |
no test coverage detected