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

40 lines (39 loc) • 2.37 kB
import type { JsonValue } from "../types/index.js"; /** * @description Masks the value stored under a credential-looking key. Structures under a plural token key (`tokens`) keep their shape with every string masked; anything else collapses to the placeholder. * @param key {string} - Property name that matched the sensitive-key pattern. * @param entry {JsonValue} - Value stored under that key. * @returns {JsonValue} The masked value. */ export declare function redactSensitiveEntry(key: string, entry: JsonValue): JsonValue; /** * @description Masks credentials written as `name=value`, `name: value` or as a recognizable bare key (OpenAI, GitHub, AWS, Slack). Purely numeric values after a credential-looking name are left alone. * @param text {string} - Text to scan. * @returns {string} The text with credential values replaced. */ export declare function redactSecretAssignments(text: string): string; /** * @description Replaces inline base64 data URLs with a size and MIME-type placeholder. * @param text {string} - Text to scan. * @returns {string} The text with each data URL payload replaced by `[N bytes mime/type]`. */ export declare function describeDataUrls(text: string): string; /** * @description Tells whether an object key conventionally holds a binary payload. * @param key {string} - Property name. * @returns {boolean} `true` for keys such as `data`, `image`, `bytes` and `base64`. */ export declare function isBinaryKey(key: string): boolean; /** * @description Reads the MIME type an object declares for its payload. * @param node {object} - Object that may carry `mimeType`, `mediaType`, `media_type` or `mime_type`. * @returns {string | undefined} The declared MIME type, or `undefined` when none is a string. */ export declare function declaredMimeType(node: object): string | undefined; /** * @description Describes a binary payload by size instead of content. * @param value {ArrayBuffer | ArrayBufferView | string} - Raw bytes, or a base64 string long enough to be treated as bytes. * @param mimeType {string | undefined} - MIME type to include in the placeholder. * @returns {string | undefined} `[N bytes mime/type]`, or `undefined` when the value is not binary. */ export declare function binaryPlaceholder(value: ArrayBuffer | ArrayBufferView | string, mimeType: string | undefined): string | undefined;