({ threadId, includeTurns = false })
| 337 | } |
| 338 | |
| 339 | async readThread({ threadId, includeTurns = false }) { |
| 340 | const thread = this.threads.get(threadId) ?? null; |
| 341 | if (!thread) { |
| 342 | return null; |
| 343 | } |
| 344 | return { |
| 345 | ...thread, |
| 346 | turns: includeTurns ? thread.turns : [], |
| 347 | }; |
| 348 | } |
| 349 | |
| 350 | async listThreads({ limit = 20, cursor = null, searchTerm = null, archived = false } = {}) { |
| 351 | const offset = cursor ? Number(cursor) : 0; |