@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
17 lines (16 loc) • 812 B
TypeScript
/**
* Tool gate — applies a ResolvedToolPolicy to a tools record. This is the
* ONE place where include/exclude filtering of the native tool set happens;
* every generate/stream path reaches it via BaseProvider.
*
* Generic over the tool value type so it works for AI-SDK Tool records,
* ToolInfo listings, and provider wire formats alike.
*/
import type { ResolvedToolPolicy } from "../types/index.js";
/**
* Filter a tools record according to the resolved policy.
* Order: enabled kill-switch → include allowlist → exclude denylist.
* Preserves the input record's key order for surviving tools (callers rely
* on deterministic ordering for provider prompt-cache stability).
*/
export declare function applyToolGate<T>(tools: Record<string, T>, policy: ResolvedToolPolicy): Record<string, T>;