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

24 lines (23 loc) • 1.03 kB
/** * Type-safe Map wrapper for request-scoped context. * Flows from auth middleware through generate/stream/tools/memory. * Reserved keys (prefixed neurolink__) cannot be overridden by client code. */ export declare const NEUROLINK_RESOURCE_ID_KEY = "neurolink__resourceId"; export declare const NEUROLINK_THREAD_ID_KEY = "neurolink__threadId"; export declare class RequestContext<T extends Record<string, unknown> = Record<string, unknown>> { private registry; constructor(initial?: Partial<T> | [string, unknown][]); set<K extends string>(key: K, value: unknown): void; get<K extends string>(key: K): unknown; has(key: string): boolean; delete(key: string): boolean; get size(): number; /** * Merge client-provided values, but SKIP reserved keys that are already set. * This prevents clients from overriding auth middleware values. */ mergeClientContext(clientContext: Record<string, unknown>): void; toJSON(): Record<string, unknown>; private isSerializable; }