@juspay/neurolink 7.41.2 → 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 +2 -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/{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 +2 -2
- package/dist/lib/types/streamTypes.d.ts +2 -2
- package/dist/lib/utils/toolUtils.d.ts +1 -1
- 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/providers.d.ts +2 -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
|
@@ -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";
|
|
@@ -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
|
*/
|
|
@@ -6,9 +6,10 @@ export * from "./tools.js";
|
|
|
6
6
|
export * from "./providers.js";
|
|
7
7
|
export * from "./cli.js";
|
|
8
8
|
export * from "./taskClassificationTypes.js";
|
|
9
|
+
export type { NeuroLinkConfig, PerformanceConfig, CacheConfig, FallbackConfig, RetryConfig, AnalyticsConfig, ToolConfig, BackupInfo, BackupMetadata, ConfigValidationResult, ConfigUpdateOptions, } from "./configTypes.js";
|
|
9
10
|
export type { Unknown, UnknownRecord, UnknownArray, JsonValue, JsonObject, JsonArray, ErrorInfo, Result, FunctionParameters, } from "./common.js";
|
|
10
11
|
export type { ToolArgs, ToolContext, ToolResult, ToolDefinition, SimpleTool, AvailableTool, ToolExecution, } from "./tools.js";
|
|
11
|
-
export type { AISDKModel, ProviderError,
|
|
12
|
+
export type { AISDKModel, ProviderError, AIModelProviderConfig, } from "./providers.js";
|
|
12
13
|
export type { BaseCommandArgs, GenerateCommandArgs, MCPCommandArgs, ModelsCommandArgs, CommandResult, GenerateResult, StreamChunk, } from "./cli.js";
|
|
13
14
|
export type { TaskType, TaskClassification, ClassificationScores, ClassificationStats, ClassificationValidation, } from "./taskClassificationTypes.js";
|
|
14
15
|
export type { MCPTransportType, MCPServerConnectionStatus, MCPServerCategory, MCPServerStatus, MCPDiscoveredServer, MCPConnectedServer, MCPToolInfo, MCPExecutableTool, MCPServerMetadata, MCPToolMetadata, MCPServerRegistryEntry, } from "./mcpTypes.js";
|
|
@@ -268,7 +268,7 @@ export type ProviderCapabilities = {
|
|
|
268
268
|
/**
|
|
269
269
|
* Provider configuration specifying provider and its available models (from core types)
|
|
270
270
|
*/
|
|
271
|
-
export type
|
|
271
|
+
export type AIModelProviderConfig = {
|
|
272
272
|
provider: AIProviderName;
|
|
273
273
|
models: SupportedModelName[];
|
|
274
274
|
};
|
|
@@ -588,4 +588,4 @@ export declare const ModelAliases: {
|
|
|
588
588
|
/**
|
|
589
589
|
* Default provider configurations
|
|
590
590
|
*/
|
|
591
|
-
export declare const DEFAULT_PROVIDER_CONFIGS:
|
|
591
|
+
export declare const DEFAULT_PROVIDER_CONFIGS: AIModelProviderConfig[];
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { Tool } from "ai";
|
|
2
2
|
import type { ValidationSchema, StandardRecord } from "./typeAliases.js";
|
|
3
|
-
import type {
|
|
3
|
+
import type { AIModelProviderConfig } from "./providers.js";
|
|
4
4
|
import type { TextContent, ImageContent } from "./content.js";
|
|
5
5
|
import type { AIProviderName, AnalyticsData } from "../types/index.js";
|
|
6
6
|
import type { TokenUsage } from "./analytics.js";
|
|
@@ -38,7 +38,7 @@ export type StreamingMetadata = {
|
|
|
38
38
|
* Options for AI requests with unified provider configuration
|
|
39
39
|
*/
|
|
40
40
|
export type StreamingOptions = {
|
|
41
|
-
providers:
|
|
41
|
+
providers: AIModelProviderConfig[];
|
|
42
42
|
temperature?: number;
|
|
43
43
|
maxTokens?: number;
|
|
44
44
|
systemPrompt?: string;
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*
|
|
4
4
|
* Consolidates environment variable access to avoid scattered process.env calls
|
|
5
5
|
*/
|
|
6
|
-
import type { ToolConfig } from "../
|
|
6
|
+
import type { ToolConfig } from "../types/configTypes.js";
|
|
7
7
|
/**
|
|
8
8
|
* Check if built-in tools should be disabled
|
|
9
9
|
* Centralized function to replace direct process.env access
|
|
@@ -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
|
*/
|
package/dist/types/index.d.ts
CHANGED
|
@@ -6,9 +6,10 @@ export * from "./tools.js";
|
|
|
6
6
|
export * from "./providers.js";
|
|
7
7
|
export * from "./cli.js";
|
|
8
8
|
export * from "./taskClassificationTypes.js";
|
|
9
|
+
export type { NeuroLinkConfig, PerformanceConfig, CacheConfig, FallbackConfig, RetryConfig, AnalyticsConfig, ToolConfig, BackupInfo, BackupMetadata, ConfigValidationResult, ConfigUpdateOptions, } from "./configTypes.js";
|
|
9
10
|
export type { Unknown, UnknownRecord, UnknownArray, JsonValue, JsonObject, JsonArray, ErrorInfo, Result, FunctionParameters, } from "./common.js";
|
|
10
11
|
export type { ToolArgs, ToolContext, ToolResult, ToolDefinition, SimpleTool, AvailableTool, ToolExecution, } from "./tools.js";
|
|
11
|
-
export type { AISDKModel, ProviderError,
|
|
12
|
+
export type { AISDKModel, ProviderError, AIModelProviderConfig, } from "./providers.js";
|
|
12
13
|
export type { BaseCommandArgs, GenerateCommandArgs, MCPCommandArgs, ModelsCommandArgs, CommandResult, GenerateResult, StreamChunk, } from "./cli.js";
|
|
13
14
|
export type { TaskType, TaskClassification, ClassificationScores, ClassificationStats, ClassificationValidation, } from "./taskClassificationTypes.js";
|
|
14
15
|
export type { MCPTransportType, MCPServerConnectionStatus, MCPServerCategory, MCPServerStatus, MCPDiscoveredServer, MCPConnectedServer, MCPToolInfo, MCPExecutableTool, MCPServerMetadata, MCPToolMetadata, MCPServerRegistryEntry, } from "./mcpTypes.js";
|
|
@@ -268,7 +268,7 @@ export type ProviderCapabilities = {
|
|
|
268
268
|
/**
|
|
269
269
|
* Provider configuration specifying provider and its available models (from core types)
|
|
270
270
|
*/
|
|
271
|
-
export type
|
|
271
|
+
export type AIModelProviderConfig = {
|
|
272
272
|
provider: AIProviderName;
|
|
273
273
|
models: SupportedModelName[];
|
|
274
274
|
};
|
|
@@ -588,4 +588,4 @@ export declare const ModelAliases: {
|
|
|
588
588
|
/**
|
|
589
589
|
* Default provider configurations
|
|
590
590
|
*/
|
|
591
|
-
export declare const DEFAULT_PROVIDER_CONFIGS:
|
|
591
|
+
export declare const DEFAULT_PROVIDER_CONFIGS: AIModelProviderConfig[];
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { Tool } from "ai";
|
|
2
2
|
import type { ValidationSchema, StandardRecord } from "./typeAliases.js";
|
|
3
|
-
import type {
|
|
3
|
+
import type { AIModelProviderConfig } from "./providers.js";
|
|
4
4
|
import type { TextContent, ImageContent } from "./content.js";
|
|
5
5
|
import type { AIProviderName, AnalyticsData } from "../types/index.js";
|
|
6
6
|
import type { TokenUsage } from "./analytics.js";
|
|
@@ -38,7 +38,7 @@ export type StreamingMetadata = {
|
|
|
38
38
|
* Options for AI requests with unified provider configuration
|
|
39
39
|
*/
|
|
40
40
|
export type StreamingOptions = {
|
|
41
|
-
providers:
|
|
41
|
+
providers: AIModelProviderConfig[];
|
|
42
42
|
temperature?: number;
|
|
43
43
|
maxTokens?: number;
|
|
44
44
|
systemPrompt?: string;
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*
|
|
4
4
|
* Consolidates environment variable access to avoid scattered process.env calls
|
|
5
5
|
*/
|
|
6
|
-
import type { ToolConfig } from "../
|
|
6
|
+
import type { ToolConfig } from "../types/configTypes.js";
|
|
7
7
|
/**
|
|
8
8
|
* Check if built-in tools should be disabled
|
|
9
9
|
* Centralized function to replace direct process.env access
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@juspay/neurolink",
|
|
3
|
-
"version": "7.41.
|
|
3
|
+
"version": "7.41.3",
|
|
4
4
|
"description": "Universal AI Development Platform with working MCP integration, multi-provider support, and professional CLI. Built-in tools operational, 58+ external MCP servers discoverable. Connect to filesystem, GitHub, database operations, and more. Build, test, and deploy AI applications with 9 major providers: OpenAI, Anthropic, Google AI, AWS Bedrock, Azure, Hugging Face, Ollama, and Mistral AI.",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "Juspay Technologies",
|