@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
21 lines (20 loc) • 976 B
TypeScript
/**
* CLI helper: parse --tool-routing-* flags into a ToolRoutingConfig.
*
* This module is intentionally side-effect-free so it can be unit-tested
* without a running NeuroLink instance.
*/
import type { CliToolRoutingFlags, ToolRoutingConfig } from "../../types/index.js";
/**
* Build a {@link ToolRoutingConfig} from the parsed CLI flags.
*
* Returns `undefined` when `--tool-routing` is absent or false, so callers
* can skip the setter entirely with a simple truthiness check — behaviour is
* identical to routing being disabled.
*
* `--tool-routing-servers` is parsed permissively:
* - If the value looks like an existing file path, the file is read and JSON-parsed.
* - Otherwise the value is treated as an inline JSON string.
* - On any parse error a warning is logged and `servers` is omitted (fail open).
*/
export declare function buildToolRoutingConfigFromCli(flags: CliToolRoutingFlags & Record<string, unknown>): ToolRoutingConfig | undefined;