@juspay/neurolink 1.2.3 → 1.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,373 @@
1
+ #!/usr/bin/env node
2
+ /**
3
+ * NeuroLink CLI Configuration Management
4
+ *
5
+ * Enhanced configuration system with interactive setup,
6
+ * multi-profile support, and smart validation.
7
+ */
8
+ import { z } from 'zod';
9
+ declare const ConfigSchema: z.ZodObject<{
10
+ defaultProvider: z.ZodDefault<z.ZodEnum<["auto", "openai", "bedrock", "vertex", "anthropic", "azure", "huggingface"]>>;
11
+ providers: z.ZodDefault<z.ZodObject<{
12
+ openai: z.ZodOptional<z.ZodObject<{
13
+ apiKey: z.ZodOptional<z.ZodString>;
14
+ model: z.ZodDefault<z.ZodString>;
15
+ baseURL: z.ZodOptional<z.ZodString>;
16
+ }, "strip", z.ZodTypeAny, {
17
+ model: string;
18
+ apiKey?: string | undefined;
19
+ baseURL?: string | undefined;
20
+ }, {
21
+ apiKey?: string | undefined;
22
+ model?: string | undefined;
23
+ baseURL?: string | undefined;
24
+ }>>;
25
+ bedrock: z.ZodOptional<z.ZodObject<{
26
+ region: z.ZodOptional<z.ZodString>;
27
+ accessKeyId: z.ZodOptional<z.ZodString>;
28
+ secretAccessKey: z.ZodOptional<z.ZodString>;
29
+ sessionToken: z.ZodOptional<z.ZodString>;
30
+ model: z.ZodDefault<z.ZodString>;
31
+ }, "strip", z.ZodTypeAny, {
32
+ model: string;
33
+ region?: string | undefined;
34
+ accessKeyId?: string | undefined;
35
+ secretAccessKey?: string | undefined;
36
+ sessionToken?: string | undefined;
37
+ }, {
38
+ model?: string | undefined;
39
+ region?: string | undefined;
40
+ accessKeyId?: string | undefined;
41
+ secretAccessKey?: string | undefined;
42
+ sessionToken?: string | undefined;
43
+ }>>;
44
+ vertex: z.ZodOptional<z.ZodObject<{
45
+ projectId: z.ZodOptional<z.ZodString>;
46
+ location: z.ZodDefault<z.ZodString>;
47
+ credentials: z.ZodOptional<z.ZodString>;
48
+ serviceAccountKey: z.ZodOptional<z.ZodString>;
49
+ clientEmail: z.ZodOptional<z.ZodString>;
50
+ privateKey: z.ZodOptional<z.ZodString>;
51
+ model: z.ZodDefault<z.ZodString>;
52
+ }, "strip", z.ZodTypeAny, {
53
+ model: string;
54
+ location: string;
55
+ projectId?: string | undefined;
56
+ credentials?: string | undefined;
57
+ serviceAccountKey?: string | undefined;
58
+ clientEmail?: string | undefined;
59
+ privateKey?: string | undefined;
60
+ }, {
61
+ model?: string | undefined;
62
+ projectId?: string | undefined;
63
+ location?: string | undefined;
64
+ credentials?: string | undefined;
65
+ serviceAccountKey?: string | undefined;
66
+ clientEmail?: string | undefined;
67
+ privateKey?: string | undefined;
68
+ }>>;
69
+ anthropic: z.ZodOptional<z.ZodObject<{
70
+ apiKey: z.ZodOptional<z.ZodString>;
71
+ model: z.ZodDefault<z.ZodString>;
72
+ }, "strip", z.ZodTypeAny, {
73
+ model: string;
74
+ apiKey?: string | undefined;
75
+ }, {
76
+ apiKey?: string | undefined;
77
+ model?: string | undefined;
78
+ }>>;
79
+ azure: z.ZodOptional<z.ZodObject<{
80
+ apiKey: z.ZodOptional<z.ZodString>;
81
+ endpoint: z.ZodOptional<z.ZodString>;
82
+ deploymentId: z.ZodOptional<z.ZodString>;
83
+ model: z.ZodDefault<z.ZodString>;
84
+ }, "strip", z.ZodTypeAny, {
85
+ model: string;
86
+ apiKey?: string | undefined;
87
+ endpoint?: string | undefined;
88
+ deploymentId?: string | undefined;
89
+ }, {
90
+ apiKey?: string | undefined;
91
+ model?: string | undefined;
92
+ endpoint?: string | undefined;
93
+ deploymentId?: string | undefined;
94
+ }>>;
95
+ huggingface: z.ZodOptional<z.ZodObject<{
96
+ apiKey: z.ZodOptional<z.ZodString>;
97
+ model: z.ZodDefault<z.ZodString>;
98
+ }, "strip", z.ZodTypeAny, {
99
+ model: string;
100
+ apiKey?: string | undefined;
101
+ }, {
102
+ apiKey?: string | undefined;
103
+ model?: string | undefined;
104
+ }>>;
105
+ }, "strip", z.ZodTypeAny, {
106
+ openai?: {
107
+ model: string;
108
+ apiKey?: string | undefined;
109
+ baseURL?: string | undefined;
110
+ } | undefined;
111
+ bedrock?: {
112
+ model: string;
113
+ region?: string | undefined;
114
+ accessKeyId?: string | undefined;
115
+ secretAccessKey?: string | undefined;
116
+ sessionToken?: string | undefined;
117
+ } | undefined;
118
+ vertex?: {
119
+ model: string;
120
+ location: string;
121
+ projectId?: string | undefined;
122
+ credentials?: string | undefined;
123
+ serviceAccountKey?: string | undefined;
124
+ clientEmail?: string | undefined;
125
+ privateKey?: string | undefined;
126
+ } | undefined;
127
+ anthropic?: {
128
+ model: string;
129
+ apiKey?: string | undefined;
130
+ } | undefined;
131
+ azure?: {
132
+ model: string;
133
+ apiKey?: string | undefined;
134
+ endpoint?: string | undefined;
135
+ deploymentId?: string | undefined;
136
+ } | undefined;
137
+ huggingface?: {
138
+ model: string;
139
+ apiKey?: string | undefined;
140
+ } | undefined;
141
+ }, {
142
+ openai?: {
143
+ apiKey?: string | undefined;
144
+ model?: string | undefined;
145
+ baseURL?: string | undefined;
146
+ } | undefined;
147
+ bedrock?: {
148
+ model?: string | undefined;
149
+ region?: string | undefined;
150
+ accessKeyId?: string | undefined;
151
+ secretAccessKey?: string | undefined;
152
+ sessionToken?: string | undefined;
153
+ } | undefined;
154
+ vertex?: {
155
+ model?: string | undefined;
156
+ projectId?: string | undefined;
157
+ location?: string | undefined;
158
+ credentials?: string | undefined;
159
+ serviceAccountKey?: string | undefined;
160
+ clientEmail?: string | undefined;
161
+ privateKey?: string | undefined;
162
+ } | undefined;
163
+ anthropic?: {
164
+ apiKey?: string | undefined;
165
+ model?: string | undefined;
166
+ } | undefined;
167
+ azure?: {
168
+ apiKey?: string | undefined;
169
+ model?: string | undefined;
170
+ endpoint?: string | undefined;
171
+ deploymentId?: string | undefined;
172
+ } | undefined;
173
+ huggingface?: {
174
+ apiKey?: string | undefined;
175
+ model?: string | undefined;
176
+ } | undefined;
177
+ }>>;
178
+ profiles: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodAny>>;
179
+ preferences: z.ZodDefault<z.ZodObject<{
180
+ outputFormat: z.ZodDefault<z.ZodEnum<["text", "json", "yaml"]>>;
181
+ temperature: z.ZodDefault<z.ZodNumber>;
182
+ maxTokens: z.ZodDefault<z.ZodNumber>;
183
+ enableLogging: z.ZodDefault<z.ZodBoolean>;
184
+ enableCaching: z.ZodDefault<z.ZodBoolean>;
185
+ cacheStrategy: z.ZodDefault<z.ZodEnum<["memory", "file", "redis"]>>;
186
+ }, "strip", z.ZodTypeAny, {
187
+ temperature: number;
188
+ maxTokens: number;
189
+ outputFormat: "text" | "json" | "yaml";
190
+ enableLogging: boolean;
191
+ enableCaching: boolean;
192
+ cacheStrategy: "file" | "memory" | "redis";
193
+ }, {
194
+ temperature?: number | undefined;
195
+ maxTokens?: number | undefined;
196
+ outputFormat?: "text" | "json" | "yaml" | undefined;
197
+ enableLogging?: boolean | undefined;
198
+ enableCaching?: boolean | undefined;
199
+ cacheStrategy?: "file" | "memory" | "redis" | undefined;
200
+ }>>;
201
+ }, "strip", z.ZodTypeAny, {
202
+ defaultProvider: "auto" | "openai" | "bedrock" | "vertex" | "anthropic" | "azure" | "huggingface";
203
+ providers: {
204
+ openai?: {
205
+ model: string;
206
+ apiKey?: string | undefined;
207
+ baseURL?: string | undefined;
208
+ } | undefined;
209
+ bedrock?: {
210
+ model: string;
211
+ region?: string | undefined;
212
+ accessKeyId?: string | undefined;
213
+ secretAccessKey?: string | undefined;
214
+ sessionToken?: string | undefined;
215
+ } | undefined;
216
+ vertex?: {
217
+ model: string;
218
+ location: string;
219
+ projectId?: string | undefined;
220
+ credentials?: string | undefined;
221
+ serviceAccountKey?: string | undefined;
222
+ clientEmail?: string | undefined;
223
+ privateKey?: string | undefined;
224
+ } | undefined;
225
+ anthropic?: {
226
+ model: string;
227
+ apiKey?: string | undefined;
228
+ } | undefined;
229
+ azure?: {
230
+ model: string;
231
+ apiKey?: string | undefined;
232
+ endpoint?: string | undefined;
233
+ deploymentId?: string | undefined;
234
+ } | undefined;
235
+ huggingface?: {
236
+ model: string;
237
+ apiKey?: string | undefined;
238
+ } | undefined;
239
+ };
240
+ profiles: Record<string, any>;
241
+ preferences: {
242
+ temperature: number;
243
+ maxTokens: number;
244
+ outputFormat: "text" | "json" | "yaml";
245
+ enableLogging: boolean;
246
+ enableCaching: boolean;
247
+ cacheStrategy: "file" | "memory" | "redis";
248
+ };
249
+ }, {
250
+ defaultProvider?: "auto" | "openai" | "bedrock" | "vertex" | "anthropic" | "azure" | "huggingface" | undefined;
251
+ providers?: {
252
+ openai?: {
253
+ apiKey?: string | undefined;
254
+ model?: string | undefined;
255
+ baseURL?: string | undefined;
256
+ } | undefined;
257
+ bedrock?: {
258
+ model?: string | undefined;
259
+ region?: string | undefined;
260
+ accessKeyId?: string | undefined;
261
+ secretAccessKey?: string | undefined;
262
+ sessionToken?: string | undefined;
263
+ } | undefined;
264
+ vertex?: {
265
+ model?: string | undefined;
266
+ projectId?: string | undefined;
267
+ location?: string | undefined;
268
+ credentials?: string | undefined;
269
+ serviceAccountKey?: string | undefined;
270
+ clientEmail?: string | undefined;
271
+ privateKey?: string | undefined;
272
+ } | undefined;
273
+ anthropic?: {
274
+ apiKey?: string | undefined;
275
+ model?: string | undefined;
276
+ } | undefined;
277
+ azure?: {
278
+ apiKey?: string | undefined;
279
+ model?: string | undefined;
280
+ endpoint?: string | undefined;
281
+ deploymentId?: string | undefined;
282
+ } | undefined;
283
+ huggingface?: {
284
+ apiKey?: string | undefined;
285
+ model?: string | undefined;
286
+ } | undefined;
287
+ } | undefined;
288
+ profiles?: Record<string, any> | undefined;
289
+ preferences?: {
290
+ temperature?: number | undefined;
291
+ maxTokens?: number | undefined;
292
+ outputFormat?: "text" | "json" | "yaml" | undefined;
293
+ enableLogging?: boolean | undefined;
294
+ enableCaching?: boolean | undefined;
295
+ cacheStrategy?: "file" | "memory" | "redis" | undefined;
296
+ } | undefined;
297
+ }>;
298
+ export type NeuroLinkConfig = z.infer<typeof ConfigSchema>;
299
+ export declare class ConfigManager {
300
+ private configDir;
301
+ private configFile;
302
+ private config;
303
+ constructor();
304
+ /**
305
+ * Load configuration from file or create default
306
+ */
307
+ private loadConfig;
308
+ /**
309
+ * Save configuration to file
310
+ */
311
+ private saveConfig;
312
+ /**
313
+ * Interactive configuration setup
314
+ */
315
+ initInteractive(): Promise<void>;
316
+ /**
317
+ * Setup individual providers
318
+ */
319
+ private setupProviders;
320
+ /**
321
+ * Setup individual provider
322
+ */
323
+ private setupProvider;
324
+ /**
325
+ * OpenAI provider setup
326
+ */
327
+ private setupOpenAI;
328
+ /**
329
+ * Amazon Bedrock provider setup
330
+ */
331
+ private setupBedrock;
332
+ /**
333
+ * Google Vertex AI provider setup
334
+ */
335
+ private setupVertex;
336
+ /**
337
+ * Anthropic provider setup
338
+ */
339
+ private setupAnthropic;
340
+ /**
341
+ * Azure OpenAI provider setup
342
+ */
343
+ private setupAzure;
344
+ /**
345
+ * Hugging Face provider setup
346
+ */
347
+ private setupHuggingFace;
348
+ /**
349
+ * Get current configuration
350
+ */
351
+ getConfig(): NeuroLinkConfig;
352
+ /**
353
+ * Update configuration
354
+ */
355
+ updateConfig(updates: Partial<NeuroLinkConfig>): void;
356
+ /**
357
+ * Show current configuration
358
+ */
359
+ showConfig(): void;
360
+ /**
361
+ * Validate configuration
362
+ */
363
+ validateConfig(): {
364
+ valid: boolean;
365
+ errors: string[];
366
+ };
367
+ /**
368
+ * Reset configuration to defaults
369
+ */
370
+ resetConfig(): void;
371
+ }
372
+ export declare const configManager: ConfigManager;
373
+ export {};