(error: Error, source?: string)
| 455 | : null |
| 456 | |
| 457 | const emitRuntimeError = (error: Error, source?: string) => { |
| 458 | const errorMessage = source ? `${source}: ${error.message}` : error.message |
| 459 | |
| 460 | if (useJsonOutput) { |
| 461 | const errorEvent = { type: "error", id: Date.now(), content: errorMessage } |
| 462 | process.stdout.write(JSON.stringify(errorEvent) + "\n") |
| 463 | return |
| 464 | } |
| 465 | |
| 466 | console.error("[CLI] Error:", errorMessage) |
| 467 | console.error(error.stack) |
| 468 | } |
| 469 | |
| 470 | const clearKeepAliveInterval = () => { |
| 471 | if (!keepAliveInterval) { |
no test coverage detected