(endpoint: string)
| 54 | } |
| 55 | |
| 56 | async read(endpoint: string): Promise<LearnSessionCacheValue | undefined> { |
| 57 | const normalizedEndpoint = normalizeEndpoint(endpoint); |
| 58 | const cache = await this.readCacheFile(); |
| 59 | const entry = cache.entries[normalizedEndpoint]; |
| 60 | |
| 61 | if (!entry) { |
| 62 | return undefined; |
| 63 | } |
| 64 | |
| 65 | if (new Date(entry.expiresAt).getTime() <= this.now()) { |
| 66 | delete cache.entries[normalizedEndpoint]; |
| 67 | await this.writeCacheFile(cache); |
| 68 | return undefined; |
| 69 | } |
| 70 | |
| 71 | return entry; |
| 72 | } |
| 73 | |
| 74 | async write(value: { endpoint: string; sessionId?: string; tools?: ListedTool[] }): Promise<LearnSessionCacheValue> { |
| 75 | const normalizedEndpoint = normalizeEndpoint(value.endpoint); |
nothing calls this directly
no test coverage detected