(checkpointer: SqliteSaver, threadId: string)
| 37 | * Returns true if user wants to resume, false if start fresh, undefined if no checkpoint exists |
| 38 | */ |
| 39 | export async function promptCheckpointChoice(checkpointer: SqliteSaver, threadId: string): Promise<boolean | undefined> { |
| 40 | const hasCheckpoint = await checkpointExists(checkpointer, threadId); |
| 41 | |
| 42 | if (!hasCheckpoint) { |
| 43 | return undefined; |
| 44 | } |
| 45 | |
| 46 | const choice = await promptUserChoice(); |
| 47 | return choice === 'resume'; |
| 48 | } |
| 49 | |
| 50 | /** |
| 51 | * Clear checkpoint for the given thread_id (exported for external use) |
no test coverage detected