@juspay/neurolink 7.30.0 → 7.30.1

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.
@@ -2,7 +2,7 @@
2
2
  * Conversation Memory Utilities
3
3
  * Handles configuration merging and conversation memory operations
4
4
  */
5
- import { getConversationMemoryDefaults, } from "../config/conversationMemoryConfig.js";
5
+ import { getConversationMemoryDefaults } from "../config/conversationMemoryConfig.js";
6
6
  import { logger } from "./logger.js";
7
7
  /**
8
8
  * Apply conversation memory defaults to user configuration
@@ -1,15 +1,38 @@
1
1
  /**
2
2
  * NeuroLink Unified Logger Utility
3
3
  *
4
- * Centralized logging for the entire NeuroLink ecosystem
5
- * Supports both CLI --debug flag and NEUROLINK_DEBUG environment variable
6
- * Migrated from MCP logging with enhanced features
4
+ * Centralized logging for the entire NeuroLink ecosystem.
5
+ * Provides structured logging with different severity levels and consistent formatting.
6
+ * Supports both CLI --debug flag and NEUROLINK_DEBUG environment variable.
7
+ * Maintains compatibility with MCP logging while providing enhanced features.
8
+ *
9
+ * Features:
10
+ * - Multiple log levels (debug, info, warn, error)
11
+ * - Log history retention with configurable limits
12
+ * - Conditional logging based on environment settings
13
+ * - Structured data support for complex objects
14
+ * - Tabular data display
15
+ */
16
+ /**
17
+ * Represents the available logging severity levels.
18
+ * - debug: Detailed information for debugging purposes
19
+ * - info: General information about system operation
20
+ * - warn: Potential issues that don't prevent operation
21
+ * - error: Critical issues that may cause failures
7
22
  */
8
23
  export type LogLevel = "debug" | "info" | "warn" | "error";
24
+ /**
25
+ * Represents a single log entry in the logging system.
26
+ * Each entry contains metadata about the log event along with the actual message.
27
+ */
9
28
  interface LogEntry {
29
+ /** The severity level of the log entry */
10
30
  level: LogLevel;
31
+ /** The text message to be logged */
11
32
  message: string;
33
+ /** When the log entry was created */
12
34
  timestamp: Date;
35
+ /** Optional additional data associated with the log entry (objects, arrays, etc.) */
13
36
  data?: unknown;
14
37
  }
15
38
  declare class NeuroLinkLogger {
@@ -18,8 +41,33 @@ declare class NeuroLinkLogger {
18
41
  private maxLogs;
19
42
  private isDebugMode;
20
43
  constructor();
44
+ /**
45
+ * Sets the minimum log level that will be processed and output.
46
+ * Log messages with a level lower than this will be ignored.
47
+ *
48
+ * @param level - The minimum log level to process ("debug", "info", "warn", or "error")
49
+ */
21
50
  setLogLevel(level: LogLevel): void;
51
+ /**
52
+ * Determines whether a message with the given log level should be processed.
53
+ * This method considers both the configured log level and the current debug mode.
54
+ *
55
+ * Logic:
56
+ * 1. If not in debug mode, only error messages are allowed
57
+ * 2. If in debug mode, messages at or above the configured log level are allowed
58
+ *
59
+ * @param level - The log level to check
60
+ * @returns True if a message with this level should be logged, false otherwise
61
+ */
22
62
  shouldLog(level: LogLevel): boolean;
63
+ /**
64
+ * Generates a standardized prefix for log messages.
65
+ * The prefix includes a timestamp and the log level in a consistent format.
66
+ *
67
+ * @param timestamp - ISO string representation of the log timestamp
68
+ * @param level - The log level for this message
69
+ * @returns Formatted prefix string like "[2025-08-18T13:45:30.123Z] [NEUROLINK:ERROR]"
70
+ */
23
71
  private getLogPrefix;
24
72
  /**
25
73
  * Outputs a log entry to the console based on the log level.
@@ -30,12 +78,64 @@ declare class NeuroLinkLogger {
30
78
  * @param data - Optional additional data to log.
31
79
  */
32
80
  private outputToConsole;
81
+ /**
82
+ * Core internal logging method that handles:
83
+ * 1. Creating log entries with consistent format
84
+ * 2. Storing entries in the log history
85
+ * 3. Managing log rotation to prevent memory issues
86
+ * 4. Outputting formatted logs to the console
87
+ *
88
+ * This is the central method called by all specific logging methods (debug, info, etc.)
89
+ *
90
+ * @param level - The severity level for this log entry
91
+ * @param message - The message text to log
92
+ * @param data - Optional additional context data to include
93
+ */
33
94
  private log;
95
+ /**
96
+ * Logs a message at the debug level.
97
+ * Used for detailed troubleshooting information.
98
+ *
99
+ * @param message - The message to log
100
+ * @param data - Optional additional context data
101
+ */
34
102
  debug(message: string, data?: unknown): void;
103
+ /**
104
+ * Logs a message at the info level.
105
+ * Used for general information about system operation.
106
+ *
107
+ * @param message - The message to log
108
+ * @param data - Optional additional context data
109
+ */
35
110
  info(message: string, data?: unknown): void;
111
+ /**
112
+ * Logs a message at the warn level.
113
+ * Used for potentially problematic situations that don't prevent operation.
114
+ *
115
+ * @param message - The message to log
116
+ * @param data - Optional additional context data
117
+ */
36
118
  warn(message: string, data?: unknown): void;
119
+ /**
120
+ * Logs a message at the error level.
121
+ * Used for critical issues that may cause failures.
122
+ *
123
+ * @param message - The message to log
124
+ * @param data - Optional additional context data
125
+ */
37
126
  error(message: string, data?: unknown): void;
127
+ /**
128
+ * Retrieves stored log entries, optionally filtered by log level.
129
+ * Returns a copy of the log entries to prevent external modification.
130
+ *
131
+ * @param level - Optional log level to filter by
132
+ * @returns Array of log entries, either all or filtered by level
133
+ */
38
134
  getLogs(level?: LogLevel): LogEntry[];
135
+ /**
136
+ * Removes all stored log entries.
137
+ * Useful for testing or when log history is no longer needed.
138
+ */
39
139
  clearLogs(): void;
40
140
  /**
41
141
  * Logs messages unconditionally using `console.log`.
@@ -44,16 +144,48 @@ declare class NeuroLinkLogger {
44
144
  * It bypasses the structured logging mechanism and should only be used when
45
145
  * unstructured, unconditional logging is required.
46
146
  *
147
+ * Use with caution in production environments as it outputs to the console
148
+ * regardless of the current log level or debug mode settings.
149
+ *
150
+ * Use cases:
151
+ * - Critical system information that must always be visible
152
+ * - Status messages during initialization before logging is fully configured
153
+ * - Debugging in environments where normal logging might be suppressed
154
+ *
47
155
  * @param args - The arguments to log. These are passed directly to `console.log`.
48
156
  */
49
157
  always(...args: unknown[]): void;
50
158
  /**
51
159
  * Displays tabular data unconditionally using `console.table`.
52
160
  *
53
- * @param data - The data to display in table format
161
+ * Similar to the `always` method, this bypasses log level checks and
162
+ * will display data regardless of current logging settings.
163
+ *
164
+ * Important differences from other logging methods:
165
+ * - Does NOT store entries in the log history
166
+ * - Does NOT use the structured logging format with timestamps and prefixes
167
+ * - Outputs directly to console without additional formatting
168
+ *
169
+ * Particularly useful for:
170
+ * - Displaying structured data in a readable format during debugging
171
+ * - Showing configuration options and their current values
172
+ * - Presenting comparison data between different system states
173
+ * - Performance metrics and timing data
174
+ *
175
+ * @param data - The data to display in table format. Can be an array of objects or an object with key-value pairs.
54
176
  */
55
177
  table(data: unknown): void;
56
178
  }
179
+ /**
180
+ * Main unified logger export that provides a simplified API for logging.
181
+ * This is the primary interface that should be used by application code.
182
+ *
183
+ * Features:
184
+ * - Convenient logging methods (debug, info, warn, error)
185
+ * - Unconditional logging (always, table)
186
+ * - Log level control and configuration
187
+ * - Log history management
188
+ */
57
189
  export declare const logger: {
58
190
  debug: (...args: unknown[]) => void;
59
191
  info: (...args: unknown[]) => void;
@@ -65,11 +197,39 @@ export declare const logger: {
65
197
  getLogs: (level?: LogLevel) => LogEntry[];
66
198
  clearLogs: () => void;
67
199
  };
200
+ /**
201
+ * MCP compatibility exports - all use the same unified logger instance.
202
+ * These exports maintain backward compatibility with code that expects
203
+ * separate loggers for different MCP components, while actually using
204
+ * the same underlying logger instance.
205
+ */
68
206
  export declare const mcpLogger: NeuroLinkLogger;
69
207
  export declare const autoDiscoveryLogger: NeuroLinkLogger;
70
208
  export declare const registryLogger: NeuroLinkLogger;
71
209
  export declare const unifiedRegistryLogger: NeuroLinkLogger;
210
+ /**
211
+ * Sets the global log level for all MCP-related logging.
212
+ * This function provides a convenient way to adjust logging verbosity
213
+ * for all MCP components at once.
214
+ *
215
+ * @param level - The log level to set ("debug", "info", "warn", or "error")
216
+ */
72
217
  export declare function setGlobalMCPLogLevel(level: LogLevel): void;
218
+ /**
219
+ * Export LogLevel enum for runtime use.
220
+ * Provides type-safe log level constants for use in application code.
221
+ *
222
+ * Example usage:
223
+ * ```
224
+ * import { logger, LogLevels } from './logger'; // Import from your project's path
225
+ *
226
+ * // Using the LogLevels constants (recommended for type safety):
227
+ * logger.setLogLevel(LogLevels.debug);
228
+ *
229
+ * // Or directly using string values:
230
+ * logger.setLogLevel('debug');
231
+ * ```
232
+ */
73
233
  export declare const LogLevels: {
74
234
  readonly debug: "debug";
75
235
  readonly info: "info";
@@ -1,9 +1,17 @@
1
1
  /**
2
2
  * NeuroLink Unified Logger Utility
3
3
  *
4
- * Centralized logging for the entire NeuroLink ecosystem
5
- * Supports both CLI --debug flag and NEUROLINK_DEBUG environment variable
6
- * Migrated from MCP logging with enhanced features
4
+ * Centralized logging for the entire NeuroLink ecosystem.
5
+ * Provides structured logging with different severity levels and consistent formatting.
6
+ * Supports both CLI --debug flag and NEUROLINK_DEBUG environment variable.
7
+ * Maintains compatibility with MCP logging while providing enhanced features.
8
+ *
9
+ * Features:
10
+ * - Multiple log levels (debug, info, warn, error)
11
+ * - Log history retention with configurable limits
12
+ * - Conditional logging based on environment settings
13
+ * - Structured data support for complex objects
14
+ * - Tabular data display
7
15
  */
8
16
  // Pre-computed uppercase log levels for performance optimization
9
17
  const UPPERCASE_LOG_LEVELS = {
@@ -28,9 +36,26 @@ class NeuroLinkLogger {
28
36
  this.logLevel = envLevel;
29
37
  }
30
38
  }
39
+ /**
40
+ * Sets the minimum log level that will be processed and output.
41
+ * Log messages with a level lower than this will be ignored.
42
+ *
43
+ * @param level - The minimum log level to process ("debug", "info", "warn", or "error")
44
+ */
31
45
  setLogLevel(level) {
32
46
  this.logLevel = level;
33
47
  }
48
+ /**
49
+ * Determines whether a message with the given log level should be processed.
50
+ * This method considers both the configured log level and the current debug mode.
51
+ *
52
+ * Logic:
53
+ * 1. If not in debug mode, only error messages are allowed
54
+ * 2. If in debug mode, messages at or above the configured log level are allowed
55
+ *
56
+ * @param level - The log level to check
57
+ * @returns True if a message with this level should be logged, false otherwise
58
+ */
34
59
  shouldLog(level) {
35
60
  // Dynamic debug mode check to handle CLI middleware timing
36
61
  const currentDebugMode = process.argv.includes("--debug") ||
@@ -42,6 +67,14 @@ class NeuroLinkLogger {
42
67
  const levels = ["debug", "info", "warn", "error"];
43
68
  return levels.indexOf(level) >= levels.indexOf(this.logLevel);
44
69
  }
70
+ /**
71
+ * Generates a standardized prefix for log messages.
72
+ * The prefix includes a timestamp and the log level in a consistent format.
73
+ *
74
+ * @param timestamp - ISO string representation of the log timestamp
75
+ * @param level - The log level for this message
76
+ * @returns Formatted prefix string like "[2025-08-18T13:45:30.123Z] [NEUROLINK:ERROR]"
77
+ */
45
78
  getLogPrefix(timestamp, level) {
46
79
  return `[${timestamp}] [NEUROLINK:${UPPERCASE_LOG_LEVELS[level]}]`;
47
80
  }
@@ -67,6 +100,19 @@ class NeuroLinkLogger {
67
100
  logMethod(prefix, message);
68
101
  }
69
102
  }
103
+ /**
104
+ * Core internal logging method that handles:
105
+ * 1. Creating log entries with consistent format
106
+ * 2. Storing entries in the log history
107
+ * 3. Managing log rotation to prevent memory issues
108
+ * 4. Outputting formatted logs to the console
109
+ *
110
+ * This is the central method called by all specific logging methods (debug, info, etc.)
111
+ *
112
+ * @param level - The severity level for this log entry
113
+ * @param message - The message text to log
114
+ * @param data - Optional additional context data to include
115
+ */
70
116
  log(level, message, data) {
71
117
  if (!this.shouldLog(level)) {
72
118
  return;
@@ -88,24 +134,63 @@ class NeuroLinkLogger {
88
134
  const prefix = this.getLogPrefix(timestamp, level);
89
135
  this.outputToConsole(level, prefix, message, data);
90
136
  }
137
+ /**
138
+ * Logs a message at the debug level.
139
+ * Used for detailed troubleshooting information.
140
+ *
141
+ * @param message - The message to log
142
+ * @param data - Optional additional context data
143
+ */
91
144
  debug(message, data) {
92
145
  this.log("debug", message, data);
93
146
  }
147
+ /**
148
+ * Logs a message at the info level.
149
+ * Used for general information about system operation.
150
+ *
151
+ * @param message - The message to log
152
+ * @param data - Optional additional context data
153
+ */
94
154
  info(message, data) {
95
155
  this.log("info", message, data);
96
156
  }
157
+ /**
158
+ * Logs a message at the warn level.
159
+ * Used for potentially problematic situations that don't prevent operation.
160
+ *
161
+ * @param message - The message to log
162
+ * @param data - Optional additional context data
163
+ */
97
164
  warn(message, data) {
98
165
  this.log("warn", message, data);
99
166
  }
167
+ /**
168
+ * Logs a message at the error level.
169
+ * Used for critical issues that may cause failures.
170
+ *
171
+ * @param message - The message to log
172
+ * @param data - Optional additional context data
173
+ */
100
174
  error(message, data) {
101
175
  this.log("error", message, data);
102
176
  }
177
+ /**
178
+ * Retrieves stored log entries, optionally filtered by log level.
179
+ * Returns a copy of the log entries to prevent external modification.
180
+ *
181
+ * @param level - Optional log level to filter by
182
+ * @returns Array of log entries, either all or filtered by level
183
+ */
103
184
  getLogs(level) {
104
185
  if (level) {
105
186
  return this.logs.filter((log) => log.level === level);
106
187
  }
107
188
  return [...this.logs];
108
189
  }
190
+ /**
191
+ * Removes all stored log entries.
192
+ * Useful for testing or when log history is no longer needed.
193
+ */
109
194
  clearLogs() {
110
195
  this.logs = [];
111
196
  }
@@ -116,6 +201,14 @@ class NeuroLinkLogger {
116
201
  * It bypasses the structured logging mechanism and should only be used when
117
202
  * unstructured, unconditional logging is required.
118
203
  *
204
+ * Use with caution in production environments as it outputs to the console
205
+ * regardless of the current log level or debug mode settings.
206
+ *
207
+ * Use cases:
208
+ * - Critical system information that must always be visible
209
+ * - Status messages during initialization before logging is fully configured
210
+ * - Debugging in environments where normal logging might be suppressed
211
+ *
119
212
  * @param args - The arguments to log. These are passed directly to `console.log`.
120
213
  */
121
214
  always(...args) {
@@ -124,15 +217,41 @@ class NeuroLinkLogger {
124
217
  /**
125
218
  * Displays tabular data unconditionally using `console.table`.
126
219
  *
127
- * @param data - The data to display in table format
220
+ * Similar to the `always` method, this bypasses log level checks and
221
+ * will display data regardless of current logging settings.
222
+ *
223
+ * Important differences from other logging methods:
224
+ * - Does NOT store entries in the log history
225
+ * - Does NOT use the structured logging format with timestamps and prefixes
226
+ * - Outputs directly to console without additional formatting
227
+ *
228
+ * Particularly useful for:
229
+ * - Displaying structured data in a readable format during debugging
230
+ * - Showing configuration options and their current values
231
+ * - Presenting comparison data between different system states
232
+ * - Performance metrics and timing data
233
+ *
234
+ * @param data - The data to display in table format. Can be an array of objects or an object with key-value pairs.
128
235
  */
129
236
  table(data) {
130
237
  console.table(data);
131
238
  }
132
239
  }
133
- // Export singleton instance
240
+ // Export singleton instance to ensure consistent logging across the application
134
241
  const neuroLinkLogger = new NeuroLinkLogger();
135
- // Helper function to process arguments with minimal overhead
242
+ /**
243
+ * Helper function to process logger arguments with minimal overhead.
244
+ * Handles variable argument patterns and ensures safe serialization of objects.
245
+ *
246
+ * This function:
247
+ * 1. Extracts the first argument as the message
248
+ * 2. Handles serialization of non-string first arguments
249
+ * 3. Collects remaining arguments as additional data
250
+ * 4. Passes the processed arguments to the actual logging method
251
+ *
252
+ * @param args - Array of arguments passed to the logger
253
+ * @param logMethod - Function that will perform the actual logging
254
+ */
136
255
  function processLoggerArgs(args, logMethod) {
137
256
  if (args.length === 0) {
138
257
  return;
@@ -149,7 +268,16 @@ function processLoggerArgs(args, logMethod) {
149
268
  const data = args.length === 2 ? args[1] : args.length > 2 ? args.slice(1) : undefined;
150
269
  logMethod(message, data);
151
270
  }
152
- // Main unified logger export
271
+ /**
272
+ * Main unified logger export that provides a simplified API for logging.
273
+ * This is the primary interface that should be used by application code.
274
+ *
275
+ * Features:
276
+ * - Convenient logging methods (debug, info, warn, error)
277
+ * - Unconditional logging (always, table)
278
+ * - Log level control and configuration
279
+ * - Log history management
280
+ */
153
281
  export const logger = {
154
282
  debug: (...args) => {
155
283
  if (neuroLinkLogger.shouldLog("debug")) {
@@ -182,16 +310,41 @@ export const logger = {
182
310
  getLogs: (level) => neuroLinkLogger.getLogs(level),
183
311
  clearLogs: () => neuroLinkLogger.clearLogs(),
184
312
  };
185
- // MCP compatibility exports - all use the same unified logger
313
+ /**
314
+ * MCP compatibility exports - all use the same unified logger instance.
315
+ * These exports maintain backward compatibility with code that expects
316
+ * separate loggers for different MCP components, while actually using
317
+ * the same underlying logger instance.
318
+ */
186
319
  export const mcpLogger = neuroLinkLogger;
187
320
  export const autoDiscoveryLogger = neuroLinkLogger;
188
321
  export const registryLogger = neuroLinkLogger;
189
322
  export const unifiedRegistryLogger = neuroLinkLogger;
190
- // Global log level setter
323
+ /**
324
+ * Sets the global log level for all MCP-related logging.
325
+ * This function provides a convenient way to adjust logging verbosity
326
+ * for all MCP components at once.
327
+ *
328
+ * @param level - The log level to set ("debug", "info", "warn", or "error")
329
+ */
191
330
  export function setGlobalMCPLogLevel(level) {
192
331
  neuroLinkLogger.setLogLevel(level);
193
332
  }
194
- // Export LogLevel enum for runtime use
333
+ /**
334
+ * Export LogLevel enum for runtime use.
335
+ * Provides type-safe log level constants for use in application code.
336
+ *
337
+ * Example usage:
338
+ * ```
339
+ * import { logger, LogLevels } from './logger'; // Import from your project's path
340
+ *
341
+ * // Using the LogLevels constants (recommended for type safety):
342
+ * logger.setLogLevel(LogLevels.debug);
343
+ *
344
+ * // Or directly using string values:
345
+ * logger.setLogLevel('debug');
346
+ * ```
347
+ */
195
348
  export const LogLevels = {
196
349
  debug: "debug",
197
350
  info: "info",
@@ -14,21 +14,24 @@ import { ProviderHealthChecker } from "./providerHealth.js";
14
14
  export async function getBestProvider(requestedProvider) {
15
15
  // Check requested provider FIRST - explicit user choice overrides defaults
16
16
  if (requestedProvider && requestedProvider !== "auto") {
17
- // For explicit provider requests, check health first
17
+ // For explicit provider requests, ALWAYS honor the request
18
+ // Never override explicit provider selection with health-based fallbacks
19
+ logger.debug(`[getBestProvider] Using explicitly requested provider: ${requestedProvider}`);
20
+ // Optional health check for logging purposes only
18
21
  try {
19
22
  const health = await ProviderHealthChecker.checkProviderHealth(requestedProvider, { includeConnectivityTest: false, cacheResults: true });
20
23
  if (health.isHealthy) {
21
- logger.debug(`[getBestProvider] Using healthy explicitly requested provider: ${requestedProvider}`);
22
- return requestedProvider;
24
+ logger.debug(`[getBestProvider] Explicitly requested provider ${requestedProvider} is healthy`);
23
25
  }
24
26
  else {
25
- logger.warn(`[getBestProvider] Requested provider ${requestedProvider} is unhealthy, finding alternative`, { error: health.error });
27
+ logger.warn(`[getBestProvider] Explicitly requested provider ${requestedProvider} may have issues, but using anyway`, { error: health.error });
26
28
  }
27
29
  }
28
30
  catch (error) {
29
- logger.warn(`[getBestProvider] Health check failed for ${requestedProvider}, using anyway`, { error: error instanceof Error ? error.message : String(error) });
30
- return requestedProvider; // Return anyway for explicit requests
31
+ logger.warn(`[getBestProvider] Health check failed for explicitly requested provider ${requestedProvider}, using anyway`, { error: error instanceof Error ? error.message : String(error) });
31
32
  }
33
+ // ALWAYS return the explicitly requested provider
34
+ return requestedProvider;
32
35
  }
33
36
  // Use health checker to get best available provider
34
37
  const healthyProvider = await ProviderHealthChecker.getBestHealthyProvider();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@juspay/neurolink",
3
- "version": "7.30.0",
3
+ "version": "7.30.1",
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",
@@ -136,7 +136,6 @@
136
136
  }
137
137
  },
138
138
  "dependencies": {
139
- "@ai-sdk/amazon-bedrock": "^1.0.0",
140
139
  "@ai-sdk/anthropic": "^1.2.12",
141
140
  "@ai-sdk/azure": "^1.3.24",
142
141
  "@ai-sdk/google": "^1.2.19",
@@ -150,7 +149,6 @@
150
149
  "@aws-sdk/client-sagemaker": "^3.862.0",
151
150
  "@aws-sdk/client-sagemaker-runtime": "^3.862.0",
152
151
  "@aws-sdk/credential-provider-node": "^3.876.0",
153
- "@aws-sdk/credential-providers": "^3.876.0",
154
152
  "@aws-sdk/types": "^3.862.0",
155
153
  "@google-cloud/vertexai": "^1.10.0",
156
154
  "@google/generative-ai": "^0.24.1",
@@ -197,6 +195,7 @@
197
195
  "@semantic-release/github": "^11.0.0",
198
196
  "@semantic-release/npm": "^12.0.1",
199
197
  "@semantic-release/release-notes-generator": "^14.0.1",
198
+ "@smithy/types": "^4.3.2",
200
199
  "@sveltejs/adapter-auto": "^6.0.0",
201
200
  "@sveltejs/kit": "^2.16.0",
202
201
  "@sveltejs/package": "^2.0.0",
@@ -1,58 +0,0 @@
1
- /**
2
- * AWS Credential Provider for NeuroLink
3
- *
4
- * Provides 100% compatibility with Bedrock-MCP-Connector authentication patterns
5
- * by leveraging AWS SDK v3's official defaultProvider credential chain.
6
- *
7
- * Supports all 9 AWS credential sources:
8
- * 1. Environment Variables (AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY)
9
- * 2. AWS Credentials File (~/.aws/credentials)
10
- * 3. AWS Config File (~/.aws/config)
11
- * 4. IAM Roles (EC2/ECS/Lambda)
12
- * 5. AWS SSO
13
- * 6. STS Assume Role
14
- * 7. Credential Process
15
- * 8. Container Credentials
16
- * 9. Instance Metadata Service (IMDS)
17
- */
18
- import type { AwsCredentialIdentity, Provider } from "@aws-sdk/types";
19
- import type { AWSCredentialConfig } from "../../types/providers.js";
20
- /**
21
- * AWS Credential Provider class that wraps AWS SDK v3's defaultProvider
22
- * to provide seamless compatibility with Bedrock-MCP-Connector authentication
23
- */
24
- export declare class AWSCredentialProvider {
25
- private credentialProvider;
26
- private config;
27
- private isInitialized;
28
- private lastCredentials;
29
- private lastRefresh;
30
- constructor(config?: AWSCredentialConfig);
31
- /**
32
- * Get AWS credentials using the default provider chain
33
- * Implements caching to avoid unnecessary credential resolution calls
34
- */
35
- getCredentials(): Promise<AwsCredentialIdentity>;
36
- /**
37
- * Get the raw credential provider for direct use with AWS SDK clients
38
- * This allows the credential provider to be passed directly to BedrockRuntimeClient
39
- */
40
- getCredentialProvider(): Provider<AwsCredentialIdentity>;
41
- /**
42
- * Force refresh of cached credentials
43
- * Useful when credentials may have been updated externally
44
- */
45
- refreshCredentials(): Promise<AwsCredentialIdentity>;
46
- /**
47
- * Check if credentials are currently available without throwing errors
48
- */
49
- isCredentialsAvailable(): Promise<boolean>;
50
- /**
51
- * Get configuration information for debugging
52
- */
53
- getConfig(): Readonly<Required<AWSCredentialConfig>>;
54
- /**
55
- * Clean up resources and clear cached credentials
56
- */
57
- dispose(): void;
58
- }