(messages: readonly Message[])
| 4593 | } |
| 4594 | |
| 4595 | function collectReplIds(messages: readonly Message[]): Set<string> { |
| 4596 | const ids = new Set<string>() |
| 4597 | for (const m of messages) { |
| 4598 | if (m.type === 'assistant' && Array.isArray(m.message.content)) { |
| 4599 | for (const b of m.message.content) { |
| 4600 | if (b.type === 'tool_use' && b.name === REPL_TOOL_NAME) { |
| 4601 | ids.add(b.id) |
| 4602 | } |
| 4603 | } |
| 4604 | } |
| 4605 | } |
| 4606 | return ids |
| 4607 | } |
| 4608 | |
| 4609 | /** |
| 4610 | * For external users, make REPL invisible in the persisted transcript: strip |
no test coverage detected