UNPKG

@juspay/neurolink

Version:

Universal AI Development Platform with working MCP integration, multi-provider support, voice (TTS/STT/realtime), and professional CLI. 58+ external MCP servers discoverable, multimodal file processing, RAG pipelines. Build, test, and deploy AI applicatio

71 lines (70 loc) 2.12 kB
/** * Fastify Server Adapter * Server adapter implementation using Fastify framework * Fastify is known for its high performance and low overhead */ import type { NeuroLink } from "../../neurolink.js"; import { BaseServerAdapter } from "../abstract/baseServerAdapter.js"; import type { MiddlewareDefinition, RouteDefinition, ServerAdapterConfig } from "../../types/index.js"; /** * Fastify-specific server adapter * Provides high-performance HTTP server with schema validation */ export declare class FastifyServerAdapter extends BaseServerAdapter { private app; private frameworkInitialized; constructor(neurolink: NeuroLink, config?: ServerAdapterConfig); /** * Initialize Fastify framework * Called by base class but actual initialization happens in initializeFrameworkAsync */ protected initializeFramework(): void; /** * Initialize Fastify framework with async imports */ private initializeFrameworkAsync; /** * Parse body limit string to number (bytes) */ private parseBodyLimit; /** * Override initialize to ensure async framework setup */ initialize(): Promise<void>; /** * Register route with Fastify */ protected registerFrameworkRoute(route: RouteDefinition): void; /** * Handle streaming response using Server-Sent Events */ private handleStreamingResponse; /** * Register middleware with Fastify */ protected registerFrameworkMiddleware(middleware: MiddlewareDefinition): void; /** * Start the Fastify server */ start(): Promise<void>; /** * Stop the Fastify server with graceful shutdown */ stop(): Promise<void>; /** * Stop accepting new connections */ protected stopAcceptingConnections(): Promise<void>; /** * Close the underlying server */ protected closeServer(): Promise<void>; /** * Force close all active connections */ protected forceCloseConnections(): Promise<void>; /** * Get the Fastify instance */ getFrameworkInstance(): unknown; }