| 36 | // Write error to stderr and exit with code 1. Consolidates the |
| 37 | // console.error + process.exit(1) pattern used in entrypoint fast-paths. |
| 38 | export function exitWithError(message: string): never { |
| 39 | // biome-ignore lint/suspicious/noConsole:: intentional console output |
| 40 | console.error(message) |
| 41 | // eslint-disable-next-line custom-rules/no-process-exit |
| 42 | process.exit(1) |
| 43 | } |
| 44 | |
| 45 | // Wait for a stdin-like stream to close, but give up after ms if no data ever |
| 46 | // arrives. First data chunk cancels the timeout — after that, wait for end |