UNPKG

@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

39 lines (38 loc) • 1.98 kB
import { chmodSync } from "node:fs"; import { appendFile } from "node:fs/promises"; import type { ProxyLifecycleEventInput, ProxyLifecycleLoggerOptions, ProxyLifecycleLoggerSnapshot } from "../types/index.js"; export declare function hashProxyLifecycleSessionId(sessionId: string | undefined): string | undefined; /** * Configure private journal storage while retaining required admission * when initialization fails. */ export declare function configureProxyLifecycleLogger(options: ProxyLifecycleLoggerOptions): void; /** Enqueue fixed-size lifecycle metadata without awaiting filesystem work. */ export declare function logProxyLifecycleEvent(input: ProxyLifecycleEventInput): void; /** Confirm admission before upstream dispatch, without waiting for later traffic. * Disabled logging is explicit; an enabled but unhealthy sink refuses dispatch. * A timeout never retries an ambiguous provider request or the pending append. */ export declare function persistProxyLifecycleAcceptance(input: Omit<ProxyLifecycleEventInput, "event">, timeoutMs?: number): Promise<void>; export declare function flushProxyLifecycleEvents(timeoutMs?: number): Promise<void>; /** * Expose journal accounting, process identity, and outstanding writes * without changing them. */ export declare function getProxyLifecycleLoggerSnapshot(): ProxyLifecycleLoggerSnapshot; /** * Reset timers, accounting, and injected I/O after isolated tests have * drained their work. */ export declare function resetProxyLifecycleLoggerForTests(): void; /** Isolated failure injection for lifecycle durability tests. */ export declare const __proxyLifecycleTestHooks: { /** * Inject directory-hardening failures without altering real filesystem permissions. */ setChmodForTests(chmod: typeof chmodSync): void; /** * Inject controlled append outcomes while preserving the production admission and queue paths. */ setAppendFileForTests(append: typeof appendFile): void; };