Concatenated Bash tool_result text from the stream-json transcript.
(transcript: any[])
| 37 | |
| 38 | /** Concatenated Bash tool_result text from the stream-json transcript. */ |
| 39 | function toolResultText(transcript: any[]): string { |
| 40 | const chunks: string[] = []; |
| 41 | for (const event of transcript) { |
| 42 | if (event.type !== 'user') continue; |
| 43 | for (const item of event.message?.content ?? []) { |
| 44 | if (item.type !== 'tool_result') continue; |
| 45 | if (typeof item.content === 'string') chunks.push(item.content); |
| 46 | else for (const c of item.content ?? []) if (c.type === 'text') chunks.push(c.text); |
| 47 | } |
| 48 | } |
| 49 | return chunks.join('\n'); |
| 50 | } |
| 51 | |
| 52 | async function detectVia(workDir: string, testName: string): Promise<string> { |
| 53 | const result = await runSkillTest({ |