@juspay/neurolink
Version:
Universal AI Development Platform with working MCP integration, multi-provider support, voice (TTS/STT/realtime), and professional CLI. 58+ external MCP servers discoverable, multimodal file processing, RAG pipelines. Build, test, and deploy AI applicatio
26 lines (25 loc) • 1.11 kB
TypeScript
import type { LifecycleMiddlewareConfig } from "../types/index.js";
/**
* Default deadline applied to consumer-supplied lifecycle callbacks
* (`onChunk`, `onFinish`, `onError`) when neither
* `LifecycleMiddlewareConfig.timeoutMs` nor the
* `NEUROLINK_LIFECYCLE_TIMEOUT_MS` env var is set.
*
* 5s is generous — far longer than legitimate sync logging, far
* shorter than a stuck network call. Callers with slow telemetry
* sinks should set `timeoutMs` explicitly.
*/
export declare const DEFAULT_LIFECYCLE_TIMEOUT_MS = 5000;
/**
* Resolve the deadline for a single lifecycle callback invocation.
*
* Order of precedence:
* 1. `lifecycle.timeoutMs` from the per-call SDK config
* 2. `NEUROLINK_LIFECYCLE_TIMEOUT_MS` env var (also honored by the CLI)
* 3. `DEFAULT_LIFECYCLE_TIMEOUT_MS` (5_000)
*
* Negative / non-finite values fall through to the next source. `0`
* is accepted and means "no wait" (the consumer's async work is
* effectively fire-and-forget).
*/
export declare function resolveLifecycleTimeoutMs(lifecycle?: Pick<LifecycleMiddlewareConfig, "timeoutMs"> | null): number;