@juspay/neurolink
Version:
The pipe layer of an AI nervous system: one interface connecting provider neurons to your application, across three inference types — generate, stream and decide. `decide` returns typed, calibrated judgements from a non-generative model (~400ms, ~$0.00002
23 lines (22 loc) • 846 B
TypeScript
/**
* CLI Abort Handler (BZ-667)
*
* Bridges SIGINT (Ctrl+C) to an AbortController for graceful stream cancellation.
* First Ctrl+C aborts the stream and shows "Stream cancelled."
* Second Ctrl+C within 1 second force-exits the process.
*
* Uses `prependListener` so the stream handler fires BEFORE the top-level
* SIGINT handler in cli/index.ts (which calls process.exit). The listener
* remains registered until `cleanup()` removes it. On the first Ctrl+C the
* stream is cancelled gracefully; only a rapid second press exits.
*
* @module cli/utils/abortHandler
*/
/**
* Create an abort handler that wires SIGINT to an AbortController.
* Call cleanup() when the stream finishes (success or error) to remove listeners.
*/
export declare function createStreamAbortHandler(): {
signal: AbortSignal;
cleanup: () => void;
};