@juspay/neurolink
Version:
Universal AI Development Platform with external MCP server integration, multi-provider support, and professional CLI. Connect to 65+ MCP servers for filesystem, GitHub, database operations, and more. Build, test, and deploy AI applications with 9 major pr
471 lines (470 loc) • 15.6 kB
TypeScript
/**
* NeuroLink CLI Configuration Management
*
* Enhanced configuration system with interactive setup,
* multi-profile support, and smart validation.
*/
import { z } from 'zod';
declare const ConfigSchema: z.ZodObject<{
defaultProvider: z.ZodDefault<z.ZodEnum<["auto", "openai", "bedrock", "vertex", "anthropic", "azure", "google-ai", "huggingface", "ollama", "mistral"]>>;
providers: z.ZodDefault<z.ZodObject<{
openai: z.ZodOptional<z.ZodObject<{
apiKey: z.ZodOptional<z.ZodString>;
model: z.ZodDefault<z.ZodString>;
baseURL: z.ZodOptional<z.ZodString>;
}, "strip", z.ZodTypeAny, {
model: string;
apiKey?: string | undefined;
baseURL?: string | undefined;
}, {
model?: string | undefined;
apiKey?: string | undefined;
baseURL?: string | undefined;
}>>;
bedrock: z.ZodOptional<z.ZodObject<{
region: z.ZodOptional<z.ZodString>;
accessKeyId: z.ZodOptional<z.ZodString>;
secretAccessKey: z.ZodOptional<z.ZodString>;
sessionToken: z.ZodOptional<z.ZodString>;
model: z.ZodDefault<z.ZodString>;
}, "strip", z.ZodTypeAny, {
model: string;
region?: string | undefined;
accessKeyId?: string | undefined;
secretAccessKey?: string | undefined;
sessionToken?: string | undefined;
}, {
model?: string | undefined;
region?: string | undefined;
accessKeyId?: string | undefined;
secretAccessKey?: string | undefined;
sessionToken?: string | undefined;
}>>;
vertex: z.ZodOptional<z.ZodObject<{
projectId: z.ZodOptional<z.ZodString>;
location: z.ZodDefault<z.ZodString>;
credentials: z.ZodOptional<z.ZodString>;
serviceAccountKey: z.ZodOptional<z.ZodString>;
clientEmail: z.ZodOptional<z.ZodString>;
privateKey: z.ZodOptional<z.ZodString>;
model: z.ZodDefault<z.ZodString>;
}, "strip", z.ZodTypeAny, {
model: string;
location: string;
projectId?: string | undefined;
credentials?: string | undefined;
serviceAccountKey?: string | undefined;
clientEmail?: string | undefined;
privateKey?: string | undefined;
}, {
model?: string | undefined;
projectId?: string | undefined;
location?: string | undefined;
credentials?: string | undefined;
serviceAccountKey?: string | undefined;
clientEmail?: string | undefined;
privateKey?: string | undefined;
}>>;
anthropic: z.ZodOptional<z.ZodObject<{
apiKey: z.ZodOptional<z.ZodString>;
model: z.ZodDefault<z.ZodString>;
}, "strip", z.ZodTypeAny, {
model: string;
apiKey?: string | undefined;
}, {
model?: string | undefined;
apiKey?: string | undefined;
}>>;
azure: z.ZodOptional<z.ZodObject<{
apiKey: z.ZodOptional<z.ZodString>;
endpoint: z.ZodOptional<z.ZodString>;
deploymentId: z.ZodOptional<z.ZodString>;
model: z.ZodDefault<z.ZodString>;
}, "strip", z.ZodTypeAny, {
model: string;
apiKey?: string | undefined;
endpoint?: string | undefined;
deploymentId?: string | undefined;
}, {
model?: string | undefined;
apiKey?: string | undefined;
endpoint?: string | undefined;
deploymentId?: string | undefined;
}>>;
'google-ai': z.ZodOptional<z.ZodObject<{
apiKey: z.ZodOptional<z.ZodString>;
model: z.ZodDefault<z.ZodString>;
}, "strip", z.ZodTypeAny, {
model: string;
apiKey?: string | undefined;
}, {
model?: string | undefined;
apiKey?: string | undefined;
}>>;
huggingface: z.ZodOptional<z.ZodObject<{
apiKey: z.ZodOptional<z.ZodString>;
model: z.ZodDefault<z.ZodString>;
}, "strip", z.ZodTypeAny, {
model: string;
apiKey?: string | undefined;
}, {
model?: string | undefined;
apiKey?: string | undefined;
}>>;
ollama: z.ZodOptional<z.ZodObject<{
baseUrl: z.ZodDefault<z.ZodString>;
model: z.ZodDefault<z.ZodString>;
timeout: z.ZodDefault<z.ZodNumber>;
}, "strip", z.ZodTypeAny, {
model: string;
timeout: number;
baseUrl: string;
}, {
model?: string | undefined;
timeout?: number | undefined;
baseUrl?: string | undefined;
}>>;
mistral: z.ZodOptional<z.ZodObject<{
apiKey: z.ZodOptional<z.ZodString>;
model: z.ZodDefault<z.ZodString>;
}, "strip", z.ZodTypeAny, {
model: string;
apiKey?: string | undefined;
}, {
model?: string | undefined;
apiKey?: string | undefined;
}>>;
}, "strip", z.ZodTypeAny, {
bedrock?: {
model: string;
region?: string | undefined;
accessKeyId?: string | undefined;
secretAccessKey?: string | undefined;
sessionToken?: string | undefined;
} | undefined;
openai?: {
model: string;
apiKey?: string | undefined;
baseURL?: string | undefined;
} | undefined;
vertex?: {
model: string;
location: string;
projectId?: string | undefined;
credentials?: string | undefined;
serviceAccountKey?: string | undefined;
clientEmail?: string | undefined;
privateKey?: string | undefined;
} | undefined;
anthropic?: {
model: string;
apiKey?: string | undefined;
} | undefined;
azure?: {
model: string;
apiKey?: string | undefined;
endpoint?: string | undefined;
deploymentId?: string | undefined;
} | undefined;
'google-ai'?: {
model: string;
apiKey?: string | undefined;
} | undefined;
huggingface?: {
model: string;
apiKey?: string | undefined;
} | undefined;
ollama?: {
model: string;
timeout: number;
baseUrl: string;
} | undefined;
mistral?: {
model: string;
apiKey?: string | undefined;
} | undefined;
}, {
bedrock?: {
model?: string | undefined;
region?: string | undefined;
accessKeyId?: string | undefined;
secretAccessKey?: string | undefined;
sessionToken?: string | undefined;
} | undefined;
openai?: {
model?: string | undefined;
apiKey?: string | undefined;
baseURL?: string | undefined;
} | undefined;
vertex?: {
model?: string | undefined;
projectId?: string | undefined;
location?: string | undefined;
credentials?: string | undefined;
serviceAccountKey?: string | undefined;
clientEmail?: string | undefined;
privateKey?: string | undefined;
} | undefined;
anthropic?: {
model?: string | undefined;
apiKey?: string | undefined;
} | undefined;
azure?: {
model?: string | undefined;
apiKey?: string | undefined;
endpoint?: string | undefined;
deploymentId?: string | undefined;
} | undefined;
'google-ai'?: {
model?: string | undefined;
apiKey?: string | undefined;
} | undefined;
huggingface?: {
model?: string | undefined;
apiKey?: string | undefined;
} | undefined;
ollama?: {
model?: string | undefined;
timeout?: number | undefined;
baseUrl?: string | undefined;
} | undefined;
mistral?: {
model?: string | undefined;
apiKey?: string | undefined;
} | undefined;
}>>;
profiles: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodAny>>;
preferences: z.ZodDefault<z.ZodObject<{
outputFormat: z.ZodDefault<z.ZodEnum<["text", "json", "yaml"]>>;
temperature: z.ZodDefault<z.ZodNumber>;
maxTokens: z.ZodDefault<z.ZodNumber>;
enableLogging: z.ZodDefault<z.ZodBoolean>;
enableCaching: z.ZodDefault<z.ZodBoolean>;
cacheStrategy: z.ZodDefault<z.ZodEnum<["memory", "file", "redis"]>>;
}, "strip", z.ZodTypeAny, {
temperature: number;
maxTokens: number;
outputFormat: "text" | "json" | "yaml";
enableLogging: boolean;
enableCaching: boolean;
cacheStrategy: "file" | "memory" | "redis";
}, {
temperature?: number | undefined;
maxTokens?: number | undefined;
outputFormat?: "text" | "json" | "yaml" | undefined;
enableLogging?: boolean | undefined;
enableCaching?: boolean | undefined;
cacheStrategy?: "file" | "memory" | "redis" | undefined;
}>>;
}, "strip", z.ZodTypeAny, {
defaultProvider: "bedrock" | "openai" | "vertex" | "anthropic" | "azure" | "google-ai" | "huggingface" | "ollama" | "mistral" | "auto";
providers: {
bedrock?: {
model: string;
region?: string | undefined;
accessKeyId?: string | undefined;
secretAccessKey?: string | undefined;
sessionToken?: string | undefined;
} | undefined;
openai?: {
model: string;
apiKey?: string | undefined;
baseURL?: string | undefined;
} | undefined;
vertex?: {
model: string;
location: string;
projectId?: string | undefined;
credentials?: string | undefined;
serviceAccountKey?: string | undefined;
clientEmail?: string | undefined;
privateKey?: string | undefined;
} | undefined;
anthropic?: {
model: string;
apiKey?: string | undefined;
} | undefined;
azure?: {
model: string;
apiKey?: string | undefined;
endpoint?: string | undefined;
deploymentId?: string | undefined;
} | undefined;
'google-ai'?: {
model: string;
apiKey?: string | undefined;
} | undefined;
huggingface?: {
model: string;
apiKey?: string | undefined;
} | undefined;
ollama?: {
model: string;
timeout: number;
baseUrl: string;
} | undefined;
mistral?: {
model: string;
apiKey?: string | undefined;
} | undefined;
};
profiles: Record<string, any>;
preferences: {
temperature: number;
maxTokens: number;
outputFormat: "text" | "json" | "yaml";
enableLogging: boolean;
enableCaching: boolean;
cacheStrategy: "file" | "memory" | "redis";
};
}, {
defaultProvider?: "bedrock" | "openai" | "vertex" | "anthropic" | "azure" | "google-ai" | "huggingface" | "ollama" | "mistral" | "auto" | undefined;
providers?: {
bedrock?: {
model?: string | undefined;
region?: string | undefined;
accessKeyId?: string | undefined;
secretAccessKey?: string | undefined;
sessionToken?: string | undefined;
} | undefined;
openai?: {
model?: string | undefined;
apiKey?: string | undefined;
baseURL?: string | undefined;
} | undefined;
vertex?: {
model?: string | undefined;
projectId?: string | undefined;
location?: string | undefined;
credentials?: string | undefined;
serviceAccountKey?: string | undefined;
clientEmail?: string | undefined;
privateKey?: string | undefined;
} | undefined;
anthropic?: {
model?: string | undefined;
apiKey?: string | undefined;
} | undefined;
azure?: {
model?: string | undefined;
apiKey?: string | undefined;
endpoint?: string | undefined;
deploymentId?: string | undefined;
} | undefined;
'google-ai'?: {
model?: string | undefined;
apiKey?: string | undefined;
} | undefined;
huggingface?: {
model?: string | undefined;
apiKey?: string | undefined;
} | undefined;
ollama?: {
model?: string | undefined;
timeout?: number | undefined;
baseUrl?: string | undefined;
} | undefined;
mistral?: {
model?: string | undefined;
apiKey?: string | undefined;
} | undefined;
} | undefined;
profiles?: Record<string, any> | undefined;
preferences?: {
temperature?: number | undefined;
maxTokens?: number | undefined;
outputFormat?: "text" | "json" | "yaml" | undefined;
enableLogging?: boolean | undefined;
enableCaching?: boolean | undefined;
cacheStrategy?: "file" | "memory" | "redis" | undefined;
} | undefined;
}>;
export type NeuroLinkConfig = z.infer<typeof ConfigSchema>;
export declare class ConfigManager {
private configDir;
private configFile;
private config;
constructor();
/**
* Load configuration from file or create default
*/
private loadConfig;
/**
* Save configuration to file
*/
private saveConfig;
/**
* Interactive configuration setup
*/
initInteractive(): Promise<void>;
/**
* Setup individual providers
*/
private setupProviders;
/**
* Setup individual provider
*/
private setupProvider;
/**
* OpenAI provider setup
*/
private setupOpenAI;
/**
* Amazon Bedrock provider setup
*/
private setupBedrock;
/**
* Google Vertex AI provider setup
*/
private setupVertex;
/**
* Anthropic provider setup
*/
private setupAnthropic;
/**
* Azure OpenAI provider setup
*/
private setupAzure;
/**
* Google AI Studio provider setup
*/
private setupGoogleAI;
/**
* Hugging Face provider setup
*/
private setupHuggingFace;
/**
* Ollama provider setup
*/
private setupOllama;
/**
* Mistral AI provider setup
*/
private setupMistral;
/**
* Get current configuration
*/
getConfig(): NeuroLinkConfig;
/**
* Update configuration
*/
updateConfig(updates: Partial<NeuroLinkConfig>): void;
/**
* Show current configuration
*/
showConfig(): void;
/**
* Validate configuration
*/
validateConfig(): {
valid: boolean;
errors: string[];
};
/**
* Reset configuration to defaults
*/
resetConfig(): void;
}
export declare const configManager: ConfigManager;
export {};