@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
185 lines (184 loc) • 6.93 kB
TypeScript
/**
* Unified Constants Export
*
* This file provides a centralized export point for all NeuroLink constants,
* replacing magic numbers throughout the codebase with named, documented values.
*
* Categories:
* - Timeouts: Tool execution, provider testing, MCP initialization
* - Retry Logic: Backoff strategies, circuit breaker patterns
* - Performance: Memory thresholds, concurrency limits, buffer sizes
* - Tokens: Provider limits, use-case specific allocations
*
* @see MAGIC_NUMBER_REFACTORING_ANALYSIS.md for implementation details
*/
export { TOOL_TIMEOUTS, PROVIDER_TIMEOUTS, MCP_TIMEOUTS, CIRCUIT_BREAKER_TIMEOUTS, NETWORK_TIMEOUTS, SYSTEM_TIMEOUTS, DEV_TIMEOUTS, TIMEOUTS, TimeoutUtils, DEFAULT_TIMEOUT, PROVIDER_TEST_TIMEOUT, MCP_INIT_TIMEOUT, CIRCUIT_BREAKER_RESET_MS, } from "./timeouts.js";
export { RETRY_ATTEMPTS, RETRY_DELAYS, BACKOFF_CONFIG, CIRCUIT_BREAKER, PROVIDER_RETRY, OPERATION_RETRY, RetryUtils, DEFAULT_RETRY_ATTEMPTS, DEFAULT_INITIAL_DELAY, DEFAULT_MAX_DELAY, DEFAULT_BACKOFF_MULTIPLIER, CIRCUIT_BREAKER_FAILURE_THRESHOLD, } from "./retry.js";
export { UNIT_CONVERSIONS, TEXT_PREVIEW_LENGTHS, PERFORMANCE_THRESHOLDS, MEMORY_THRESHOLDS, RESPONSE_TIME_THRESHOLDS, CONCURRENCY_LIMITS, BUFFER_SIZES, CACHE_CONFIG, MONITORING_CONFIG, OPTIMIZATION_THRESHOLDS, GC_CONFIG, SERVER_CONFIG, PerformanceUtils, HIGH_MEMORY_THRESHOLD, DEFAULT_CONCURRENCY_LIMIT, MAX_CONCURRENCY_LIMIT, SMALL_BUFFER_SIZE, LARGE_BUFFER_SIZE, DEFAULT_CACHE_SIZE, NANOSECOND_TO_MS_DIVISOR, TEXT_PREVIEW_LENGTHS_EXPORT, PERFORMANCE_THRESHOLDS_EXPORT, } from "./performance.js";
export { TOKEN_LIMITS, PROVIDER_TOKEN_LIMITS, USE_CASE_TOKENS, CONTEXT_WINDOWS, TOKEN_ESTIMATION, TokenUtils, DEFAULT_MAX_TOKENS, DEFAULT_EVALUATION_MAX_TOKENS, DEFAULT_ANALYSIS_MAX_TOKENS, DEFAULT_DOCUMENTATION_MAX_TOKENS, ANTHROPIC_SAFE, OPENAI_STANDARD, GOOGLE_STANDARD, } from "./tokens.js";
/**
* Common timeout configurations for different operation types
*/
export declare const OPERATION_TIMEOUTS: {
readonly QUICK: 5000;
readonly STANDARD: 30000;
readonly EXTENDED: 60000;
readonly CRITICAL: 120000;
};
/**
* Provider operation configurations combining timeouts and retries
*/
export declare const PROVIDER_OPERATION_CONFIGS: {
readonly OPENAI: {
readonly timeout: 10000;
readonly maxRetries: 3;
readonly retryDelay: 1000;
};
readonly ANTHROPIC: {
readonly timeout: 10000;
readonly maxRetries: 3;
readonly retryDelay: 1000;
};
readonly GOOGLE_AI: {
readonly timeout: 10000;
readonly maxRetries: 4;
readonly retryDelay: 2000;
};
readonly BEDROCK: {
readonly timeout: 10000;
readonly maxRetries: 5;
readonly retryDelay: 1000;
};
readonly AZURE: {
readonly timeout: 10000;
readonly maxRetries: 3;
readonly retryDelay: 1000;
};
readonly OLLAMA: {
readonly timeout: 10000;
readonly maxRetries: 1;
readonly retryDelay: 200;
};
};
/**
* MCP operation configurations for different server types
*/
export declare const MCP_OPERATION_CONFIGS: {
readonly INITIALIZATION: {
readonly timeout: 3000;
readonly maxRetries: 3;
readonly retryDelay: 1000;
};
readonly TOOL_DISCOVERY: {
readonly timeout: 10000;
readonly maxRetries: 3;
readonly retryDelay: 1000;
};
readonly TOOL_EXECUTION: {
readonly timeout: 10000;
readonly maxRetries: 3;
readonly retryDelay: 1000;
};
readonly HEALTH_CHECK: {
readonly timeout: 5000;
readonly maxRetries: 1;
readonly retryDelay: 200;
};
};
/**
* Performance profiles for different system loads
*/
export declare const PERFORMANCE_PROFILES: {
readonly LOW_LOAD: {
readonly concurrency: 2;
readonly memoryThreshold: 100;
readonly bufferSize: 1024;
};
readonly NORMAL_LOAD: {
readonly concurrency: 5;
readonly memoryThreshold: 100;
readonly bufferSize: 4096;
};
readonly HIGH_LOAD: {
readonly concurrency: 10;
readonly memoryThreshold: 200;
readonly bufferSize: 8192;
};
readonly ENTERPRISE: {
readonly concurrency: 10;
readonly memoryThreshold: 300;
readonly bufferSize: 16384;
};
};
/**
* Get timeout value with environment-based adjustments
*/
export declare function getTimeout(baseTimeout: number, environment?: "development" | "test" | "production"): number;
/**
* Get retry configuration for a specific provider
*/
export declare function getProviderRetryConfig(provider: string): {
readonly maxAttempts: 3;
readonly baseDelay: 1000;
readonly maxDelay: 30000;
readonly multiplier: 2;
} | {
readonly maxAttempts: 3;
readonly baseDelay: 1000;
readonly maxDelay: 30000;
readonly multiplier: 1.5;
} | {
readonly maxAttempts: 4;
readonly baseDelay: 2000;
readonly maxDelay: 30000;
readonly multiplier: 2;
} | {
readonly maxAttempts: 5;
readonly baseDelay: 1000;
readonly maxDelay: 30000;
readonly multiplier: 1.5;
} | {
readonly maxAttempts: 1;
readonly baseDelay: 200;
readonly maxDelay: 5000;
readonly multiplier: 1.5;
};
/**
* Get token limit for a specific provider and use case
* @param provider - Provider name
* @param useCase - Use case category that determines token limits
* @returns Token limit appropriate for the provider and use case
*/
export declare function getProviderTokenLimit(provider: string, useCase?: "conservative" | "standard" | "high_capacity"): number;
/**
* Get performance configuration for current system load
*/
export declare function getPerformanceConfig(load?: "low" | "normal" | "high" | "enterprise"): {
readonly concurrency: 2;
readonly memoryThreshold: 100;
readonly bufferSize: 1024;
} | {
readonly concurrency: 5;
readonly memoryThreshold: 100;
readonly bufferSize: 4096;
} | {
readonly concurrency: 10;
readonly memoryThreshold: 200;
readonly bufferSize: 8192;
} | {
readonly concurrency: 10;
readonly memoryThreshold: 300;
readonly bufferSize: 16384;
};
/**
* Constants system metadata
*/
export declare const CONSTANTS_METADATA: {
readonly VERSION: "1.0.0";
readonly LAST_UPDATED: "2025-01-27";
readonly TOTAL_CONSTANTS: 300;
readonly CATEGORIES: readonly ["timeouts", "retry", "performance", "tokens", "enums"];
readonly COMPATIBILITY: "backward_compatible";
};
export { AIProviderName, OpenRouterModels, BedrockModels, OpenAIModels, AzureOpenAIModels, VertexModels, GoogleAIModels, AnthropicModels, MistralModels, OllamaModels, LiteLLMModels, HuggingFaceModels, SageMakerModels, APIVersions, ErrorCategory, ErrorSeverity, AnthropicBetaFeature, TOKEN_EXPIRY_BUFFER_MS, } from "./enums.js";
export { VIDEO_ERROR_CODES } from "./videoErrors.js";