(error: Error, source?: string)
| 348 | : null |
| 349 | |
| 350 | const emitRuntimeError = (error: Error, source?: string) => { |
| 351 | const errorMessage = source ? `${source}: ${error.message}` : error.message |
| 352 | |
| 353 | if (useJsonOutput) { |
| 354 | const errorEvent = { type: "error", id: Date.now(), content: errorMessage } |
| 355 | process.stdout.write(JSON.stringify(errorEvent) + "\n") |
| 356 | return |
| 357 | } |
| 358 | |
| 359 | console.error("[CLI] Error:", errorMessage) |
| 360 | console.error(error.stack) |
| 361 | } |
| 362 | |
| 363 | const clearKeepAliveInterval = () => { |
| 364 | if (!keepAliveInterval) { |
no test coverage detected