(value: unknown, options: Agent.RunOptions)
| 21 | } |
| 22 | |
| 23 | function logJson(value: unknown, options: Agent.RunOptions): void { |
| 24 | let message: string; |
| 25 | try { |
| 26 | message = JSON.stringify(value); |
| 27 | } catch (error) { |
| 28 | message = JSON.stringify({ |
| 29 | error: "serialization_failed", |
| 30 | reason: error instanceof Error ? error.message : String(error), |
| 31 | }); |
| 32 | } |
| 33 | |
| 34 | process.stdout.write(`${options.logger.format(message)}\n`); |
| 35 | } |
| 36 | |
| 37 | function logError(value: unknown, options: Agent.RunOptions): void { |
| 38 | let message: string; |