(homedir: string, records: readonly Record<string, unknown>[])
| 1668 | } |
| 1669 | |
| 1670 | async function writeWire(homedir: string, records: readonly Record<string, unknown>[]) { |
| 1671 | await mkdir(homedir, { recursive: true }); |
| 1672 | const wireRecords = |
| 1673 | records.length === 0 |
| 1674 | ? [] |
| 1675 | : [ |
| 1676 | { |
| 1677 | type: 'metadata', |
| 1678 | protocol_version: AGENT_WIRE_PROTOCOL_VERSION, |
| 1679 | created_at: 1, |
| 1680 | }, |
| 1681 | ...records, |
| 1682 | ]; |
| 1683 | const text = wireRecords.map((record) => JSON.stringify(record)).join('\n'); |
| 1684 | await writeFile(join(homedir, 'wire.jsonl'), text.length === 0 ? '' : `${text}\n`, 'utf-8'); |
| 1685 | } |
| 1686 | |
| 1687 | function childBashToolResultOutput(child: AgentTestContext): string | undefined { |
| 1688 | for (const entry of child.allEvents) { |
no test coverage detected