@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
74 lines (73 loc) • 2.79 kB
TypeScript
/**
* Server Adapter Factory
* Creates server adapters based on framework configuration
* Follows NeuroLink's factory pattern for consistent instantiation
*/
import type { NeuroLink } from "../../neurolink.js";
import type { BaseServerAdapter } from "../abstract/baseServerAdapter.js";
import type { ServerAdapterConfig, ServerAdapterFactoryOptions, ServerFramework } from "../../types/index.js";
/**
* Factory for creating server adapters
* Supports multiple web frameworks with consistent API
*/
export declare class ServerAdapterFactory {
private static adapters;
/**
* Register an adapter class for a framework
*/
static registerAdapter(framework: ServerFramework, adapterClass: new (neurolink: NeuroLink, config?: ServerAdapterConfig) => BaseServerAdapter): void;
/**
* Create a server adapter for the specified framework
* Uses dynamic imports to avoid bundling unused frameworks
*/
static create(options: ServerAdapterFactoryOptions): Promise<BaseServerAdapter>;
/**
* Create a Hono server adapter (convenience method)
* Hono is the recommended framework for its multi-runtime support
*/
static createHono(neurolink: NeuroLink, config?: ServerAdapterConfig): Promise<BaseServerAdapter>;
/**
* Create an Express server adapter (convenience method)
*/
static createExpress(neurolink: NeuroLink, config?: ServerAdapterConfig): Promise<BaseServerAdapter>;
/**
* Create a Fastify server adapter (convenience method)
* Fastify is known for high performance and low overhead
*/
static createFastify(neurolink: NeuroLink, config?: ServerAdapterConfig): Promise<BaseServerAdapter>;
/**
* Create a Koa server adapter (convenience method)
* Koa provides elegant middleware composition
*/
static createKoa(neurolink: NeuroLink, config?: ServerAdapterConfig): Promise<BaseServerAdapter>;
/**
* Check if a framework is supported
*/
static isSupported(framework: string): framework is ServerFramework;
/**
* Get list of supported frameworks
*/
static getSupportedFrameworks(): {
framework: ServerFramework;
status: "available";
description: string;
}[];
/**
* Get recommended framework based on runtime
*/
static getRecommendedFramework(): ServerFramework;
}
/**
* Quick helper to create a server from NeuroLink instance
* @example
* ```typescript
* const neurolink = new NeuroLink({ ... });
* const server = await createServer(neurolink);
* await server.initialize();
* await server.start();
* ```
*/
export declare function createServer(neurolink: NeuroLink, options?: {
framework?: ServerFramework;
config?: ServerAdapterConfig;
}): Promise<BaseServerAdapter>;