(messages: SessionV1.WithParts[])
| 15 | import type { MessageID } from "./schema" |
| 16 | |
| 17 | function extract(messages: SessionV1.WithParts[]) { |
| 18 | const paths = new Set<string>() |
| 19 | for (const msg of messages) { |
| 20 | for (const part of msg.parts) { |
| 21 | if (part.type === "tool" && part.tool === "read" && part.state.status === "completed") { |
| 22 | if (part.state.time.compacted) continue |
| 23 | const loaded = part.state.metadata?.loaded |
| 24 | if (!loaded || !Array.isArray(loaded)) continue |
| 25 | for (const p of loaded) { |
| 26 | if (typeof p === "string") paths.add(p) |
| 27 | } |
| 28 | } |
| 29 | } |
| 30 | } |
| 31 | return paths |
| 32 | } |
| 33 | |
| 34 | export interface Interface { |
| 35 | readonly clear: (messageID: MessageID) => Effect.Effect<void> |
no test coverage detected