@juspay/neurolink 7.41.1 → 7.41.3
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 +4 -0
- package/dist/config/configManager.d.ts +1 -1
- package/dist/config/configManager.js +7 -8
- package/dist/index.d.ts +1 -1
- package/dist/lib/config/configManager.d.ts +1 -1
- package/dist/lib/config/configManager.js +7 -8
- package/dist/lib/index.d.ts +1 -1
- package/dist/lib/providers/amazonBedrock.js +1 -0
- package/dist/lib/providers/googleAiStudio.js +1 -0
- package/dist/lib/providers/index.d.ts +0 -25
- package/dist/lib/providers/index.js +0 -21
- package/dist/lib/providers/openaiCompatible.js +1 -0
- package/dist/lib/types/cli.d.ts +53 -40
- package/dist/{config/types.d.ts → lib/types/configTypes.d.ts} +26 -26
- package/dist/{config/types.js → lib/types/configTypes.js} +1 -1
- package/dist/lib/types/index.d.ts +2 -1
- package/dist/lib/types/providers.d.ts +139 -2
- package/dist/lib/types/streamTypes.d.ts +2 -2
- package/dist/lib/utils/toolUtils.d.ts +1 -1
- package/dist/providers/amazonBedrock.js +1 -0
- package/dist/providers/googleAiStudio.js +1 -0
- package/dist/providers/index.d.ts +0 -25
- package/dist/providers/index.js +0 -21
- package/dist/providers/openaiCompatible.js +1 -0
- package/dist/types/cli.d.ts +53 -40
- package/dist/{lib/config/types.d.ts → types/configTypes.d.ts} +26 -26
- package/dist/{lib/config/types.js → types/configTypes.js} +1 -1
- package/dist/types/index.d.ts +2 -1
- package/dist/types/modelTypes.d.ts +20 -20
- package/dist/types/providers.d.ts +139 -2
- package/dist/types/streamTypes.d.ts +2 -2
- package/dist/utils/toolUtils.d.ts +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
## [7.41.3](https://github.com/juspay/neurolink/compare/v7.41.2...v7.41.3) (2025-09-20)
|
|
2
|
+
|
|
3
|
+
## [7.41.2](https://github.com/juspay/neurolink/compare/v7.41.1...v7.41.2) (2025-09-20)
|
|
4
|
+
|
|
1
5
|
## [7.41.1](https://github.com/juspay/neurolink/compare/v7.41.0...v7.41.1) (2025-09-20)
|
|
2
6
|
|
|
3
7
|
## [7.41.0](https://github.com/juspay/neurolink/compare/v7.40.1...v7.41.0) (2025-09-20)
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* NeuroLink Config Manager with Backup/Restore System
|
|
3
3
|
* Industry standard configuration management with safety mechanisms
|
|
4
4
|
*/
|
|
5
|
-
import type { NeuroLinkConfig, ProviderConfig, BackupInfo, ConfigValidationResult, ConfigUpdateOptions } from "
|
|
5
|
+
import type { NeuroLinkConfig, ProviderConfig, BackupInfo, ConfigValidationResult, ConfigUpdateOptions } from "../types/configTypes.js";
|
|
6
6
|
/**
|
|
7
7
|
* Enhanced Config Manager with automatic backup/restore capabilities
|
|
8
8
|
*/
|
|
@@ -3,10 +3,10 @@
|
|
|
3
3
|
* Industry standard configuration management with safety mechanisms
|
|
4
4
|
*/
|
|
5
5
|
import { promises as fs } from "fs";
|
|
6
|
-
import
|
|
7
|
-
import
|
|
6
|
+
import { join } from "path";
|
|
7
|
+
import { createHash } from "crypto";
|
|
8
8
|
import { logger } from "../utils/logger.js";
|
|
9
|
-
import { DEFAULT_CONFIG } from "
|
|
9
|
+
import { DEFAULT_CONFIG } from "../types/configTypes.js";
|
|
10
10
|
const { readFile, writeFile, readdir, mkdir, unlink, access } = fs;
|
|
11
11
|
/**
|
|
12
12
|
* Enhanced Config Manager with automatic backup/restore capabilities
|
|
@@ -73,7 +73,7 @@ export class NeuroLinkConfigManager {
|
|
|
73
73
|
await this.ensureBackupDirectory();
|
|
74
74
|
const timestamp = new Date().toISOString().replace(/[:.]/g, "-");
|
|
75
75
|
const backupFilename = `neurolink-config-${timestamp}.js`;
|
|
76
|
-
const backupPath =
|
|
76
|
+
const backupPath = join(this.backupDir, backupFilename);
|
|
77
77
|
const currentConfig = await this.loadConfig();
|
|
78
78
|
const configHash = this.generateConfigHash(currentConfig);
|
|
79
79
|
const backupMetadata = {
|
|
@@ -105,7 +105,7 @@ export default ${JSON.stringify(currentConfig, null, 2)};`;
|
|
|
105
105
|
const backups = [];
|
|
106
106
|
for (const file of backupFiles) {
|
|
107
107
|
try {
|
|
108
|
-
const filePath =
|
|
108
|
+
const filePath = join(this.backupDir, file);
|
|
109
109
|
const content = await readFile(filePath, "utf-8");
|
|
110
110
|
const metadata = this.extractMetadataFromBackup(content);
|
|
111
111
|
const config = this.extractConfigFromBackup(content);
|
|
@@ -131,7 +131,7 @@ export default ${JSON.stringify(currentConfig, null, 2)};`;
|
|
|
131
131
|
* Restore from specific backup
|
|
132
132
|
*/
|
|
133
133
|
async restoreFromBackup(backupFilename) {
|
|
134
|
-
const backupPath =
|
|
134
|
+
const backupPath = join(this.backupDir, backupFilename);
|
|
135
135
|
// Create backup of current config before restore
|
|
136
136
|
await this.createBackup("pre-restore");
|
|
137
137
|
try {
|
|
@@ -281,8 +281,7 @@ export default ${JSON.stringify(currentConfig, null, 2)};`;
|
|
|
281
281
|
}
|
|
282
282
|
generateConfigHash(config) {
|
|
283
283
|
const configString = JSON.stringify(config, Object.keys(config).sort());
|
|
284
|
-
return
|
|
285
|
-
.createHash("sha256")
|
|
284
|
+
return createHash("sha256")
|
|
286
285
|
.update(configString)
|
|
287
286
|
.digest("hex")
|
|
288
287
|
.substring(0, 8);
|
package/dist/index.d.ts
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
*/
|
|
9
9
|
import { AIProviderFactory } from "./core/factory.js";
|
|
10
10
|
export { AIProviderFactory };
|
|
11
|
-
export type { AIProvider, AIProviderName,
|
|
11
|
+
export type { AIProvider, AIProviderName, AIModelProviderConfig, StreamingOptions, ProviderAttempt, SupportedModelName, } from "./types/index.js";
|
|
12
12
|
export type { GenerateOptions, GenerateResult, EnhancedProvider, } from "./types/generateTypes.js";
|
|
13
13
|
export type { ToolContext } from "./sdk/toolRegistration.js";
|
|
14
14
|
export { validateTool } from "./sdk/toolRegistration.js";
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* NeuroLink Config Manager with Backup/Restore System
|
|
3
3
|
* Industry standard configuration management with safety mechanisms
|
|
4
4
|
*/
|
|
5
|
-
import type { NeuroLinkConfig, ProviderConfig, BackupInfo, ConfigValidationResult, ConfigUpdateOptions } from "
|
|
5
|
+
import type { NeuroLinkConfig, ProviderConfig, BackupInfo, ConfigValidationResult, ConfigUpdateOptions } from "../types/configTypes.js";
|
|
6
6
|
/**
|
|
7
7
|
* Enhanced Config Manager with automatic backup/restore capabilities
|
|
8
8
|
*/
|
|
@@ -3,10 +3,10 @@
|
|
|
3
3
|
* Industry standard configuration management with safety mechanisms
|
|
4
4
|
*/
|
|
5
5
|
import { promises as fs } from "fs";
|
|
6
|
-
import
|
|
7
|
-
import
|
|
6
|
+
import { join } from "path";
|
|
7
|
+
import { createHash } from "crypto";
|
|
8
8
|
import { logger } from "../utils/logger.js";
|
|
9
|
-
import { DEFAULT_CONFIG } from "
|
|
9
|
+
import { DEFAULT_CONFIG } from "../types/configTypes.js";
|
|
10
10
|
const { readFile, writeFile, readdir, mkdir, unlink, access } = fs;
|
|
11
11
|
/**
|
|
12
12
|
* Enhanced Config Manager with automatic backup/restore capabilities
|
|
@@ -73,7 +73,7 @@ export class NeuroLinkConfigManager {
|
|
|
73
73
|
await this.ensureBackupDirectory();
|
|
74
74
|
const timestamp = new Date().toISOString().replace(/[:.]/g, "-");
|
|
75
75
|
const backupFilename = `neurolink-config-${timestamp}.js`;
|
|
76
|
-
const backupPath =
|
|
76
|
+
const backupPath = join(this.backupDir, backupFilename);
|
|
77
77
|
const currentConfig = await this.loadConfig();
|
|
78
78
|
const configHash = this.generateConfigHash(currentConfig);
|
|
79
79
|
const backupMetadata = {
|
|
@@ -105,7 +105,7 @@ export default ${JSON.stringify(currentConfig, null, 2)};`;
|
|
|
105
105
|
const backups = [];
|
|
106
106
|
for (const file of backupFiles) {
|
|
107
107
|
try {
|
|
108
|
-
const filePath =
|
|
108
|
+
const filePath = join(this.backupDir, file);
|
|
109
109
|
const content = await readFile(filePath, "utf-8");
|
|
110
110
|
const metadata = this.extractMetadataFromBackup(content);
|
|
111
111
|
const config = this.extractConfigFromBackup(content);
|
|
@@ -131,7 +131,7 @@ export default ${JSON.stringify(currentConfig, null, 2)};`;
|
|
|
131
131
|
* Restore from specific backup
|
|
132
132
|
*/
|
|
133
133
|
async restoreFromBackup(backupFilename) {
|
|
134
|
-
const backupPath =
|
|
134
|
+
const backupPath = join(this.backupDir, backupFilename);
|
|
135
135
|
// Create backup of current config before restore
|
|
136
136
|
await this.createBackup("pre-restore");
|
|
137
137
|
try {
|
|
@@ -281,8 +281,7 @@ export default ${JSON.stringify(currentConfig, null, 2)};`;
|
|
|
281
281
|
}
|
|
282
282
|
generateConfigHash(config) {
|
|
283
283
|
const configString = JSON.stringify(config, Object.keys(config).sort());
|
|
284
|
-
return
|
|
285
|
-
.createHash("sha256")
|
|
284
|
+
return createHash("sha256")
|
|
286
285
|
.update(configString)
|
|
287
286
|
.digest("hex")
|
|
288
287
|
.substring(0, 8);
|
package/dist/lib/index.d.ts
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
*/
|
|
9
9
|
import { AIProviderFactory } from "./core/factory.js";
|
|
10
10
|
export { AIProviderFactory };
|
|
11
|
-
export type { AIProvider, AIProviderName,
|
|
11
|
+
export type { AIProvider, AIProviderName, AIModelProviderConfig, StreamingOptions, ProviderAttempt, SupportedModelName, } from "./types/index.js";
|
|
12
12
|
export type { GenerateOptions, GenerateResult, EnhancedProvider, } from "./types/generateTypes.js";
|
|
13
13
|
export type { ToolContext } from "./sdk/toolRegistration.js";
|
|
14
14
|
export { validateTool } from "./sdk/toolRegistration.js";
|
|
@@ -3,6 +3,7 @@ import { BedrockClient, ListFoundationModelsCommand, } from "@aws-sdk/client-bed
|
|
|
3
3
|
import { BaseProvider } from "../core/baseProvider.js";
|
|
4
4
|
import { logger } from "../utils/logger.js";
|
|
5
5
|
import { convertZodToJsonSchema } from "../utils/schemaConversion.js";
|
|
6
|
+
// Bedrock-specific types now imported from ../types/providerSpecific.js
|
|
6
7
|
export class AmazonBedrockProvider extends BaseProvider {
|
|
7
8
|
bedrockClient;
|
|
8
9
|
conversationHistory = [];
|
|
@@ -8,6 +8,7 @@ import { AuthenticationError, NetworkError, ProviderError, RateLimitError, } fro
|
|
|
8
8
|
import { DEFAULT_MAX_STEPS } from "../core/constants.js";
|
|
9
9
|
import { streamAnalyticsCollector } from "../core/streamAnalytics.js";
|
|
10
10
|
import { buildMessagesArray } from "../utils/messageBuilder.js";
|
|
11
|
+
// Google AI Live API types now imported from ../types/providerSpecific.js
|
|
11
12
|
// Create Google GenAI client
|
|
12
13
|
async function createGoogleGenAIClient(apiKey) {
|
|
13
14
|
const mod = await import("@google/genai");
|
|
@@ -15,28 +15,3 @@ export { OllamaProvider as Ollama } from "./ollama.js";
|
|
|
15
15
|
export { MistralProvider as MistralAI } from "./mistral.js";
|
|
16
16
|
export { LiteLLMProvider as LiteLLM } from "./litellm.js";
|
|
17
17
|
export type { AIProvider } from "../types/index.js";
|
|
18
|
-
/**
|
|
19
|
-
* Provider registry for dynamic provider instantiation
|
|
20
|
-
*/
|
|
21
|
-
export declare const PROVIDERS: {
|
|
22
|
-
readonly vertex: "GoogleVertexAI";
|
|
23
|
-
readonly bedrock: "AmazonBedrock";
|
|
24
|
-
readonly sagemaker: "AmazonSageMaker";
|
|
25
|
-
readonly openai: "OpenAI";
|
|
26
|
-
readonly "openai-compatible": "OpenAICompatible";
|
|
27
|
-
readonly anthropic: "AnthropicProvider";
|
|
28
|
-
readonly azure: "AzureOpenAIProvider";
|
|
29
|
-
readonly "google-ai": "GoogleAIStudio";
|
|
30
|
-
readonly huggingface: "HuggingFace";
|
|
31
|
-
readonly ollama: "Ollama";
|
|
32
|
-
readonly mistral: "MistralAI";
|
|
33
|
-
readonly litellm: "LiteLLM";
|
|
34
|
-
};
|
|
35
|
-
/**
|
|
36
|
-
* Type for valid provider names
|
|
37
|
-
*/
|
|
38
|
-
export type ProviderName = keyof typeof PROVIDERS;
|
|
39
|
-
/**
|
|
40
|
-
* List of all available provider names
|
|
41
|
-
*/
|
|
42
|
-
export declare const AVAILABLE_PROVIDERS: ProviderName[];
|
|
@@ -14,24 +14,3 @@ export { HuggingFaceProvider as HuggingFace } from "./huggingFace.js";
|
|
|
14
14
|
export { OllamaProvider as Ollama } from "./ollama.js";
|
|
15
15
|
export { MistralProvider as MistralAI } from "./mistral.js";
|
|
16
16
|
export { LiteLLMProvider as LiteLLM } from "./litellm.js";
|
|
17
|
-
/**
|
|
18
|
-
* Provider registry for dynamic provider instantiation
|
|
19
|
-
*/
|
|
20
|
-
export const PROVIDERS = {
|
|
21
|
-
vertex: "GoogleVertexAI",
|
|
22
|
-
bedrock: "AmazonBedrock",
|
|
23
|
-
sagemaker: "AmazonSageMaker",
|
|
24
|
-
openai: "OpenAI",
|
|
25
|
-
"openai-compatible": "OpenAICompatible",
|
|
26
|
-
anthropic: "AnthropicProvider",
|
|
27
|
-
azure: "AzureOpenAIProvider",
|
|
28
|
-
"google-ai": "GoogleAIStudio",
|
|
29
|
-
huggingface: "HuggingFace",
|
|
30
|
-
ollama: "Ollama",
|
|
31
|
-
mistral: "MistralAI",
|
|
32
|
-
litellm: "LiteLLM",
|
|
33
|
-
};
|
|
34
|
-
/**
|
|
35
|
-
* List of all available provider names
|
|
36
|
-
*/
|
|
37
|
-
export const AVAILABLE_PROVIDERS = Object.keys(PROVIDERS);
|
|
@@ -33,6 +33,7 @@ const getOpenAICompatibleConfig = () => {
|
|
|
33
33
|
const getDefaultOpenAICompatibleModel = () => {
|
|
34
34
|
return process.env.OPENAI_COMPATIBLE_MODEL || undefined;
|
|
35
35
|
};
|
|
36
|
+
// ModelsResponse type now imported from ../types/providerSpecific.js
|
|
36
37
|
/**
|
|
37
38
|
* OpenAI Compatible Provider - BaseProvider Implementation
|
|
38
39
|
* Provides access to one of the OpenAI-compatible endpoint (OpenRouter, vLLM, LiteLLM, etc.)
|
package/dist/lib/types/cli.d.ts
CHANGED
|
@@ -6,9 +6,9 @@ import type { AnalyticsData, TokenUsage } from "./analytics.js";
|
|
|
6
6
|
import type { EvaluationData } from "../index.js";
|
|
7
7
|
import type { ToolCall, ToolResult } from "./tools.js";
|
|
8
8
|
/**
|
|
9
|
-
* Base command arguments
|
|
9
|
+
* Base command arguments type
|
|
10
10
|
*/
|
|
11
|
-
export
|
|
11
|
+
export type BaseCommandArgs = {
|
|
12
12
|
/** Enable debug output */
|
|
13
13
|
debug?: boolean;
|
|
14
14
|
/** Output format */
|
|
@@ -19,11 +19,11 @@ export interface BaseCommandArgs {
|
|
|
19
19
|
quiet?: boolean;
|
|
20
20
|
/** Index signature to allow additional properties */
|
|
21
21
|
[key: string]: unknown;
|
|
22
|
-
}
|
|
22
|
+
};
|
|
23
23
|
/**
|
|
24
24
|
* Generate command arguments
|
|
25
25
|
*/
|
|
26
|
-
export
|
|
26
|
+
export type GenerateCommandArgs = BaseCommandArgs & {
|
|
27
27
|
/** Input text or prompt */
|
|
28
28
|
input?: string;
|
|
29
29
|
/** AI provider to use */
|
|
@@ -48,11 +48,11 @@ export interface GenerateCommandArgs extends BaseCommandArgs {
|
|
|
48
48
|
maxSteps?: number;
|
|
49
49
|
/** Output file */
|
|
50
50
|
output?: string;
|
|
51
|
-
}
|
|
51
|
+
};
|
|
52
52
|
/**
|
|
53
53
|
* Stream command arguments
|
|
54
54
|
*/
|
|
55
|
-
export
|
|
55
|
+
export type StreamCommandArgs = BaseCommandArgs & {
|
|
56
56
|
/** Input text or prompt */
|
|
57
57
|
input?: string;
|
|
58
58
|
/** AI provider to use */
|
|
@@ -67,11 +67,11 @@ export interface StreamCommandArgs extends BaseCommandArgs {
|
|
|
67
67
|
maxTokens?: number;
|
|
68
68
|
/** Disable tools */
|
|
69
69
|
disableTools?: boolean;
|
|
70
|
-
}
|
|
70
|
+
};
|
|
71
71
|
/**
|
|
72
72
|
* Batch command arguments
|
|
73
73
|
*/
|
|
74
|
-
export
|
|
74
|
+
export type BatchCommandArgs = BaseCommandArgs & {
|
|
75
75
|
/** Input file path */
|
|
76
76
|
file?: string;
|
|
77
77
|
/** AI provider to use */
|
|
@@ -90,11 +90,11 @@ export interface BatchCommandArgs extends BaseCommandArgs {
|
|
|
90
90
|
output?: string;
|
|
91
91
|
/** Disable tools */
|
|
92
92
|
disableTools?: boolean;
|
|
93
|
-
}
|
|
93
|
+
};
|
|
94
94
|
/**
|
|
95
95
|
* MCP command arguments - Enhanced with transport and server management
|
|
96
96
|
*/
|
|
97
|
-
export
|
|
97
|
+
export type MCPCommandArgs = BaseCommandArgs & {
|
|
98
98
|
/** MCP server name */
|
|
99
99
|
server?: string;
|
|
100
100
|
/** MCP server name (alias for server) */
|
|
@@ -135,11 +135,11 @@ export interface MCPCommandArgs extends BaseCommandArgs {
|
|
|
135
135
|
source?: string;
|
|
136
136
|
/** Connection timeout */
|
|
137
137
|
timeout?: number;
|
|
138
|
-
}
|
|
138
|
+
};
|
|
139
139
|
/**
|
|
140
140
|
* Models command arguments - Enhanced for model management
|
|
141
141
|
*/
|
|
142
|
-
export
|
|
142
|
+
export type ModelsCommandArgs = Omit<BaseCommandArgs, "format"> & {
|
|
143
143
|
/** AI provider to query (single or array) */
|
|
144
144
|
provider?: string | string[];
|
|
145
145
|
/** Model category filter */
|
|
@@ -208,11 +208,11 @@ export interface ModelsCommandArgs extends Omit<BaseCommandArgs, "format"> {
|
|
|
208
208
|
resolve?: boolean;
|
|
209
209
|
/** Maximum tokens filter */
|
|
210
210
|
maxTokens?: number;
|
|
211
|
-
}
|
|
211
|
+
};
|
|
212
212
|
/**
|
|
213
213
|
* Ollama command arguments
|
|
214
214
|
*/
|
|
215
|
-
export
|
|
215
|
+
export type OllamaCommandArgs = BaseCommandArgs & {
|
|
216
216
|
/** Ollama model name */
|
|
217
217
|
model?: string;
|
|
218
218
|
/** List available models */
|
|
@@ -223,11 +223,11 @@ export interface OllamaCommandArgs extends BaseCommandArgs {
|
|
|
223
223
|
remove?: boolean;
|
|
224
224
|
/** Show model information */
|
|
225
225
|
show?: boolean;
|
|
226
|
-
}
|
|
226
|
+
};
|
|
227
227
|
/**
|
|
228
228
|
* SageMaker command arguments
|
|
229
229
|
*/
|
|
230
|
-
export
|
|
230
|
+
export type SageMakerCommandArgs = BaseCommandArgs & {
|
|
231
231
|
/** SageMaker endpoint name */
|
|
232
232
|
endpoint?: string;
|
|
233
233
|
/** Model name for the endpoint */
|
|
@@ -258,20 +258,33 @@ export interface SageMakerCommandArgs extends BaseCommandArgs {
|
|
|
258
258
|
region?: string;
|
|
259
259
|
/** Force operation without confirmation */
|
|
260
260
|
force?: boolean;
|
|
261
|
-
}
|
|
261
|
+
};
|
|
262
|
+
/**
|
|
263
|
+
* Secure configuration container that avoids process.env exposure
|
|
264
|
+
*/
|
|
265
|
+
export type SecureConfiguration = {
|
|
266
|
+
accessKeyId: string;
|
|
267
|
+
secretAccessKey: string;
|
|
268
|
+
region: string;
|
|
269
|
+
endpointName: string;
|
|
270
|
+
timeout: number;
|
|
271
|
+
maxRetries: number;
|
|
272
|
+
sessionId: string;
|
|
273
|
+
createdAt: number;
|
|
274
|
+
};
|
|
262
275
|
/**
|
|
263
276
|
* Provider status command arguments
|
|
264
277
|
*/
|
|
265
|
-
export
|
|
278
|
+
export type ProviderStatusArgs = BaseCommandArgs & {
|
|
266
279
|
/** Specific provider to check */
|
|
267
280
|
provider?: string;
|
|
268
281
|
/** Check all providers */
|
|
269
282
|
all?: boolean;
|
|
270
|
-
}
|
|
283
|
+
};
|
|
271
284
|
/**
|
|
272
285
|
* CLI command result
|
|
273
286
|
*/
|
|
274
|
-
export
|
|
287
|
+
export type CommandResult = {
|
|
275
288
|
/** Command success status */
|
|
276
289
|
success: boolean;
|
|
277
290
|
/** Result data */
|
|
@@ -286,11 +299,11 @@ export interface CommandResult {
|
|
|
286
299
|
timestamp?: number;
|
|
287
300
|
command?: string;
|
|
288
301
|
};
|
|
289
|
-
}
|
|
302
|
+
};
|
|
290
303
|
/**
|
|
291
304
|
* Generate command result
|
|
292
305
|
*/
|
|
293
|
-
export
|
|
306
|
+
export type GenerateResult = CommandResult & {
|
|
294
307
|
content: string;
|
|
295
308
|
provider?: string;
|
|
296
309
|
model?: string;
|
|
@@ -312,25 +325,25 @@ export interface GenerateResult extends CommandResult {
|
|
|
312
325
|
name: string;
|
|
313
326
|
description: string;
|
|
314
327
|
}>;
|
|
315
|
-
}
|
|
328
|
+
};
|
|
316
329
|
/**
|
|
317
330
|
* Stream result chunk
|
|
318
331
|
*/
|
|
319
|
-
export
|
|
332
|
+
export type StreamChunk = {
|
|
320
333
|
content?: string;
|
|
321
334
|
delta?: string;
|
|
322
335
|
done?: boolean;
|
|
323
336
|
metadata?: UnknownRecord;
|
|
324
|
-
}
|
|
337
|
+
};
|
|
325
338
|
/**
|
|
326
339
|
* CLI output formatting options
|
|
327
340
|
*/
|
|
328
|
-
export
|
|
329
|
-
format: "text" | "json" | "table";
|
|
341
|
+
export type OutputOptions = {
|
|
342
|
+
format: "text" | "json" | "table" | "yaml";
|
|
330
343
|
pretty?: boolean;
|
|
331
344
|
color?: boolean;
|
|
332
345
|
compact?: boolean;
|
|
333
|
-
}
|
|
346
|
+
};
|
|
334
347
|
/**
|
|
335
348
|
* Command handler function type
|
|
336
349
|
*/
|
|
@@ -338,7 +351,7 @@ export type CommandHandler<TArgs = BaseCommandArgs, TResult = CommandResult> = (
|
|
|
338
351
|
/**
|
|
339
352
|
* Command definition
|
|
340
353
|
*/
|
|
341
|
-
export
|
|
354
|
+
export type CommandDefinition<TArgs = BaseCommandArgs> = {
|
|
342
355
|
name: string;
|
|
343
356
|
description: string;
|
|
344
357
|
aliases?: string[];
|
|
@@ -351,38 +364,38 @@ export interface CommandDefinition<TArgs = BaseCommandArgs> {
|
|
|
351
364
|
};
|
|
352
365
|
};
|
|
353
366
|
handler: CommandHandler<TArgs>;
|
|
354
|
-
}
|
|
367
|
+
};
|
|
355
368
|
/**
|
|
356
369
|
* CLI context
|
|
357
370
|
*/
|
|
358
|
-
export
|
|
371
|
+
export type CLIContext = {
|
|
359
372
|
cwd: string;
|
|
360
373
|
args: string[];
|
|
361
374
|
env: NodeJS.ProcessEnv;
|
|
362
375
|
exitCode?: number;
|
|
363
|
-
}
|
|
376
|
+
};
|
|
364
377
|
/**
|
|
365
378
|
* Color mapping for CLI output
|
|
366
379
|
*/
|
|
367
|
-
export
|
|
380
|
+
export type ColorMap = {
|
|
368
381
|
[severity: string]: {
|
|
369
382
|
color: string;
|
|
370
383
|
symbol?: string;
|
|
371
384
|
};
|
|
372
|
-
}
|
|
385
|
+
};
|
|
373
386
|
/**
|
|
374
387
|
* Display severity colors (for evaluation display)
|
|
375
388
|
*/
|
|
376
|
-
export
|
|
389
|
+
export type SeverityColors = {
|
|
377
390
|
[key: string]: {
|
|
378
391
|
color: string;
|
|
379
392
|
symbol: string;
|
|
380
393
|
};
|
|
381
|
-
}
|
|
394
|
+
};
|
|
382
395
|
/**
|
|
383
396
|
* JSON output structure
|
|
384
397
|
*/
|
|
385
|
-
export
|
|
398
|
+
export type JSONOutput = {
|
|
386
399
|
success: boolean;
|
|
387
400
|
data?: JsonValue;
|
|
388
401
|
error?: string;
|
|
@@ -391,13 +404,13 @@ export interface JSONOutput {
|
|
|
391
404
|
command: string;
|
|
392
405
|
version?: string;
|
|
393
406
|
};
|
|
394
|
-
}
|
|
407
|
+
};
|
|
395
408
|
/**
|
|
396
409
|
* Console override for quiet mode
|
|
397
410
|
*/
|
|
398
|
-
export
|
|
411
|
+
export type ConsoleOverride = {
|
|
399
412
|
[method: string]: (() => void) | undefined;
|
|
400
|
-
}
|
|
413
|
+
};
|
|
401
414
|
/**
|
|
402
415
|
* Type guard for generate result
|
|
403
416
|
*/
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* NeuroLink Configuration Types
|
|
3
|
-
*
|
|
3
|
+
* Centralized configuration type definitions following the established architecture pattern
|
|
4
4
|
*/
|
|
5
5
|
/**
|
|
6
|
-
* Main NeuroLink configuration
|
|
6
|
+
* Main NeuroLink configuration type
|
|
7
7
|
*/
|
|
8
|
-
export
|
|
8
|
+
export type NeuroLinkConfig = {
|
|
9
9
|
providers?: Record<string, ProviderConfig>;
|
|
10
10
|
performance?: PerformanceConfig;
|
|
11
11
|
analytics?: AnalyticsConfig;
|
|
@@ -13,11 +13,11 @@ export interface NeuroLinkConfig {
|
|
|
13
13
|
lastUpdated?: number;
|
|
14
14
|
configVersion?: string;
|
|
15
15
|
[key: string]: unknown;
|
|
16
|
-
}
|
|
16
|
+
};
|
|
17
17
|
/**
|
|
18
18
|
* Provider-specific configuration
|
|
19
19
|
*/
|
|
20
|
-
export
|
|
20
|
+
export type ProviderConfig = {
|
|
21
21
|
model?: string;
|
|
22
22
|
available?: boolean;
|
|
23
23
|
lastCheck?: number;
|
|
@@ -30,32 +30,32 @@ export interface ProviderConfig {
|
|
|
30
30
|
costPerToken?: number;
|
|
31
31
|
features?: string[];
|
|
32
32
|
[key: string]: unknown;
|
|
33
|
-
}
|
|
33
|
+
};
|
|
34
34
|
/**
|
|
35
35
|
* Performance and caching configuration
|
|
36
36
|
*/
|
|
37
|
-
export
|
|
37
|
+
export type PerformanceConfig = {
|
|
38
38
|
cache?: CacheConfig;
|
|
39
39
|
fallback?: FallbackConfig;
|
|
40
40
|
timeoutMs?: number;
|
|
41
41
|
maxConcurrency?: number;
|
|
42
42
|
retryConfig?: RetryConfig;
|
|
43
|
-
}
|
|
43
|
+
};
|
|
44
44
|
/**
|
|
45
45
|
* Cache configuration
|
|
46
46
|
*/
|
|
47
|
-
export
|
|
47
|
+
export type CacheConfig = {
|
|
48
48
|
enabled?: boolean;
|
|
49
49
|
ttlMs?: number;
|
|
50
50
|
strategy?: "memory" | "writeThrough" | "cacheAside";
|
|
51
51
|
maxSize?: number;
|
|
52
52
|
persistToDisk?: boolean;
|
|
53
53
|
diskPath?: string;
|
|
54
|
-
}
|
|
54
|
+
};
|
|
55
55
|
/**
|
|
56
56
|
* Fallback configuration
|
|
57
57
|
*/
|
|
58
|
-
export
|
|
58
|
+
export type FallbackConfig = {
|
|
59
59
|
enabled?: boolean;
|
|
60
60
|
maxAttempts?: number;
|
|
61
61
|
delayMs?: number;
|
|
@@ -63,22 +63,22 @@ export interface FallbackConfig {
|
|
|
63
63
|
commonResponses?: Record<string, string>;
|
|
64
64
|
localFallbackPath?: string;
|
|
65
65
|
degradedMode?: boolean;
|
|
66
|
-
}
|
|
66
|
+
};
|
|
67
67
|
/**
|
|
68
68
|
* Retry configuration
|
|
69
69
|
*/
|
|
70
|
-
export
|
|
70
|
+
export type RetryConfig = {
|
|
71
71
|
enabled?: boolean;
|
|
72
72
|
maxAttempts?: number;
|
|
73
73
|
baseDelayMs?: number;
|
|
74
74
|
maxDelayMs?: number;
|
|
75
75
|
exponentialBackoff?: boolean;
|
|
76
76
|
retryConditions?: string[];
|
|
77
|
-
}
|
|
77
|
+
};
|
|
78
78
|
/**
|
|
79
79
|
* Analytics configuration
|
|
80
80
|
*/
|
|
81
|
-
export
|
|
81
|
+
export type AnalyticsConfig = {
|
|
82
82
|
enabled?: boolean;
|
|
83
83
|
trackTokens?: boolean;
|
|
84
84
|
trackCosts?: boolean;
|
|
@@ -90,11 +90,11 @@ export interface AnalyticsConfig {
|
|
|
90
90
|
days?: number;
|
|
91
91
|
maxEntries?: number;
|
|
92
92
|
};
|
|
93
|
-
}
|
|
93
|
+
};
|
|
94
94
|
/**
|
|
95
95
|
* Tool configuration
|
|
96
96
|
*/
|
|
97
|
-
export
|
|
97
|
+
export type ToolConfig = {
|
|
98
98
|
/** Whether built-in tools should be disabled */
|
|
99
99
|
disableBuiltinTools?: boolean;
|
|
100
100
|
/** Whether custom tools are allowed */
|
|
@@ -103,20 +103,20 @@ export interface ToolConfig {
|
|
|
103
103
|
maxToolsPerProvider?: number;
|
|
104
104
|
/** Whether MCP tools should be enabled */
|
|
105
105
|
enableMCPTools?: boolean;
|
|
106
|
-
}
|
|
106
|
+
};
|
|
107
107
|
/**
|
|
108
108
|
* Backup metadata information
|
|
109
109
|
*/
|
|
110
|
-
export
|
|
110
|
+
export type BackupInfo = {
|
|
111
111
|
filename: string;
|
|
112
112
|
path: string;
|
|
113
113
|
metadata: BackupMetadata;
|
|
114
114
|
config: NeuroLinkConfig;
|
|
115
|
-
}
|
|
115
|
+
};
|
|
116
116
|
/**
|
|
117
117
|
* Backup metadata
|
|
118
118
|
*/
|
|
119
|
-
export
|
|
119
|
+
export type BackupMetadata = {
|
|
120
120
|
reason: string;
|
|
121
121
|
timestamp: number;
|
|
122
122
|
version: string;
|
|
@@ -124,26 +124,26 @@ export interface BackupMetadata {
|
|
|
124
124
|
hash?: string;
|
|
125
125
|
size?: number;
|
|
126
126
|
createdBy?: string;
|
|
127
|
-
}
|
|
127
|
+
};
|
|
128
128
|
/**
|
|
129
129
|
* Configuration validation result
|
|
130
130
|
*/
|
|
131
|
-
export
|
|
131
|
+
export type ConfigValidationResult = {
|
|
132
132
|
valid: boolean;
|
|
133
133
|
errors: string[];
|
|
134
134
|
warnings: string[];
|
|
135
135
|
suggestions: string[];
|
|
136
|
-
}
|
|
136
|
+
};
|
|
137
137
|
/**
|
|
138
138
|
* Configuration update options
|
|
139
139
|
*/
|
|
140
|
-
export
|
|
140
|
+
export type ConfigUpdateOptions = {
|
|
141
141
|
createBackup?: boolean;
|
|
142
142
|
validate?: boolean;
|
|
143
143
|
merge?: boolean;
|
|
144
144
|
reason?: string;
|
|
145
145
|
silent?: boolean;
|
|
146
|
-
}
|
|
146
|
+
};
|
|
147
147
|
/**
|
|
148
148
|
* Default configuration values
|
|
149
149
|
*/
|