UNPKG

@juspay/neurolink

Version:

Universal AI Development Platform with working MCP integration, multi-provider support, and professional CLI. Built-in tools operational, 58+ external MCP servers discoverable. Connect to filesystem, GitHub, database operations, and more. Build, test, and

55 lines (54 loc) 2.58 kB
/** * Type conversion utilities between GenerateOptions and StreamOptions * * 🔧 FIX: Addresses Issue #2 - Type System Mismatch * Factory patterns need to work with both generate() and stream() methods */ import type { GenerateOptions } from "../types/generateTypes.js"; import type { StreamOptions } from "../types/streamTypes.js"; import type { UnknownRecord } from "../types/common.js"; /** * Convert GenerateOptions to StreamOptions * Preserves all factory configuration and enhancement data */ export declare function convertGenerateToStreamOptions(generateOptions: GenerateOptions): StreamOptions; /** * Convert StreamOptions to GenerateOptions * Useful for fallback scenarios and unified processing */ export declare function convertStreamToGenerateOptions(streamOptions: StreamOptions): GenerateOptions; /** * Create a unified options interface that works with both methods * Useful for factory utilities that need to work with either type */ export type UnifiedOptions = GenerateOptions & StreamOptions; /** * Check if options object has factory configuration * Useful for determining if enhanced processing is needed */ export declare function hasFactoryConfig(options: GenerateOptions | StreamOptions | UnknownRecord): boolean; /** * Extract factory configuration from either options type * Returns null if no factory config is present */ export declare function extractFactoryConfig(options: GenerateOptions | StreamOptions | UnknownRecord): GenerateOptions["factoryConfig"] | null; /** * Check if options object has streaming configuration * Useful for determining if streaming enhancements are needed */ export declare function hasStreamingConfig(options: GenerateOptions | StreamOptions | UnknownRecord): boolean; /** * Extract streaming configuration from either options type * Returns null if no streaming config is present */ export declare function extractStreamingConfig(options: GenerateOptions | StreamOptions | UnknownRecord): GenerateOptions["streaming"] | null; /** * Create factory-enhanced StreamOptions from domain configuration * This is the key function that addresses Issue #2 */ export declare function createFactoryAwareStreamOptions(baseOptions: Partial<StreamOptions>, factoryConfig: GenerateOptions["factoryConfig"]): StreamOptions; /** * Create factory-enhanced GenerateOptions from domain configuration * Parallel function for generate() method */ export declare function createFactoryAwareGenerateOptions(baseOptions: Partial<GenerateOptions>, factoryConfig: GenerateOptions["factoryConfig"]): GenerateOptions;