@juspay/neurolink 1.5.3 → 1.9.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.
- package/CHANGELOG.md +241 -1
- package/README.md +113 -20
- package/dist/agent/direct-tools.d.ts +1203 -0
- package/dist/agent/direct-tools.js +387 -0
- package/dist/cli/commands/agent-generate.d.ts +2 -0
- package/dist/cli/commands/agent-generate.js +70 -0
- package/dist/cli/commands/config.d.ts +76 -9
- package/dist/cli/commands/config.js +358 -233
- package/dist/cli/commands/mcp.d.ts +2 -1
- package/dist/cli/commands/mcp.js +874 -146
- package/dist/cli/commands/ollama.d.ts +8 -0
- package/dist/cli/commands/ollama.js +333 -0
- package/dist/cli/index.js +591 -327
- package/dist/cli/utils/complete-setup.d.ts +19 -0
- package/dist/cli/utils/complete-setup.js +81 -0
- package/dist/cli/utils/env-manager.d.ts +44 -0
- package/dist/cli/utils/env-manager.js +226 -0
- package/dist/cli/utils/interactive-setup.d.ts +48 -0
- package/dist/cli/utils/interactive-setup.js +302 -0
- package/dist/core/dynamic-models.d.ts +208 -0
- package/dist/core/dynamic-models.js +250 -0
- package/dist/core/factory.d.ts +13 -6
- package/dist/core/factory.js +180 -50
- package/dist/core/types.d.ts +8 -3
- package/dist/core/types.js +7 -4
- package/dist/index.d.ts +16 -16
- package/dist/index.js +16 -16
- package/dist/lib/agent/direct-tools.d.ts +1203 -0
- package/dist/lib/agent/direct-tools.js +387 -0
- package/dist/lib/core/dynamic-models.d.ts +208 -0
- package/dist/lib/core/dynamic-models.js +250 -0
- package/dist/lib/core/factory.d.ts +13 -6
- package/dist/lib/core/factory.js +180 -50
- package/dist/lib/core/types.d.ts +8 -3
- package/dist/lib/core/types.js +7 -4
- package/dist/lib/index.d.ts +16 -16
- package/dist/lib/index.js +16 -16
- package/dist/lib/mcp/auto-discovery.d.ts +120 -0
- package/dist/lib/mcp/auto-discovery.js +793 -0
- package/dist/lib/mcp/client.d.ts +66 -0
- package/dist/lib/mcp/client.js +245 -0
- package/dist/lib/mcp/config.d.ts +31 -0
- package/dist/lib/mcp/config.js +74 -0
- package/dist/lib/mcp/context-manager.d.ts +4 -4
- package/dist/lib/mcp/context-manager.js +24 -18
- package/dist/lib/mcp/factory.d.ts +28 -11
- package/dist/lib/mcp/factory.js +36 -29
- package/dist/lib/mcp/function-calling.d.ts +51 -0
- package/dist/lib/mcp/function-calling.js +510 -0
- package/dist/lib/mcp/index.d.ts +190 -0
- package/dist/lib/mcp/index.js +156 -0
- package/dist/lib/mcp/initialize-tools.d.ts +28 -0
- package/dist/lib/mcp/initialize-tools.js +209 -0
- package/dist/lib/mcp/initialize.d.ts +17 -0
- package/dist/lib/mcp/initialize.js +51 -0
- package/dist/lib/mcp/logging.d.ts +71 -0
- package/dist/lib/mcp/logging.js +183 -0
- package/dist/lib/mcp/manager.d.ts +67 -0
- package/dist/lib/mcp/manager.js +176 -0
- package/dist/lib/mcp/neurolink-mcp-client.d.ts +96 -0
- package/dist/lib/mcp/neurolink-mcp-client.js +417 -0
- package/dist/lib/mcp/orchestrator.d.ts +3 -3
- package/dist/lib/mcp/orchestrator.js +46 -43
- package/dist/lib/mcp/registry.d.ts +2 -2
- package/dist/lib/mcp/registry.js +42 -33
- package/dist/lib/mcp/servers/ai-providers/ai-analysis-tools.d.ts +1 -1
- package/dist/lib/mcp/servers/ai-providers/ai-analysis-tools.js +205 -66
- package/dist/lib/mcp/servers/ai-providers/ai-core-server.js +143 -99
- package/dist/lib/mcp/servers/ai-providers/ai-workflow-tools.d.ts +6 -6
- package/dist/lib/mcp/servers/ai-providers/ai-workflow-tools.js +404 -251
- package/dist/lib/mcp/servers/utilities/utility-server.d.ts +8 -0
- package/dist/lib/mcp/servers/utilities/utility-server.js +326 -0
- package/dist/lib/mcp/tool-integration.d.ts +67 -0
- package/dist/lib/mcp/tool-integration.js +179 -0
- package/dist/lib/mcp/unified-registry.d.ts +269 -0
- package/dist/lib/mcp/unified-registry.js +1411 -0
- package/dist/lib/neurolink.d.ts +68 -6
- package/dist/lib/neurolink.js +314 -42
- package/dist/lib/providers/agent-enhanced-provider.d.ts +59 -0
- package/dist/lib/providers/agent-enhanced-provider.js +242 -0
- package/dist/lib/providers/amazonBedrock.d.ts +3 -3
- package/dist/lib/providers/amazonBedrock.js +54 -50
- package/dist/lib/providers/anthropic.d.ts +2 -2
- package/dist/lib/providers/anthropic.js +92 -84
- package/dist/lib/providers/azureOpenAI.d.ts +2 -2
- package/dist/lib/providers/azureOpenAI.js +97 -86
- package/dist/lib/providers/function-calling-provider.d.ts +70 -0
- package/dist/lib/providers/function-calling-provider.js +359 -0
- package/dist/lib/providers/googleAIStudio.d.ts +10 -5
- package/dist/lib/providers/googleAIStudio.js +60 -38
- package/dist/lib/providers/googleVertexAI.d.ts +3 -3
- package/dist/lib/providers/googleVertexAI.js +96 -86
- package/dist/lib/providers/huggingFace.d.ts +31 -0
- package/dist/lib/providers/huggingFace.js +362 -0
- package/dist/lib/providers/index.d.ts +14 -8
- package/dist/lib/providers/index.js +18 -12
- package/dist/lib/providers/mcp-provider.d.ts +62 -0
- package/dist/lib/providers/mcp-provider.js +183 -0
- package/dist/lib/providers/mistralAI.d.ts +32 -0
- package/dist/lib/providers/mistralAI.js +223 -0
- package/dist/lib/providers/ollama.d.ts +51 -0
- package/dist/lib/providers/ollama.js +508 -0
- package/dist/lib/providers/openAI.d.ts +7 -3
- package/dist/lib/providers/openAI.js +45 -33
- package/dist/lib/utils/logger.js +2 -2
- package/dist/lib/utils/providerUtils.js +59 -22
- package/dist/mcp/auto-discovery.d.ts +120 -0
- package/dist/mcp/auto-discovery.js +794 -0
- package/dist/mcp/client.d.ts +66 -0
- package/dist/mcp/client.js +245 -0
- package/dist/mcp/config.d.ts +31 -0
- package/dist/mcp/config.js +74 -0
- package/dist/mcp/context-manager.d.ts +4 -4
- package/dist/mcp/context-manager.js +24 -18
- package/dist/mcp/factory.d.ts +28 -11
- package/dist/mcp/factory.js +36 -29
- package/dist/mcp/function-calling.d.ts +51 -0
- package/dist/mcp/function-calling.js +510 -0
- package/dist/mcp/index.d.ts +190 -0
- package/dist/mcp/index.js +156 -0
- package/dist/mcp/initialize-tools.d.ts +28 -0
- package/dist/mcp/initialize-tools.js +210 -0
- package/dist/mcp/initialize.d.ts +17 -0
- package/dist/mcp/initialize.js +51 -0
- package/dist/mcp/logging.d.ts +71 -0
- package/dist/mcp/logging.js +183 -0
- package/dist/mcp/manager.d.ts +67 -0
- package/dist/mcp/manager.js +176 -0
- package/dist/mcp/neurolink-mcp-client.d.ts +96 -0
- package/dist/mcp/neurolink-mcp-client.js +417 -0
- package/dist/mcp/orchestrator.d.ts +3 -3
- package/dist/mcp/orchestrator.js +46 -43
- package/dist/mcp/registry.d.ts +2 -2
- package/dist/mcp/registry.js +42 -33
- package/dist/mcp/servers/ai-providers/ai-analysis-tools.d.ts +1 -1
- package/dist/mcp/servers/ai-providers/ai-analysis-tools.js +205 -66
- package/dist/mcp/servers/ai-providers/ai-core-server.js +143 -99
- package/dist/mcp/servers/ai-providers/ai-workflow-tools.d.ts +6 -6
- package/dist/mcp/servers/ai-providers/ai-workflow-tools.js +404 -253
- package/dist/mcp/servers/utilities/utility-server.d.ts +8 -0
- package/dist/mcp/servers/utilities/utility-server.js +326 -0
- package/dist/mcp/tool-integration.d.ts +67 -0
- package/dist/mcp/tool-integration.js +179 -0
- package/dist/mcp/unified-registry.d.ts +269 -0
- package/dist/mcp/unified-registry.js +1411 -0
- package/dist/neurolink.d.ts +68 -6
- package/dist/neurolink.js +314 -42
- package/dist/providers/agent-enhanced-provider.d.ts +59 -0
- package/dist/providers/agent-enhanced-provider.js +242 -0
- package/dist/providers/amazonBedrock.d.ts +3 -3
- package/dist/providers/amazonBedrock.js +54 -50
- package/dist/providers/anthropic.d.ts +2 -2
- package/dist/providers/anthropic.js +92 -84
- package/dist/providers/azureOpenAI.d.ts +2 -2
- package/dist/providers/azureOpenAI.js +97 -86
- package/dist/providers/function-calling-provider.d.ts +70 -0
- package/dist/providers/function-calling-provider.js +359 -0
- package/dist/providers/googleAIStudio.d.ts +10 -5
- package/dist/providers/googleAIStudio.js +60 -38
- package/dist/providers/googleVertexAI.d.ts +3 -3
- package/dist/providers/googleVertexAI.js +96 -86
- package/dist/providers/huggingFace.d.ts +31 -0
- package/dist/providers/huggingFace.js +362 -0
- package/dist/providers/index.d.ts +14 -8
- package/dist/providers/index.js +18 -12
- package/dist/providers/mcp-provider.d.ts +62 -0
- package/dist/providers/mcp-provider.js +183 -0
- package/dist/providers/mistralAI.d.ts +32 -0
- package/dist/providers/mistralAI.js +223 -0
- package/dist/providers/ollama.d.ts +51 -0
- package/dist/providers/ollama.js +508 -0
- package/dist/providers/openAI.d.ts +7 -3
- package/dist/providers/openAI.js +45 -33
- package/dist/utils/logger.js +2 -2
- package/dist/utils/providerUtils.js +59 -22
- package/package.json +28 -4
|
@@ -5,73 +5,119 @@
|
|
|
5
5
|
* Enhanced configuration system with interactive setup,
|
|
6
6
|
* multi-profile support, and smart validation.
|
|
7
7
|
*/
|
|
8
|
-
import inquirer from
|
|
9
|
-
import fs from
|
|
10
|
-
import path from
|
|
11
|
-
import os from
|
|
12
|
-
import chalk from
|
|
13
|
-
import { z } from
|
|
8
|
+
import inquirer from "inquirer";
|
|
9
|
+
import fs from "fs";
|
|
10
|
+
import path from "path";
|
|
11
|
+
import os from "os";
|
|
12
|
+
import chalk from "chalk";
|
|
13
|
+
import { z } from "zod";
|
|
14
14
|
// Configuration schema for validation
|
|
15
15
|
const ConfigSchema = z.object({
|
|
16
|
-
defaultProvider: z
|
|
17
|
-
|
|
18
|
-
|
|
16
|
+
defaultProvider: z
|
|
17
|
+
.enum([
|
|
18
|
+
"auto",
|
|
19
|
+
"openai",
|
|
20
|
+
"bedrock",
|
|
21
|
+
"vertex",
|
|
22
|
+
"anthropic",
|
|
23
|
+
"azure",
|
|
24
|
+
"google-ai",
|
|
25
|
+
"huggingface",
|
|
26
|
+
"ollama",
|
|
27
|
+
"mistral",
|
|
28
|
+
])
|
|
29
|
+
.default("auto"),
|
|
30
|
+
providers: z
|
|
31
|
+
.object({
|
|
32
|
+
openai: z
|
|
33
|
+
.object({
|
|
19
34
|
apiKey: z.string().optional(),
|
|
20
|
-
model: z.string().default(
|
|
21
|
-
baseURL: z.string().optional()
|
|
22
|
-
})
|
|
23
|
-
|
|
35
|
+
model: z.string().default("gpt-4"),
|
|
36
|
+
baseURL: z.string().optional(),
|
|
37
|
+
})
|
|
38
|
+
.optional(),
|
|
39
|
+
bedrock: z
|
|
40
|
+
.object({
|
|
24
41
|
region: z.string().optional(),
|
|
25
42
|
accessKeyId: z.string().optional(),
|
|
26
43
|
secretAccessKey: z.string().optional(),
|
|
27
44
|
sessionToken: z.string().optional(),
|
|
28
|
-
model: z
|
|
29
|
-
|
|
30
|
-
|
|
45
|
+
model: z
|
|
46
|
+
.string()
|
|
47
|
+
.default("arn:aws:bedrock:us-east-2:225681119357:inference-profile/us.anthropic.claude-3-7-sonnet-20250219-v1:0"),
|
|
48
|
+
})
|
|
49
|
+
.optional(),
|
|
50
|
+
vertex: z
|
|
51
|
+
.object({
|
|
31
52
|
projectId: z.string().optional(),
|
|
32
|
-
location: z.string().default(
|
|
53
|
+
location: z.string().default("us-east5"),
|
|
33
54
|
credentials: z.string().optional(),
|
|
34
55
|
serviceAccountKey: z.string().optional(),
|
|
35
56
|
clientEmail: z.string().optional(),
|
|
36
57
|
privateKey: z.string().optional(),
|
|
37
|
-
model: z.string().default(
|
|
38
|
-
})
|
|
39
|
-
|
|
58
|
+
model: z.string().default("gemini-1.5-pro"),
|
|
59
|
+
})
|
|
60
|
+
.optional(),
|
|
61
|
+
anthropic: z
|
|
62
|
+
.object({
|
|
40
63
|
apiKey: z.string().optional(),
|
|
41
|
-
model: z.string().default(
|
|
42
|
-
})
|
|
43
|
-
|
|
64
|
+
model: z.string().default("claude-3-5-sonnet-20241022"),
|
|
65
|
+
})
|
|
66
|
+
.optional(),
|
|
67
|
+
azure: z
|
|
68
|
+
.object({
|
|
44
69
|
apiKey: z.string().optional(),
|
|
45
70
|
endpoint: z.string().optional(),
|
|
46
71
|
deploymentId: z.string().optional(),
|
|
47
|
-
model: z.string().default(
|
|
48
|
-
})
|
|
49
|
-
|
|
72
|
+
model: z.string().default("gpt-4"),
|
|
73
|
+
})
|
|
74
|
+
.optional(),
|
|
75
|
+
"google-ai": z
|
|
76
|
+
.object({
|
|
50
77
|
apiKey: z.string().optional(),
|
|
51
|
-
model: z.string().default(
|
|
52
|
-
})
|
|
53
|
-
|
|
78
|
+
model: z.string().default("gemini-1.5-pro-latest"),
|
|
79
|
+
})
|
|
80
|
+
.optional(),
|
|
81
|
+
huggingface: z
|
|
82
|
+
.object({
|
|
54
83
|
apiKey: z.string().optional(),
|
|
55
|
-
model: z.string().default(
|
|
56
|
-
})
|
|
57
|
-
|
|
84
|
+
model: z.string().default("microsoft/DialoGPT-large"),
|
|
85
|
+
})
|
|
86
|
+
.optional(),
|
|
87
|
+
ollama: z
|
|
88
|
+
.object({
|
|
89
|
+
baseUrl: z.string().default("http://localhost:11434"),
|
|
90
|
+
model: z.string().default("llama2"),
|
|
91
|
+
timeout: z.number().default(60000),
|
|
92
|
+
})
|
|
93
|
+
.optional(),
|
|
94
|
+
mistral: z
|
|
95
|
+
.object({
|
|
96
|
+
apiKey: z.string().optional(),
|
|
97
|
+
model: z.string().default("mistral-small"),
|
|
98
|
+
})
|
|
99
|
+
.optional(),
|
|
100
|
+
})
|
|
101
|
+
.default({}),
|
|
58
102
|
profiles: z.record(z.string(), z.any()).default({}),
|
|
59
|
-
preferences: z
|
|
60
|
-
|
|
103
|
+
preferences: z
|
|
104
|
+
.object({
|
|
105
|
+
outputFormat: z.enum(["text", "json", "yaml"]).default("text"),
|
|
61
106
|
temperature: z.number().min(0).max(2).default(0.7),
|
|
62
107
|
maxTokens: z.number().min(1).max(4000).default(500),
|
|
63
108
|
enableLogging: z.boolean().default(false),
|
|
64
109
|
enableCaching: z.boolean().default(true),
|
|
65
|
-
cacheStrategy: z.enum([
|
|
66
|
-
})
|
|
110
|
+
cacheStrategy: z.enum(["memory", "file", "redis"]).default("memory"),
|
|
111
|
+
})
|
|
112
|
+
.default({}),
|
|
67
113
|
});
|
|
68
114
|
export class ConfigManager {
|
|
69
115
|
configDir;
|
|
70
116
|
configFile;
|
|
71
117
|
config;
|
|
72
118
|
constructor() {
|
|
73
|
-
this.configDir = path.join(os.homedir(),
|
|
74
|
-
this.configFile = path.join(this.configDir,
|
|
119
|
+
this.configDir = path.join(os.homedir(), ".neurolink");
|
|
120
|
+
this.configFile = path.join(this.configDir, "config.json");
|
|
75
121
|
this.config = this.loadConfig();
|
|
76
122
|
}
|
|
77
123
|
/**
|
|
@@ -80,12 +126,12 @@ export class ConfigManager {
|
|
|
80
126
|
loadConfig() {
|
|
81
127
|
try {
|
|
82
128
|
if (fs.existsSync(this.configFile)) {
|
|
83
|
-
const configData = JSON.parse(fs.readFileSync(this.configFile,
|
|
129
|
+
const configData = JSON.parse(fs.readFileSync(this.configFile, "utf8"));
|
|
84
130
|
return ConfigSchema.parse(configData);
|
|
85
131
|
}
|
|
86
132
|
}
|
|
87
133
|
catch (error) {
|
|
88
|
-
console.warn(chalk.yellow(`⚠️ Invalid config file: ${error instanceof Error ? error.message :
|
|
134
|
+
console.warn(chalk.yellow(`⚠️ Invalid config file: ${error instanceof Error ? error.message : "Unknown error"}`));
|
|
89
135
|
}
|
|
90
136
|
return ConfigSchema.parse({});
|
|
91
137
|
}
|
|
@@ -104,7 +150,7 @@ export class ConfigManager {
|
|
|
104
150
|
console.log(chalk.green(`✅ Configuration saved to ${this.configFile}`));
|
|
105
151
|
}
|
|
106
152
|
catch (error) {
|
|
107
|
-
console.error(chalk.red(`❌ Failed to save config: ${error instanceof Error ? error.message :
|
|
153
|
+
console.error(chalk.red(`❌ Failed to save config: ${error instanceof Error ? error.message : "Unknown error"}`));
|
|
108
154
|
process.exit(1);
|
|
109
155
|
}
|
|
110
156
|
}
|
|
@@ -112,46 +158,56 @@ export class ConfigManager {
|
|
|
112
158
|
* Interactive configuration setup
|
|
113
159
|
*/
|
|
114
160
|
async initInteractive() {
|
|
115
|
-
console.log(chalk.blue(
|
|
161
|
+
console.log(chalk.blue("🧠 NeuroLink Configuration Setup\n"));
|
|
116
162
|
try {
|
|
117
163
|
// Basic preferences
|
|
118
164
|
const preferences = await inquirer.prompt([
|
|
119
165
|
{
|
|
120
|
-
type:
|
|
121
|
-
name:
|
|
122
|
-
message:
|
|
166
|
+
type: "list",
|
|
167
|
+
name: "defaultProvider",
|
|
168
|
+
message: "Select your default AI provider:",
|
|
123
169
|
choices: [
|
|
124
|
-
{
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
{ name:
|
|
129
|
-
{ name:
|
|
130
|
-
{ name:
|
|
131
|
-
{ name:
|
|
170
|
+
{
|
|
171
|
+
name: "Auto (recommended) - Automatically select best available",
|
|
172
|
+
value: "auto",
|
|
173
|
+
},
|
|
174
|
+
{ name: "OpenAI - GPT models", value: "openai" },
|
|
175
|
+
{ name: "Amazon Bedrock - Claude, Llama, Titan", value: "bedrock" },
|
|
176
|
+
{ name: "Google Vertex AI - Gemini models", value: "vertex" },
|
|
177
|
+
{ name: "Anthropic - Claude models (direct)", value: "anthropic" },
|
|
178
|
+
{ name: "Azure OpenAI - Enterprise GPT", value: "azure" },
|
|
179
|
+
{
|
|
180
|
+
name: "Google AI Studio - Gemini models (direct)",
|
|
181
|
+
value: "google-ai",
|
|
182
|
+
},
|
|
183
|
+
{ name: "Hugging Face - Open source models", value: "huggingface" },
|
|
184
|
+
{
|
|
185
|
+
name: "Mistral AI - European AI with competitive pricing",
|
|
186
|
+
value: "mistral",
|
|
187
|
+
},
|
|
132
188
|
],
|
|
133
|
-
default: this.config.defaultProvider
|
|
189
|
+
default: this.config.defaultProvider,
|
|
134
190
|
},
|
|
135
191
|
{
|
|
136
|
-
type:
|
|
137
|
-
name:
|
|
138
|
-
message:
|
|
139
|
-
choices: [
|
|
140
|
-
default: this.config.preferences.outputFormat
|
|
192
|
+
type: "list",
|
|
193
|
+
name: "outputFormat",
|
|
194
|
+
message: "Preferred output format:",
|
|
195
|
+
choices: ["text", "json", "yaml"],
|
|
196
|
+
default: this.config.preferences.outputFormat,
|
|
141
197
|
},
|
|
142
198
|
{
|
|
143
|
-
type:
|
|
144
|
-
name:
|
|
145
|
-
message:
|
|
199
|
+
type: "number",
|
|
200
|
+
name: "temperature",
|
|
201
|
+
message: "Default creativity level (0.0 = focused, 1.0 = creative):",
|
|
146
202
|
default: this.config.preferences.temperature,
|
|
147
|
-
validate: (value) => value >= 0 && value <= 2
|
|
203
|
+
validate: (value) => value >= 0 && value <= 2,
|
|
148
204
|
},
|
|
149
205
|
{
|
|
150
|
-
type:
|
|
151
|
-
name:
|
|
152
|
-
message:
|
|
153
|
-
default: true
|
|
154
|
-
}
|
|
206
|
+
type: "confirm",
|
|
207
|
+
name: "setupProviders",
|
|
208
|
+
message: "Would you like to configure provider credentials now?",
|
|
209
|
+
default: true,
|
|
210
|
+
},
|
|
155
211
|
]);
|
|
156
212
|
// Update config with preferences
|
|
157
213
|
this.config.defaultProvider = preferences.defaultProvider;
|
|
@@ -162,13 +218,14 @@ export class ConfigManager {
|
|
|
162
218
|
await this.setupProviders();
|
|
163
219
|
}
|
|
164
220
|
this.saveConfig();
|
|
165
|
-
console.log(chalk.green(
|
|
166
|
-
console.log(chalk.blue(
|
|
167
|
-
console.log(chalk.blue(
|
|
221
|
+
console.log(chalk.green("\n✅ Configuration setup complete!"));
|
|
222
|
+
console.log(chalk.blue("💡 You can modify settings anytime with: neurolink config edit"));
|
|
223
|
+
console.log(chalk.blue("💡 Test your setup with: neurolink status"));
|
|
168
224
|
}
|
|
169
225
|
catch (error) {
|
|
170
|
-
if (error instanceof Error &&
|
|
171
|
-
|
|
226
|
+
if (error instanceof Error &&
|
|
227
|
+
error.message === "User force closed the prompt with 0 null") {
|
|
228
|
+
console.log(chalk.yellow("\n⚠️ Setup cancelled by user"));
|
|
172
229
|
process.exit(0);
|
|
173
230
|
}
|
|
174
231
|
throw error;
|
|
@@ -180,19 +237,21 @@ export class ConfigManager {
|
|
|
180
237
|
async setupProviders() {
|
|
181
238
|
const { selectedProviders } = await inquirer.prompt([
|
|
182
239
|
{
|
|
183
|
-
type:
|
|
184
|
-
name:
|
|
185
|
-
message:
|
|
240
|
+
type: "checkbox",
|
|
241
|
+
name: "selectedProviders",
|
|
242
|
+
message: "Select providers to configure:",
|
|
186
243
|
choices: [
|
|
187
|
-
{ name:
|
|
188
|
-
{ name:
|
|
189
|
-
{ name:
|
|
190
|
-
{ name:
|
|
191
|
-
{ name:
|
|
192
|
-
{ name:
|
|
193
|
-
{ name:
|
|
194
|
-
|
|
195
|
-
|
|
244
|
+
{ name: "OpenAI (GPT-4, GPT-3.5)", value: "openai" },
|
|
245
|
+
{ name: "Amazon Bedrock (Claude, Llama)", value: "bedrock" },
|
|
246
|
+
{ name: "Google Vertex AI (Gemini)", value: "vertex" },
|
|
247
|
+
{ name: "Anthropic Direct (Claude)", value: "anthropic" },
|
|
248
|
+
{ name: "Azure OpenAI (Enterprise)", value: "azure" },
|
|
249
|
+
{ name: "Google AI Studio (Gemini Direct)", value: "google-ai" },
|
|
250
|
+
{ name: "Hugging Face (Open Source)", value: "huggingface" },
|
|
251
|
+
{ name: "Ollama (Local AI Models)", value: "ollama" },
|
|
252
|
+
{ name: "Mistral AI (European AI)", value: "mistral" },
|
|
253
|
+
],
|
|
254
|
+
},
|
|
196
255
|
]);
|
|
197
256
|
for (const provider of selectedProviders) {
|
|
198
257
|
await this.setupProvider(provider);
|
|
@@ -204,27 +263,33 @@ export class ConfigManager {
|
|
|
204
263
|
async setupProvider(provider) {
|
|
205
264
|
console.log(chalk.blue(`\n🔧 Configuring ${provider.toUpperCase()}`));
|
|
206
265
|
switch (provider) {
|
|
207
|
-
case
|
|
266
|
+
case "openai":
|
|
208
267
|
await this.setupOpenAI();
|
|
209
268
|
break;
|
|
210
|
-
case
|
|
269
|
+
case "bedrock":
|
|
211
270
|
await this.setupBedrock();
|
|
212
271
|
break;
|
|
213
|
-
case
|
|
272
|
+
case "vertex":
|
|
214
273
|
await this.setupVertex();
|
|
215
274
|
break;
|
|
216
|
-
case
|
|
275
|
+
case "anthropic":
|
|
217
276
|
await this.setupAnthropic();
|
|
218
277
|
break;
|
|
219
|
-
case
|
|
278
|
+
case "azure":
|
|
220
279
|
await this.setupAzure();
|
|
221
280
|
break;
|
|
222
|
-
case
|
|
281
|
+
case "google-ai":
|
|
223
282
|
await this.setupGoogleAI();
|
|
224
283
|
break;
|
|
225
|
-
case
|
|
284
|
+
case "huggingface":
|
|
226
285
|
await this.setupHuggingFace();
|
|
227
286
|
break;
|
|
287
|
+
case "ollama":
|
|
288
|
+
await this.setupOllama();
|
|
289
|
+
break;
|
|
290
|
+
case "mistral":
|
|
291
|
+
await this.setupMistral();
|
|
292
|
+
break;
|
|
228
293
|
}
|
|
229
294
|
}
|
|
230
295
|
/**
|
|
@@ -233,29 +298,29 @@ export class ConfigManager {
|
|
|
233
298
|
async setupOpenAI() {
|
|
234
299
|
const answers = await inquirer.prompt([
|
|
235
300
|
{
|
|
236
|
-
type:
|
|
237
|
-
name:
|
|
238
|
-
message:
|
|
239
|
-
validate: (value) => value.startsWith(
|
|
301
|
+
type: "password",
|
|
302
|
+
name: "apiKey",
|
|
303
|
+
message: "OpenAI API Key (sk-...):",
|
|
304
|
+
validate: (value) => value.startsWith("sk-") || 'API key should start with "sk-"',
|
|
240
305
|
},
|
|
241
306
|
{
|
|
242
|
-
type:
|
|
243
|
-
name:
|
|
244
|
-
message:
|
|
245
|
-
choices: [
|
|
246
|
-
default:
|
|
307
|
+
type: "list",
|
|
308
|
+
name: "model",
|
|
309
|
+
message: "Default model:",
|
|
310
|
+
choices: ["gpt-4", "gpt-4-turbo", "gpt-3.5-turbo"],
|
|
311
|
+
default: "gpt-4",
|
|
247
312
|
},
|
|
248
313
|
{
|
|
249
|
-
type:
|
|
250
|
-
name:
|
|
251
|
-
message:
|
|
252
|
-
default:
|
|
253
|
-
}
|
|
314
|
+
type: "input",
|
|
315
|
+
name: "baseURL",
|
|
316
|
+
message: "Custom base URL (optional):",
|
|
317
|
+
default: "",
|
|
318
|
+
},
|
|
254
319
|
]);
|
|
255
320
|
this.config.providers.openai = {
|
|
256
321
|
apiKey: answers.apiKey,
|
|
257
322
|
model: answers.model,
|
|
258
|
-
...(answers.baseURL && { baseURL: answers.baseURL })
|
|
323
|
+
...(answers.baseURL && { baseURL: answers.baseURL }),
|
|
259
324
|
};
|
|
260
325
|
}
|
|
261
326
|
/**
|
|
@@ -264,39 +329,41 @@ export class ConfigManager {
|
|
|
264
329
|
async setupBedrock() {
|
|
265
330
|
const answers = await inquirer.prompt([
|
|
266
331
|
{
|
|
267
|
-
type:
|
|
268
|
-
name:
|
|
269
|
-
message:
|
|
270
|
-
default:
|
|
332
|
+
type: "input",
|
|
333
|
+
name: "region",
|
|
334
|
+
message: "AWS Region:",
|
|
335
|
+
default: "us-east-1",
|
|
271
336
|
},
|
|
272
337
|
{
|
|
273
|
-
type:
|
|
274
|
-
name:
|
|
275
|
-
message:
|
|
338
|
+
type: "input",
|
|
339
|
+
name: "accessKeyId",
|
|
340
|
+
message: "AWS Access Key ID (optional if using IAM roles):",
|
|
276
341
|
},
|
|
277
342
|
{
|
|
278
|
-
type:
|
|
279
|
-
name:
|
|
280
|
-
message:
|
|
343
|
+
type: "password",
|
|
344
|
+
name: "secretAccessKey",
|
|
345
|
+
message: "AWS Secret Access Key (optional if using IAM roles):",
|
|
281
346
|
},
|
|
282
347
|
{
|
|
283
|
-
type:
|
|
284
|
-
name:
|
|
285
|
-
message:
|
|
348
|
+
type: "password",
|
|
349
|
+
name: "sessionToken",
|
|
350
|
+
message: "AWS Session Token (optional):",
|
|
286
351
|
},
|
|
287
352
|
{
|
|
288
|
-
type:
|
|
289
|
-
name:
|
|
290
|
-
message:
|
|
291
|
-
default:
|
|
292
|
-
}
|
|
353
|
+
type: "input",
|
|
354
|
+
name: "model",
|
|
355
|
+
message: "Model ARN:",
|
|
356
|
+
default: "arn:aws:bedrock:us-east-2:225681119357:inference-profile/us.anthropic.claude-3-7-sonnet-20250219-v1:0",
|
|
357
|
+
},
|
|
293
358
|
]);
|
|
294
359
|
this.config.providers.bedrock = {
|
|
295
360
|
region: answers.region,
|
|
296
361
|
...(answers.accessKeyId && { accessKeyId: answers.accessKeyId }),
|
|
297
|
-
...(answers.secretAccessKey && {
|
|
362
|
+
...(answers.secretAccessKey && {
|
|
363
|
+
secretAccessKey: answers.secretAccessKey,
|
|
364
|
+
}),
|
|
298
365
|
...(answers.sessionToken && { sessionToken: answers.sessionToken }),
|
|
299
|
-
model: answers.model
|
|
366
|
+
model: answers.model,
|
|
300
367
|
};
|
|
301
368
|
}
|
|
302
369
|
/**
|
|
@@ -305,94 +372,97 @@ export class ConfigManager {
|
|
|
305
372
|
async setupVertex() {
|
|
306
373
|
const { authMethod } = await inquirer.prompt([
|
|
307
374
|
{
|
|
308
|
-
type:
|
|
309
|
-
name:
|
|
310
|
-
message:
|
|
375
|
+
type: "list",
|
|
376
|
+
name: "authMethod",
|
|
377
|
+
message: "Authentication method:",
|
|
311
378
|
choices: [
|
|
312
|
-
{ name:
|
|
313
|
-
{ name:
|
|
314
|
-
{ name:
|
|
315
|
-
]
|
|
316
|
-
}
|
|
379
|
+
{ name: "Service Account File", value: "file" },
|
|
380
|
+
{ name: "Service Account JSON String", value: "json" },
|
|
381
|
+
{ name: "Individual Environment Variables", value: "env" },
|
|
382
|
+
],
|
|
383
|
+
},
|
|
317
384
|
]);
|
|
318
385
|
const commonAnswers = await inquirer.prompt([
|
|
319
386
|
{
|
|
320
|
-
type:
|
|
321
|
-
name:
|
|
322
|
-
message:
|
|
323
|
-
validate: (value) => value.length > 0 ||
|
|
387
|
+
type: "input",
|
|
388
|
+
name: "projectId",
|
|
389
|
+
message: "Google Cloud Project ID:",
|
|
390
|
+
validate: (value) => value.length > 0 || "Project ID is required",
|
|
324
391
|
},
|
|
325
392
|
{
|
|
326
|
-
type:
|
|
327
|
-
name:
|
|
328
|
-
message:
|
|
329
|
-
default:
|
|
393
|
+
type: "input",
|
|
394
|
+
name: "location",
|
|
395
|
+
message: "Vertex AI Location:",
|
|
396
|
+
default: "us-east5",
|
|
330
397
|
},
|
|
331
398
|
{
|
|
332
|
-
type:
|
|
333
|
-
name:
|
|
334
|
-
message:
|
|
335
|
-
choices: [
|
|
336
|
-
default:
|
|
337
|
-
}
|
|
399
|
+
type: "list",
|
|
400
|
+
name: "model",
|
|
401
|
+
message: "Default model:",
|
|
402
|
+
choices: ["gemini-1.5-pro", "gemini-1.5-flash", "gemini-pro"],
|
|
403
|
+
default: "gemini-1.5-pro",
|
|
404
|
+
},
|
|
338
405
|
]);
|
|
339
406
|
let authConfig = {};
|
|
340
407
|
switch (authMethod) {
|
|
341
|
-
case
|
|
408
|
+
case "file": {
|
|
342
409
|
const fileAnswers = await inquirer.prompt([
|
|
343
410
|
{
|
|
344
|
-
type:
|
|
345
|
-
name:
|
|
346
|
-
message:
|
|
347
|
-
validate: (value) => fs.existsSync(value) ||
|
|
348
|
-
}
|
|
411
|
+
type: "input",
|
|
412
|
+
name: "credentials",
|
|
413
|
+
message: "Path to service account JSON file:",
|
|
414
|
+
validate: (value) => fs.existsSync(value) || "File does not exist",
|
|
415
|
+
},
|
|
349
416
|
]);
|
|
350
417
|
authConfig = { credentials: fileAnswers.credentials };
|
|
351
418
|
break;
|
|
352
|
-
|
|
419
|
+
}
|
|
420
|
+
case "json": {
|
|
353
421
|
const jsonAnswers = await inquirer.prompt([
|
|
354
422
|
{
|
|
355
|
-
type:
|
|
356
|
-
name:
|
|
357
|
-
message:
|
|
423
|
+
type: "input",
|
|
424
|
+
name: "serviceAccountKey",
|
|
425
|
+
message: "Service account JSON string:",
|
|
358
426
|
validate: (value) => {
|
|
359
427
|
try {
|
|
360
428
|
JSON.parse(value);
|
|
361
429
|
return true;
|
|
362
430
|
}
|
|
363
431
|
catch {
|
|
364
|
-
return
|
|
432
|
+
return "Invalid JSON";
|
|
365
433
|
}
|
|
366
|
-
}
|
|
367
|
-
}
|
|
434
|
+
},
|
|
435
|
+
},
|
|
368
436
|
]);
|
|
369
437
|
authConfig = { serviceAccountKey: jsonAnswers.serviceAccountKey };
|
|
370
438
|
break;
|
|
371
|
-
|
|
439
|
+
}
|
|
440
|
+
case "env": {
|
|
372
441
|
const envAnswers = await inquirer.prompt([
|
|
373
442
|
{
|
|
374
|
-
type:
|
|
375
|
-
name:
|
|
376
|
-
message:
|
|
377
|
-
validate: (value) => value.includes(
|
|
443
|
+
type: "input",
|
|
444
|
+
name: "clientEmail",
|
|
445
|
+
message: "Service account email:",
|
|
446
|
+
validate: (value) => value.includes("@") || "Invalid email format",
|
|
378
447
|
},
|
|
379
448
|
{
|
|
380
|
-
type:
|
|
381
|
-
name:
|
|
382
|
-
message:
|
|
383
|
-
}
|
|
449
|
+
type: "password",
|
|
450
|
+
name: "privateKey",
|
|
451
|
+
message: "Private key:",
|
|
452
|
+
},
|
|
384
453
|
]);
|
|
385
454
|
authConfig = {
|
|
386
455
|
clientEmail: envAnswers.clientEmail,
|
|
387
|
-
privateKey: envAnswers.privateKey
|
|
456
|
+
privateKey: envAnswers.privateKey,
|
|
388
457
|
};
|
|
389
458
|
break;
|
|
459
|
+
}
|
|
390
460
|
}
|
|
391
461
|
this.config.providers.vertex = {
|
|
392
462
|
projectId: commonAnswers.projectId,
|
|
393
463
|
location: commonAnswers.location,
|
|
394
464
|
model: commonAnswers.model,
|
|
395
|
-
...authConfig
|
|
465
|
+
...authConfig,
|
|
396
466
|
};
|
|
397
467
|
}
|
|
398
468
|
/**
|
|
@@ -401,22 +471,22 @@ export class ConfigManager {
|
|
|
401
471
|
async setupAnthropic() {
|
|
402
472
|
const answers = await inquirer.prompt([
|
|
403
473
|
{
|
|
404
|
-
type:
|
|
405
|
-
name:
|
|
406
|
-
message:
|
|
407
|
-
validate: (value) => value.length > 0 ||
|
|
474
|
+
type: "password",
|
|
475
|
+
name: "apiKey",
|
|
476
|
+
message: "Anthropic API Key:",
|
|
477
|
+
validate: (value) => value.length > 0 || "API key is required",
|
|
408
478
|
},
|
|
409
479
|
{
|
|
410
|
-
type:
|
|
411
|
-
name:
|
|
412
|
-
message:
|
|
480
|
+
type: "list",
|
|
481
|
+
name: "model",
|
|
482
|
+
message: "Default model:",
|
|
413
483
|
choices: [
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
484
|
+
"claude-3-5-sonnet-20241022",
|
|
485
|
+
"claude-3-5-haiku-20241022",
|
|
486
|
+
"claude-3-opus-20240229",
|
|
417
487
|
],
|
|
418
|
-
default:
|
|
419
|
-
}
|
|
488
|
+
default: "claude-3-5-sonnet-20241022",
|
|
489
|
+
},
|
|
420
490
|
]);
|
|
421
491
|
this.config.providers.anthropic = answers;
|
|
422
492
|
}
|
|
@@ -426,28 +496,28 @@ export class ConfigManager {
|
|
|
426
496
|
async setupAzure() {
|
|
427
497
|
const answers = await inquirer.prompt([
|
|
428
498
|
{
|
|
429
|
-
type:
|
|
430
|
-
name:
|
|
431
|
-
message:
|
|
499
|
+
type: "password",
|
|
500
|
+
name: "apiKey",
|
|
501
|
+
message: "Azure OpenAI API Key:",
|
|
432
502
|
},
|
|
433
503
|
{
|
|
434
|
-
type:
|
|
435
|
-
name:
|
|
436
|
-
message:
|
|
437
|
-
validate: (value) => value.startsWith(
|
|
504
|
+
type: "input",
|
|
505
|
+
name: "endpoint",
|
|
506
|
+
message: "Azure OpenAI Endpoint:",
|
|
507
|
+
validate: (value) => value.startsWith("https://") || "Endpoint should start with https://",
|
|
438
508
|
},
|
|
439
509
|
{
|
|
440
|
-
type:
|
|
441
|
-
name:
|
|
442
|
-
message:
|
|
510
|
+
type: "input",
|
|
511
|
+
name: "deploymentId",
|
|
512
|
+
message: "Deployment ID:",
|
|
443
513
|
},
|
|
444
514
|
{
|
|
445
|
-
type:
|
|
446
|
-
name:
|
|
447
|
-
message:
|
|
448
|
-
choices: [
|
|
449
|
-
default:
|
|
450
|
-
}
|
|
515
|
+
type: "list",
|
|
516
|
+
name: "model",
|
|
517
|
+
message: "Model:",
|
|
518
|
+
choices: ["gpt-4", "gpt-4-turbo", "gpt-35-turbo"],
|
|
519
|
+
default: "gpt-4",
|
|
520
|
+
},
|
|
451
521
|
]);
|
|
452
522
|
this.config.providers.azure = answers;
|
|
453
523
|
}
|
|
@@ -457,25 +527,25 @@ export class ConfigManager {
|
|
|
457
527
|
async setupGoogleAI() {
|
|
458
528
|
const answers = await inquirer.prompt([
|
|
459
529
|
{
|
|
460
|
-
type:
|
|
461
|
-
name:
|
|
462
|
-
message:
|
|
463
|
-
validate: (value) => value.length > 0 ||
|
|
530
|
+
type: "password",
|
|
531
|
+
name: "apiKey",
|
|
532
|
+
message: "Google AI API Key:",
|
|
533
|
+
validate: (value) => value.length > 0 || "API key is required",
|
|
464
534
|
},
|
|
465
535
|
{
|
|
466
|
-
type:
|
|
467
|
-
name:
|
|
468
|
-
message:
|
|
536
|
+
type: "list",
|
|
537
|
+
name: "model",
|
|
538
|
+
message: "Default model:",
|
|
469
539
|
choices: [
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
540
|
+
"gemini-1.5-pro-latest",
|
|
541
|
+
"gemini-2.0-flash-exp",
|
|
542
|
+
"gemini-1.5-flash-latest",
|
|
543
|
+
"gemini-1.0-pro",
|
|
474
544
|
],
|
|
475
|
-
default:
|
|
476
|
-
}
|
|
545
|
+
default: "gemini-1.5-pro-latest",
|
|
546
|
+
},
|
|
477
547
|
]);
|
|
478
|
-
this.config.providers[
|
|
548
|
+
this.config.providers["google-ai"] = answers;
|
|
479
549
|
}
|
|
480
550
|
/**
|
|
481
551
|
* Hugging Face provider setup
|
|
@@ -483,19 +553,74 @@ export class ConfigManager {
|
|
|
483
553
|
async setupHuggingFace() {
|
|
484
554
|
const answers = await inquirer.prompt([
|
|
485
555
|
{
|
|
486
|
-
type:
|
|
487
|
-
name:
|
|
488
|
-
message:
|
|
556
|
+
type: "password",
|
|
557
|
+
name: "apiKey",
|
|
558
|
+
message: "Hugging Face API Key:",
|
|
489
559
|
},
|
|
490
560
|
{
|
|
491
|
-
type:
|
|
492
|
-
name:
|
|
493
|
-
message:
|
|
494
|
-
default:
|
|
495
|
-
}
|
|
561
|
+
type: "input",
|
|
562
|
+
name: "model",
|
|
563
|
+
message: "Model name:",
|
|
564
|
+
default: "microsoft/DialoGPT-large",
|
|
565
|
+
},
|
|
496
566
|
]);
|
|
497
567
|
this.config.providers.huggingface = answers;
|
|
498
568
|
}
|
|
569
|
+
/**
|
|
570
|
+
* Ollama provider setup
|
|
571
|
+
*/
|
|
572
|
+
async setupOllama() {
|
|
573
|
+
const answers = await inquirer.prompt([
|
|
574
|
+
{
|
|
575
|
+
type: "input",
|
|
576
|
+
name: "baseUrl",
|
|
577
|
+
message: "Ollama base URL:",
|
|
578
|
+
default: "http://localhost:11434",
|
|
579
|
+
validate: (value) => value.startsWith("http") ||
|
|
580
|
+
"URL should start with http:// or https://",
|
|
581
|
+
},
|
|
582
|
+
{
|
|
583
|
+
type: "input",
|
|
584
|
+
name: "model",
|
|
585
|
+
message: "Default model:",
|
|
586
|
+
default: "llama2",
|
|
587
|
+
},
|
|
588
|
+
{
|
|
589
|
+
type: "number",
|
|
590
|
+
name: "timeout",
|
|
591
|
+
message: "Request timeout (milliseconds):",
|
|
592
|
+
default: 60000,
|
|
593
|
+
validate: (value) => value > 0 || "Timeout must be positive",
|
|
594
|
+
},
|
|
595
|
+
]);
|
|
596
|
+
this.config.providers.ollama = answers;
|
|
597
|
+
}
|
|
598
|
+
/**
|
|
599
|
+
* Mistral AI provider setup
|
|
600
|
+
*/
|
|
601
|
+
async setupMistral() {
|
|
602
|
+
const answers = await inquirer.prompt([
|
|
603
|
+
{
|
|
604
|
+
type: "password",
|
|
605
|
+
name: "apiKey",
|
|
606
|
+
message: "Mistral AI API Key:",
|
|
607
|
+
validate: (value) => value.length > 0 || "API key is required",
|
|
608
|
+
},
|
|
609
|
+
{
|
|
610
|
+
type: "list",
|
|
611
|
+
name: "model",
|
|
612
|
+
message: "Default model:",
|
|
613
|
+
choices: [
|
|
614
|
+
"mistral-small",
|
|
615
|
+
"mistral-medium",
|
|
616
|
+
"mistral-large",
|
|
617
|
+
"mistral-tiny",
|
|
618
|
+
],
|
|
619
|
+
default: "mistral-small",
|
|
620
|
+
},
|
|
621
|
+
]);
|
|
622
|
+
this.config.providers.mistral = answers;
|
|
623
|
+
}
|
|
499
624
|
/**
|
|
500
625
|
* Get current configuration
|
|
501
626
|
*/
|
|
@@ -513,22 +638,22 @@ export class ConfigManager {
|
|
|
513
638
|
* Show current configuration
|
|
514
639
|
*/
|
|
515
640
|
showConfig() {
|
|
516
|
-
console.log(chalk.blue(
|
|
517
|
-
console.log(chalk.cyan(
|
|
641
|
+
console.log(chalk.blue("📋 Current NeuroLink Configuration\n"));
|
|
642
|
+
console.log(chalk.cyan("General Settings:"));
|
|
518
643
|
console.log(` Default Provider: ${chalk.white(this.config.defaultProvider)}`);
|
|
519
644
|
console.log(` Output Format: ${chalk.white(this.config.preferences.outputFormat)}`);
|
|
520
645
|
console.log(` Temperature: ${chalk.white(this.config.preferences.temperature)}`);
|
|
521
646
|
console.log(` Max Tokens: ${chalk.white(this.config.preferences.maxTokens)}`);
|
|
522
|
-
console.log(chalk.cyan(
|
|
647
|
+
console.log(chalk.cyan("\nConfigured Providers:"));
|
|
523
648
|
Object.entries(this.config.providers).forEach(([name, config]) => {
|
|
524
649
|
if (config && Object.keys(config).length > 0) {
|
|
525
|
-
console.log(` ${chalk.green(
|
|
526
|
-
if (
|
|
650
|
+
console.log(` ${chalk.green("✅")} ${name.toUpperCase()}`);
|
|
651
|
+
if ("model" in config) {
|
|
527
652
|
console.log(` Model: ${chalk.white(config.model)}`);
|
|
528
653
|
}
|
|
529
654
|
}
|
|
530
655
|
});
|
|
531
|
-
console.log(chalk.cyan(
|
|
656
|
+
console.log(chalk.cyan("\nConfiguration File:"));
|
|
532
657
|
console.log(` Location: ${chalk.white(this.configFile)}`);
|
|
533
658
|
}
|
|
534
659
|
/**
|
|
@@ -541,17 +666,17 @@ export class ConfigManager {
|
|
|
541
666
|
}
|
|
542
667
|
catch (error) {
|
|
543
668
|
if (error instanceof z.ZodError) {
|
|
544
|
-
errors.push(...error.errors.map(e => `${e.path.join(
|
|
669
|
+
errors.push(...error.errors.map((e) => `${e.path.join(".")}: ${e.message}`));
|
|
545
670
|
}
|
|
546
671
|
}
|
|
547
672
|
// Check for at least one configured provider
|
|
548
|
-
const hasProvider = Object.values(this.config.providers).some(provider => provider && Object.keys(provider).length > 0);
|
|
673
|
+
const hasProvider = Object.values(this.config.providers).some((provider) => provider && Object.keys(provider).length > 0);
|
|
549
674
|
if (!hasProvider) {
|
|
550
675
|
errors.push('No providers configured. Run "neurolink config init" to set up providers.');
|
|
551
676
|
}
|
|
552
677
|
return {
|
|
553
678
|
valid: errors.length === 0,
|
|
554
|
-
errors
|
|
679
|
+
errors,
|
|
555
680
|
};
|
|
556
681
|
}
|
|
557
682
|
/**
|
|
@@ -560,7 +685,7 @@ export class ConfigManager {
|
|
|
560
685
|
resetConfig() {
|
|
561
686
|
this.config = ConfigSchema.parse({});
|
|
562
687
|
this.saveConfig();
|
|
563
|
-
console.log(chalk.green(
|
|
688
|
+
console.log(chalk.green("✅ Configuration reset to defaults"));
|
|
564
689
|
}
|
|
565
690
|
}
|
|
566
691
|
// Export for use in other CLI commands
|