(page: Page, name: string)
| 26 | }) |
| 27 | |
| 28 | async function getToolOutput(page: Page, name: string) { |
| 29 | const text = await page.locator('#messages-json-content').textContent() |
| 30 | const messages = z.array(MessageSchema).parse(JSON.parse(text || '[]')) |
| 31 | |
| 32 | for (const message of messages) { |
| 33 | for (const partData of message.parts ?? []) { |
| 34 | const part = ToolCallPartSchema.safeParse(partData) |
| 35 | if (part.success && part.data.name === name && part.data.output) { |
| 36 | return part.data.output |
| 37 | } |
| 38 | } |
| 39 | } |
| 40 | |
| 41 | return undefined |
| 42 | } |
| 43 | |
| 44 | async function getRuntimeContextOutput(page: Page, name: string) { |
| 45 | const output = await getToolOutput(page, name) |
no test coverage detected