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

62 lines (61 loc) • 1.98 kB
/** * 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"; /** * Serve CLI command factory */ 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; /** * 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;