@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
73 lines (72 loc) • 2.67 kB
TypeScript
/**
* Serve CLI Commands for NeuroLink
* Simplified HTTP server management commands for Server Adapters feature
*
* Usage:
* neurolink serve --framework <hono|express|fastify|koa> --port <n>
* neurolink serve --config <file>
* neurolink serve --cors --rate-limit
* neurolink serve status
*/
import type { CommandModule } from "yargs";
export declare class ServeCommandFactory {
/**
* Create the main serve command
*/
static createServeCommands(): CommandModule;
private static buildStatusOptions;
private static executeServe;
/**
* Guard against a server that is already running. Exits the process if so.
*/
private static guardAlreadyRunning;
/**
* Load a config file if one was specified in argv. Returns empty object otherwise.
*/
private static loadFileConfig;
/**
* Merge CLI args with file config to produce a ServerAdapterConfig.
*/
private static buildServerConfig;
/**
* Create server, register routes, initialize and start it.
* Returns a mutable reference wrapper so signal handlers always access the current server.
*/
private static createAndStartServer;
/**
* The NeuroLink instance the server runs. Its registry holds no built-in
* tool unless `--enable-builtin-tools`: those tools read and write files
* under the server's working directory, and `/tools/execute` and the agent
* routes would hand them to every caller. The switch is the SDK's own
* (NEUROLINK_DISABLE_BUILTIN_TOOLS), set before the instance and its
* providers read it, so generate() in this process does not see them either.
*/
private static createServerNeuroLink;
/**
* Put every route except the health probes behind the API key(s) in
* NEUROLINK_SERVER_API_KEY. Must run before the routes are registered.
*/
private static applyApiKeyAuth;
/**
* Save server state and print the startup info banner.
*/
private static saveAndPrintStartupInfo;
/**
* Print the server startup banner with server info, middleware status and endpoints.
*/
private static printStartupBanner;
/**
* Set up watch mode if enabled. Returns the stop-watcher function, or null if not enabled.
*/
private static setupWatchMode;
/**
* Register SIGINT and SIGTERM handlers for graceful shutdown.
*/
private static registerSignalHandlers;
/**
* Handle errors during server startup: print error, troubleshooting tips, and exit.
*/
private static handleStartupError;
private static executeStatus;
}
export default ServeCommandFactory;