()
| 95 | } |
| 96 | |
| 97 | function buildOutputSchema() { |
| 98 | return lazySchema(() => |
| 99 | z.object({ |
| 100 | result: z.unknown().optional(), |
| 101 | stdout: z.string(), |
| 102 | stderr: z.string(), |
| 103 | error: z.string().optional(), |
| 104 | toolCalls: z.array( |
| 105 | z.object({ |
| 106 | toolName: z.string(), |
| 107 | toolInput: z.record(z.string(), z.unknown()), |
| 108 | success: z.boolean(), |
| 109 | result: z.unknown().optional(), |
| 110 | error: z.string().optional(), |
| 111 | }), |
| 112 | ), |
| 113 | }), |
| 114 | ) |
| 115 | } |
| 116 | |
| 117 | function ensureRecord(value: unknown): Record<string, unknown> { |
| 118 | if (value && typeof value === 'object' && !Array.isArray(value)) { |
no test coverage detected