@juspay/neurolink 5.3.0 → 6.0.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 +76 -2
- package/dist/chat/client-utils.d.ts +3 -0
- package/dist/chat/client-utils.js +22 -5
- package/dist/chat/index.d.ts +4 -7
- package/dist/chat/index.js +0 -8
- package/dist/chat/session-storage.d.ts +2 -2
- package/dist/chat/session.d.ts +4 -3
- package/dist/chat/session.js +1 -1
- package/dist/chat/sse-handler.js +13 -21
- package/dist/chat/types.d.ts +3 -2
- package/dist/chat/websocket-chat-handler.d.ts +4 -3
- package/dist/chat/websocket-chat-handler.js +12 -12
- package/dist/cli/commands/config.d.ts +2 -2
- package/dist/cli/commands/mcp.d.ts +3 -2
- package/dist/cli/commands/mcp.js +39 -29
- package/dist/cli/commands/ollama.js +8 -4
- package/dist/cli/factories/command-factory.d.ts +2 -1
- package/dist/cli/index.js +22 -19
- package/dist/core/analytics.d.ts +3 -2
- package/dist/core/analytics.js +16 -7
- package/dist/core/base-provider.d.ts +35 -7
- package/dist/core/base-provider.js +36 -13
- package/dist/core/defaults.d.ts +2 -1
- package/dist/core/evaluation.d.ts +4 -4
- package/dist/core/evaluation.js +17 -7
- package/dist/core/factory.d.ts +3 -2
- package/dist/core/service-registry.d.ts +4 -4
- package/dist/core/types.d.ts +11 -4
- package/dist/factories/compatibility-factory.d.ts +16 -1
- package/dist/factories/compatibility-factory.js +3 -1
- package/dist/factories/provider-factory.d.ts +5 -4
- package/dist/factories/provider-factory.js +15 -24
- package/dist/factories/provider-generate-factory.js +26 -20
- package/dist/lib/chat/client-utils.d.ts +3 -0
- package/dist/lib/chat/client-utils.js +22 -5
- package/dist/lib/chat/index.d.ts +4 -7
- package/dist/lib/chat/index.js +0 -8
- package/dist/lib/chat/session-storage.d.ts +2 -2
- package/dist/lib/chat/session.d.ts +4 -3
- package/dist/lib/chat/session.js +1 -1
- package/dist/lib/chat/sse-handler.js +13 -21
- package/dist/lib/chat/types.d.ts +3 -2
- package/dist/lib/chat/websocket-chat-handler.d.ts +4 -3
- package/dist/lib/chat/websocket-chat-handler.js +12 -12
- package/dist/lib/core/analytics.d.ts +3 -2
- package/dist/lib/core/analytics.js +16 -7
- package/dist/lib/core/base-provider.d.ts +35 -7
- package/dist/lib/core/base-provider.js +36 -13
- package/dist/lib/core/defaults.d.ts +2 -1
- package/dist/lib/core/evaluation.d.ts +4 -4
- package/dist/lib/core/evaluation.js +17 -7
- package/dist/lib/core/factory.d.ts +3 -2
- package/dist/lib/core/service-registry.d.ts +4 -4
- package/dist/lib/core/types.d.ts +11 -4
- package/dist/lib/factories/compatibility-factory.d.ts +16 -1
- package/dist/lib/factories/compatibility-factory.js +3 -1
- package/dist/lib/factories/provider-factory.d.ts +5 -4
- package/dist/lib/factories/provider-factory.js +15 -24
- package/dist/lib/factories/provider-generate-factory.js +26 -20
- package/dist/lib/mcp/adapters/plugin-bridge.d.ts +5 -4
- package/dist/lib/mcp/adapters/plugin-bridge.js +13 -6
- package/dist/lib/mcp/client.d.ts +2 -1
- package/dist/lib/mcp/client.js +12 -10
- package/dist/lib/mcp/context-manager.d.ts +1 -1
- package/dist/lib/mcp/contracts/mcp-contract.d.ts +15 -8
- package/dist/lib/mcp/core/plugin-manager.d.ts +3 -2
- package/dist/lib/mcp/core/plugin-manager.js +1 -1
- package/dist/lib/mcp/demo/plugin-demo.js +3 -1
- package/dist/lib/mcp/dynamic-chain-executor.d.ts +64 -40
- package/dist/lib/mcp/dynamic-chain-executor.js +3 -3
- package/dist/lib/mcp/dynamic-orchestrator.d.ts +14 -8
- package/dist/lib/mcp/ecosystem.d.ts +4 -4
- package/dist/lib/mcp/error-manager.d.ts +2 -2
- package/dist/lib/mcp/error-recovery.d.ts +4 -3
- package/dist/lib/mcp/external-client.d.ts +1 -1
- package/dist/lib/mcp/external-client.js +14 -10
- package/dist/lib/mcp/external-manager.d.ts +3 -3
- package/dist/lib/mcp/external-manager.js +9 -3
- package/dist/lib/mcp/factory.d.ts +7 -7
- package/dist/lib/mcp/function-calling.d.ts +3 -2
- package/dist/lib/mcp/health-monitor.d.ts +2 -1
- package/dist/lib/mcp/health-monitor.js +16 -7
- package/dist/lib/mcp/index.d.ts +5 -5
- package/dist/lib/mcp/initialize-tools.d.ts +2 -1
- package/dist/lib/mcp/initialize-tools.js +10 -2
- package/dist/lib/mcp/manager.d.ts +2 -1
- package/dist/lib/mcp/neurolink-mcp-client.js +1 -1
- package/dist/lib/mcp/orchestrator.d.ts +13 -12
- package/dist/lib/mcp/orchestrator.js +10 -8
- package/dist/lib/mcp/plugin-manager.js +4 -2
- package/dist/lib/mcp/plugins/core/filesystem-mcp.d.ts +3 -2
- package/dist/lib/mcp/plugins/core/filesystem-mcp.js +5 -2
- package/dist/lib/mcp/plugins/filesystem-mcp.d.ts +2 -1
- package/dist/lib/mcp/registry.d.ts +2 -1
- package/dist/lib/mcp/registry.js +2 -1
- package/dist/lib/mcp/security-manager.d.ts +4 -2
- package/dist/lib/mcp/servers/agent/direct-tools-server.js +18 -6
- package/dist/lib/mcp/servers/ai-providers/ai-analysis-tools.d.ts +1 -16
- package/dist/lib/mcp/servers/ai-providers/ai-analysis-tools.js +21 -17
- package/dist/lib/mcp/servers/ai-providers/ai-core-server.d.ts +2 -2
- package/dist/lib/mcp/servers/ai-providers/ai-core-server.js +15 -133
- package/dist/lib/mcp/servers/ai-providers/ai-workflow-tools.d.ts +1 -97
- package/dist/lib/mcp/servers/ai-providers/ai-workflow-tools.js +18 -18
- package/dist/lib/mcp/session-manager.d.ts +4 -3
- package/dist/lib/mcp/session-persistence.js +5 -2
- package/dist/lib/mcp/tool-integration.d.ts +3 -2
- package/dist/lib/mcp/tool-integration.js +3 -1
- package/dist/lib/mcp/tool-registry.d.ts +18 -1
- package/dist/lib/mcp/tool-registry.js +11 -8
- package/dist/lib/mcp/transport-manager.d.ts +2 -1
- package/dist/lib/mcp/transport-manager.js +5 -1
- package/dist/lib/mcp/unified-mcp.d.ts +5 -5
- package/dist/lib/mcp/unified-registry.d.ts +18 -2
- package/dist/lib/mcp/unified-registry.js +52 -3
- package/dist/lib/neurolink.d.ts +2 -2
- package/dist/lib/neurolink.js +40 -15
- package/dist/lib/providers/amazon-bedrock.d.ts +1 -1
- package/dist/lib/providers/amazon-bedrock.js +8 -7
- package/dist/lib/providers/analytics-helper.d.ts +8 -23
- package/dist/lib/providers/analytics-helper.js +95 -33
- package/dist/lib/providers/anthropic-baseprovider.d.ts +3 -3
- package/dist/lib/providers/anthropic-baseprovider.js +6 -5
- package/dist/lib/providers/anthropic.d.ts +2 -2
- package/dist/lib/providers/anthropic.js +11 -4
- package/dist/lib/providers/azure-openai.d.ts +5 -4
- package/dist/lib/providers/azure-openai.js +10 -4
- package/dist/lib/providers/function-calling-provider.d.ts +2 -2
- package/dist/lib/providers/function-calling-provider.js +1 -1
- package/dist/lib/providers/google-ai-studio.d.ts +2 -2
- package/dist/lib/providers/google-ai-studio.js +9 -3
- package/dist/lib/providers/google-vertex.d.ts +2 -2
- package/dist/lib/providers/google-vertex.js +18 -12
- package/dist/lib/providers/huggingFace.d.ts +1 -1
- package/dist/lib/providers/huggingFace.js +8 -4
- package/dist/lib/providers/mcp-provider.d.ts +3 -3
- package/dist/lib/providers/mistral.d.ts +34 -27
- package/dist/lib/providers/mistral.js +115 -107
- package/dist/lib/providers/ollama.d.ts +2 -1
- package/dist/lib/providers/ollama.js +43 -3
- package/dist/lib/providers/openAI.d.ts +1 -1
- package/dist/lib/providers/openAI.js +8 -4
- package/dist/lib/proxy/proxy-fetch.js +3 -2
- package/dist/lib/sdk/tool-extension.d.ts +12 -12
- package/dist/lib/sdk/tool-extension.js +2 -1
- package/dist/lib/sdk/tool-registration.d.ts +16 -12
- package/dist/lib/sdk/tool-registration.js +3 -2
- package/dist/lib/services/types.d.ts +5 -4
- package/dist/lib/services/websocket/websocket-server.d.ts +1 -1
- package/dist/lib/services/websocket/websocket-server.js +1 -1
- package/dist/lib/telemetry/telemetry-service.js +1 -1
- package/dist/lib/types/cli.d.ts +247 -0
- package/dist/lib/types/cli.js +22 -0
- package/dist/lib/types/common.d.ts +76 -0
- package/dist/lib/types/common.js +52 -0
- package/dist/lib/types/generate-types.d.ts +6 -6
- package/dist/lib/types/index.d.ts +12 -0
- package/dist/lib/types/index.js +12 -0
- package/dist/lib/types/mcp-types.d.ts +7 -7
- package/dist/lib/types/providers.d.ts +158 -0
- package/dist/lib/types/providers.js +23 -0
- package/dist/lib/types/stream-types.d.ts +4 -3
- package/dist/lib/types/tools.d.ts +154 -0
- package/dist/lib/types/tools.js +24 -0
- package/dist/lib/utils/logger.d.ts +5 -5
- package/dist/lib/utils/provider-validation.d.ts +2 -1
- package/dist/mcp/adapters/plugin-bridge.d.ts +5 -4
- package/dist/mcp/adapters/plugin-bridge.js +13 -6
- package/dist/mcp/client.d.ts +2 -1
- package/dist/mcp/client.js +12 -10
- package/dist/mcp/context-manager.d.ts +1 -1
- package/dist/mcp/contracts/mcp-contract.d.ts +15 -8
- package/dist/mcp/core/plugin-manager.d.ts +3 -2
- package/dist/mcp/core/plugin-manager.js +1 -1
- package/dist/mcp/demo/plugin-demo.js +3 -1
- package/dist/mcp/dynamic-chain-executor.d.ts +64 -40
- package/dist/mcp/dynamic-chain-executor.js +3 -3
- package/dist/mcp/dynamic-orchestrator.d.ts +14 -8
- package/dist/mcp/dynamic-orchestrator.js +1 -1
- package/dist/mcp/ecosystem.d.ts +4 -4
- package/dist/mcp/error-manager.d.ts +2 -2
- package/dist/mcp/error-recovery.d.ts +4 -3
- package/dist/mcp/external-client.d.ts +1 -1
- package/dist/mcp/external-client.js +14 -10
- package/dist/mcp/external-manager.d.ts +3 -3
- package/dist/mcp/external-manager.js +9 -3
- package/dist/mcp/factory.d.ts +7 -7
- package/dist/mcp/function-calling.d.ts +3 -2
- package/dist/mcp/health-monitor.d.ts +2 -1
- package/dist/mcp/health-monitor.js +16 -7
- package/dist/mcp/index.d.ts +5 -5
- package/dist/mcp/initialize-tools.d.ts +2 -1
- package/dist/mcp/initialize-tools.js +10 -2
- package/dist/mcp/manager.d.ts +2 -1
- package/dist/mcp/neurolink-mcp-client.js +1 -1
- package/dist/mcp/orchestrator.d.ts +13 -12
- package/dist/mcp/orchestrator.js +10 -8
- package/dist/mcp/plugin-manager.js +4 -2
- package/dist/mcp/plugins/core/filesystem-mcp.d.ts +3 -2
- package/dist/mcp/plugins/core/filesystem-mcp.js +5 -2
- package/dist/mcp/plugins/filesystem-mcp.d.ts +2 -1
- package/dist/mcp/registry.d.ts +2 -1
- package/dist/mcp/registry.js +2 -1
- package/dist/mcp/security-manager.d.ts +4 -2
- package/dist/mcp/servers/agent/direct-tools-server.js +19 -6
- package/dist/mcp/servers/ai-providers/ai-analysis-tools.d.ts +1 -16
- package/dist/mcp/servers/ai-providers/ai-analysis-tools.js +21 -17
- package/dist/mcp/servers/ai-providers/ai-core-server.d.ts +2 -2
- package/dist/mcp/servers/ai-providers/ai-core-server.js +15 -132
- package/dist/mcp/servers/ai-providers/ai-workflow-tools.d.ts +1 -97
- package/dist/mcp/servers/ai-providers/ai-workflow-tools.js +18 -18
- package/dist/mcp/session-manager.d.ts +4 -3
- package/dist/mcp/session-persistence.js +5 -2
- package/dist/mcp/tool-integration.d.ts +3 -2
- package/dist/mcp/tool-integration.js +3 -1
- package/dist/mcp/tool-registry.d.ts +18 -1
- package/dist/mcp/tool-registry.js +11 -8
- package/dist/mcp/transport-manager.d.ts +2 -1
- package/dist/mcp/transport-manager.js +5 -1
- package/dist/mcp/unified-mcp.d.ts +5 -5
- package/dist/mcp/unified-registry.d.ts +18 -2
- package/dist/mcp/unified-registry.js +52 -3
- package/dist/neurolink.d.ts +2 -2
- package/dist/neurolink.js +40 -15
- package/dist/providers/amazon-bedrock.d.ts +1 -1
- package/dist/providers/amazon-bedrock.js +8 -7
- package/dist/providers/analytics-helper.d.ts +8 -23
- package/dist/providers/analytics-helper.js +95 -33
- package/dist/providers/anthropic-baseprovider.d.ts +3 -3
- package/dist/providers/anthropic-baseprovider.js +6 -5
- package/dist/providers/anthropic.d.ts +2 -2
- package/dist/providers/anthropic.js +11 -4
- package/dist/providers/azure-openai.d.ts +5 -4
- package/dist/providers/azure-openai.js +10 -4
- package/dist/providers/function-calling-provider.d.ts +2 -2
- package/dist/providers/function-calling-provider.js +1 -1
- package/dist/providers/google-ai-studio.d.ts +2 -2
- package/dist/providers/google-ai-studio.js +9 -3
- package/dist/providers/google-vertex.d.ts +2 -2
- package/dist/providers/google-vertex.js +18 -12
- package/dist/providers/huggingFace.d.ts +1 -1
- package/dist/providers/huggingFace.js +8 -4
- package/dist/providers/mcp-provider.d.ts +3 -3
- package/dist/providers/mistral.d.ts +34 -27
- package/dist/providers/mistral.js +116 -108
- package/dist/providers/ollama.d.ts +2 -1
- package/dist/providers/ollama.js +43 -3
- package/dist/providers/openAI.d.ts +1 -1
- package/dist/providers/openAI.js +8 -4
- package/dist/proxy/proxy-fetch.js +3 -2
- package/dist/sdk/tool-extension.d.ts +12 -12
- package/dist/sdk/tool-extension.js +2 -1
- package/dist/sdk/tool-registration.d.ts +16 -12
- package/dist/sdk/tool-registration.js +3 -2
- package/dist/services/types.d.ts +5 -4
- package/dist/services/websocket/websocket-server.d.ts +1 -1
- package/dist/services/websocket/websocket-server.js +2 -1
- package/dist/telemetry/telemetry-service.js +1 -1
- package/dist/types/cli.d.ts +247 -0
- package/dist/types/cli.js +22 -0
- package/dist/types/common.d.ts +76 -0
- package/dist/types/common.js +52 -0
- package/dist/types/generate-types.d.ts +6 -6
- package/dist/types/index.d.ts +12 -0
- package/dist/types/index.js +12 -0
- package/dist/types/mcp-types.d.ts +7 -7
- package/dist/types/providers.d.ts +158 -0
- package/dist/types/providers.js +23 -0
- package/dist/types/stream-types.d.ts +4 -3
- package/dist/types/tools.d.ts +154 -0
- package/dist/types/tools.js +25 -0
- package/dist/utils/logger.d.ts +5 -5
- package/dist/utils/provider-validation.d.ts +2 -1
- package/package.json +1 -1
|
@@ -1,18 +1,15 @@
|
|
|
1
1
|
import { logger } from "../utils/logger.js";
|
|
2
2
|
import { directAgentTools } from "../agent/direct-tools.js";
|
|
3
|
-
// Dynamic imports to break circular dependency
|
|
4
|
-
// import { evaluateResponse } from "../core/evaluation.js";
|
|
5
|
-
// import { getAvailableFunctionTools } from "../mcp/function-calling.js";
|
|
6
|
-
// Analytics helper will be dynamically imported when needed
|
|
7
3
|
/**
|
|
8
4
|
* Validates if a result contains a valid toolsObject structure
|
|
9
5
|
* @param result - The result object to validate
|
|
10
6
|
* @returns true if the result contains a valid toolsObject, false otherwise
|
|
11
7
|
*/
|
|
12
8
|
function isValidToolsObject(result) {
|
|
13
|
-
return (result &&
|
|
9
|
+
return (result !== null &&
|
|
14
10
|
typeof result === "object" &&
|
|
15
|
-
|
|
11
|
+
"toolsObject" in result &&
|
|
12
|
+
result.toolsObject !== null &&
|
|
16
13
|
typeof result.toolsObject === "object" &&
|
|
17
14
|
Object.keys(result.toolsObject).length > 0);
|
|
18
15
|
}
|
|
@@ -101,7 +98,16 @@ export class BaseProvider {
|
|
|
101
98
|
parameters: call.args,
|
|
102
99
|
id: call.toolCallId,
|
|
103
100
|
})),
|
|
104
|
-
toolResults: result?.toolResults
|
|
101
|
+
toolResults: result?.toolResults
|
|
102
|
+
? result.toolResults.map((tr) => ({
|
|
103
|
+
toolName: tr.toolName || "unknown",
|
|
104
|
+
status: (tr.status === "error"
|
|
105
|
+
? "failure"
|
|
106
|
+
: "success"),
|
|
107
|
+
result: tr.result,
|
|
108
|
+
error: tr.error,
|
|
109
|
+
}))
|
|
110
|
+
: undefined,
|
|
105
111
|
};
|
|
106
112
|
}
|
|
107
113
|
catch (error) {
|
|
@@ -154,7 +160,19 @@ export class BaseProvider {
|
|
|
154
160
|
},
|
|
155
161
|
provider: this.providerName,
|
|
156
162
|
model: this.modelName,
|
|
157
|
-
toolCalls: result.toolCalls
|
|
163
|
+
toolCalls: result.toolCalls
|
|
164
|
+
? result.toolCalls.map((tc) => ({
|
|
165
|
+
toolCallId: tc.toolCallId ||
|
|
166
|
+
tc.id ||
|
|
167
|
+
"unknown",
|
|
168
|
+
toolName: tc.toolName ||
|
|
169
|
+
tc.name ||
|
|
170
|
+
"unknown",
|
|
171
|
+
args: tc.args ||
|
|
172
|
+
tc.parameters ||
|
|
173
|
+
{},
|
|
174
|
+
}))
|
|
175
|
+
: [],
|
|
158
176
|
toolResults: result.toolResults,
|
|
159
177
|
};
|
|
160
178
|
// Enhanced result with analytics and evaluation
|
|
@@ -186,8 +204,7 @@ export class BaseProvider {
|
|
|
186
204
|
logger.debug(`[BaseProvider] Direct tools: ${Object.keys(this.directTools).join(", ")}`);
|
|
187
205
|
// Add custom tools from SDK if available
|
|
188
206
|
logger.debug(`[BaseProvider] Checking SDK: ${!!this.sdk}, has getInMemoryServers: ${this.sdk && typeof this.sdk.getInMemoryServers}`);
|
|
189
|
-
if (this.sdk &&
|
|
190
|
-
typeof this.sdk.getInMemoryServers === "function") {
|
|
207
|
+
if (this.sdk && typeof this.sdk.getInMemoryServers === "function") {
|
|
191
208
|
logger.debug(`[BaseProvider] SDK check passed, loading custom tools`);
|
|
192
209
|
try {
|
|
193
210
|
const inMemoryServers = this.sdk.getInMemoryServers();
|
|
@@ -223,7 +240,10 @@ export class BaseProvider {
|
|
|
223
240
|
return result.data;
|
|
224
241
|
}
|
|
225
242
|
else {
|
|
226
|
-
|
|
243
|
+
const errorMsg = typeof result.error === "string"
|
|
244
|
+
? result.error
|
|
245
|
+
: "Tool execution failed";
|
|
246
|
+
throw new Error(errorMsg);
|
|
227
247
|
}
|
|
228
248
|
}
|
|
229
249
|
return result;
|
|
@@ -249,7 +269,9 @@ export class BaseProvider {
|
|
|
249
269
|
this.mcpTools = result.toolsObject;
|
|
250
270
|
}
|
|
251
271
|
else {
|
|
252
|
-
logger.debug(`Invalid or empty toolsObject for ${this.providerName}: Expected an object with at least one key, but got ${typeof result
|
|
272
|
+
logger.debug(`Invalid or empty toolsObject for ${this.providerName}: Expected an object with at least one key, but got ${typeof result?.toolsObject} with ${result?.toolsObject
|
|
273
|
+
? Object.keys(result.toolsObject).length
|
|
274
|
+
: 0} keys. Full result:`, result);
|
|
253
275
|
}
|
|
254
276
|
}
|
|
255
277
|
catch (error) {
|
|
@@ -336,7 +358,8 @@ export class BaseProvider {
|
|
|
336
358
|
}
|
|
337
359
|
async createEvaluation(result, options) {
|
|
338
360
|
const { evaluateResponse } = await import("../core/evaluation.js");
|
|
339
|
-
|
|
361
|
+
const evaluation = await evaluateResponse(result.content, options.prompt);
|
|
362
|
+
return evaluation;
|
|
340
363
|
}
|
|
341
364
|
validateOptions(options) {
|
|
342
365
|
if (!options.prompt || options.prompt.trim().length === 0) {
|
|
@@ -2,11 +2,12 @@
|
|
|
2
2
|
* Default value helper functions for NeuroLink
|
|
3
3
|
* Centralized logic for applying defaults across the system
|
|
4
4
|
*/
|
|
5
|
+
import type { UnknownRecord } from "../types/common.js";
|
|
5
6
|
/**
|
|
6
7
|
* Apply default values to options object
|
|
7
8
|
* User-provided values take precedence over defaults
|
|
8
9
|
*/
|
|
9
|
-
export declare function applyDefaults(options:
|
|
10
|
+
export declare function applyDefaults(options: UnknownRecord): UnknownRecord;
|
|
10
11
|
/**
|
|
11
12
|
* Get default max tokens for a specific provider
|
|
12
13
|
* Can be extended for provider-specific overrides in the future
|
|
@@ -23,7 +23,7 @@ export interface UnifiedEvaluationResult extends EvaluationData {
|
|
|
23
23
|
export interface UnifiedEvaluationContext {
|
|
24
24
|
userQuery: string;
|
|
25
25
|
aiResponse: string;
|
|
26
|
-
context?: Record<string,
|
|
26
|
+
context?: Record<string, unknown>;
|
|
27
27
|
primaryDomain?: string;
|
|
28
28
|
assistantRole?: string;
|
|
29
29
|
conversationHistory?: Array<{
|
|
@@ -33,8 +33,8 @@ export interface UnifiedEvaluationContext {
|
|
|
33
33
|
}>;
|
|
34
34
|
toolUsage?: Array<{
|
|
35
35
|
toolName: string;
|
|
36
|
-
input:
|
|
37
|
-
output:
|
|
36
|
+
input: unknown;
|
|
37
|
+
output: unknown;
|
|
38
38
|
executionTime: number;
|
|
39
39
|
}>;
|
|
40
40
|
expectedOutcome?: string;
|
|
@@ -52,5 +52,5 @@ declare function parseUnifiedEvaluationResult(response: string, context: Unified
|
|
|
52
52
|
* Main unified evaluation function
|
|
53
53
|
*/
|
|
54
54
|
export declare function generateUnifiedEvaluation(context: UnifiedEvaluationContext): Promise<UnifiedEvaluationResult>;
|
|
55
|
-
export declare function evaluateResponse(responseOrContext:
|
|
55
|
+
export declare function evaluateResponse(responseOrContext: unknown, contextOrUserQuery?: unknown, userQuery?: unknown, providedContexts?: unknown, options?: unknown, additionalArgs?: unknown): Promise<unknown>;
|
|
56
56
|
export { getDefaultUnifiedEvaluation, parseUnifiedEvaluationResult };
|
|
@@ -90,7 +90,19 @@ function parseUnifiedEvaluationResult(response, context) {
|
|
|
90
90
|
if (match) {
|
|
91
91
|
const value = parseFloat(match[1]);
|
|
92
92
|
if (value >= 1 && value <= 10) {
|
|
93
|
-
|
|
93
|
+
const roundedValue = Math.round(value);
|
|
94
|
+
if (key === "relevance") {
|
|
95
|
+
result.relevance = roundedValue;
|
|
96
|
+
}
|
|
97
|
+
else if (key === "accuracy") {
|
|
98
|
+
result.accuracy = roundedValue;
|
|
99
|
+
}
|
|
100
|
+
else if (key === "completeness") {
|
|
101
|
+
result.completeness = roundedValue;
|
|
102
|
+
}
|
|
103
|
+
else if (key === "overall") {
|
|
104
|
+
result.overall = roundedValue;
|
|
105
|
+
}
|
|
94
106
|
}
|
|
95
107
|
}
|
|
96
108
|
}
|
|
@@ -163,9 +175,7 @@ Overall: [score]
|
|
|
163
175
|
return getDefaultUnifiedEvaluation("no-response", Date.now() - startTime, context);
|
|
164
176
|
}
|
|
165
177
|
// Extract text from result
|
|
166
|
-
const response = typeof result === "string"
|
|
167
|
-
? result
|
|
168
|
-
: result.text || String(result);
|
|
178
|
+
const response = typeof result === "string" ? result : result?.content || String(result);
|
|
169
179
|
// Parse evaluation result
|
|
170
180
|
const parsed = parseUnifiedEvaluationResult(response, context);
|
|
171
181
|
// Validate and enhance result
|
|
@@ -216,12 +226,12 @@ export async function evaluateResponse(responseOrContext, contextOrUserQuery, us
|
|
|
216
226
|
String(contextOrUserQuery || "");
|
|
217
227
|
}
|
|
218
228
|
const evalContext = {
|
|
219
|
-
userQuery: userQuery ||
|
|
229
|
+
userQuery: (typeof userQuery === "string" ? userQuery : "") ||
|
|
220
230
|
context?.userQuery ||
|
|
221
|
-
contextOrUserQuery ||
|
|
231
|
+
(typeof contextOrUserQuery === "string" ? contextOrUserQuery : "") ||
|
|
222
232
|
"Generated response",
|
|
223
233
|
aiResponse,
|
|
224
|
-
context,
|
|
234
|
+
context: context,
|
|
225
235
|
};
|
|
226
236
|
return generateUnifiedEvaluation(evalContext);
|
|
227
237
|
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { AIProvider, AIProviderName, SupportedModelName } from "./types.js";
|
|
2
|
+
import type { UnknownRecord } from "../types/common.js";
|
|
2
3
|
declare const componentIdentifier = "aiProviderFactory";
|
|
3
4
|
/**
|
|
4
5
|
* Factory for creating AI provider instances with centralized configuration
|
|
@@ -15,7 +16,7 @@ export declare class AIProviderFactory {
|
|
|
15
16
|
* @param enableMCP - Optional flag to enable MCP integration (default: true)
|
|
16
17
|
* @returns AIProvider instance
|
|
17
18
|
*/
|
|
18
|
-
static createProvider(providerName: string, modelName?: string | null, enableMCP?: boolean, sdk?:
|
|
19
|
+
static createProvider(providerName: string, modelName?: string | null, enableMCP?: boolean, sdk?: UnknownRecord): Promise<AIProvider>;
|
|
19
20
|
/**
|
|
20
21
|
* Create a provider instance with specific provider enum and model
|
|
21
22
|
* @param provider - Provider enum value
|
|
@@ -30,7 +31,7 @@ export declare class AIProviderFactory {
|
|
|
30
31
|
* @param enableMCP - Optional flag to enable MCP integration (default: true)
|
|
31
32
|
* @returns AIProvider instance
|
|
32
33
|
*/
|
|
33
|
-
static createBestProvider(requestedProvider?: string, modelName?: string | null, enableMCP?: boolean, sdk?:
|
|
34
|
+
static createBestProvider(requestedProvider?: string, modelName?: string | null, enableMCP?: boolean, sdk?: UnknownRecord): Promise<AIProvider>;
|
|
34
35
|
/**
|
|
35
36
|
* Create primary and fallback provider instances
|
|
36
37
|
* @param primaryProvider - Primary provider name
|
|
@@ -2,13 +2,13 @@
|
|
|
2
2
|
* Service Registry for Dependency Injection
|
|
3
3
|
* Breaks circular dependencies by providing lazy loading and centralized service management
|
|
4
4
|
*/
|
|
5
|
-
export interface ServiceFactory<T =
|
|
5
|
+
export interface ServiceFactory<T = unknown> {
|
|
6
6
|
(): T | Promise<T>;
|
|
7
7
|
}
|
|
8
|
-
export interface ServiceRegistration {
|
|
9
|
-
factory: ServiceFactory
|
|
8
|
+
export interface ServiceRegistration<T = unknown> {
|
|
9
|
+
factory: ServiceFactory<T>;
|
|
10
10
|
singleton: boolean;
|
|
11
|
-
instance?:
|
|
11
|
+
instance?: T;
|
|
12
12
|
}
|
|
13
13
|
export declare class ServiceRegistry {
|
|
14
14
|
private static services;
|
package/dist/lib/core/types.d.ts
CHANGED
|
@@ -2,6 +2,7 @@ import type { ZodType, ZodTypeDef } from "zod";
|
|
|
2
2
|
import type { Schema, Tool } from "ai";
|
|
3
3
|
import type { GenerateResult } from "../types/generate-types.js";
|
|
4
4
|
import type { StreamOptions, StreamResult } from "../types/stream-types.js";
|
|
5
|
+
import type { JsonValue } from "../types/common.js";
|
|
5
6
|
export interface TextGenerationResult {
|
|
6
7
|
content: string;
|
|
7
8
|
provider?: string;
|
|
@@ -26,8 +27,14 @@ export interface TextGenerationResult {
|
|
|
26
27
|
server: string;
|
|
27
28
|
category?: string;
|
|
28
29
|
}>;
|
|
29
|
-
analytics?:
|
|
30
|
-
evaluation?:
|
|
30
|
+
analytics?: AnalyticsData;
|
|
31
|
+
evaluation?: {
|
|
32
|
+
relevance: number;
|
|
33
|
+
accuracy: number;
|
|
34
|
+
completeness: number;
|
|
35
|
+
overall: number;
|
|
36
|
+
reasoning?: string;
|
|
37
|
+
};
|
|
31
38
|
}
|
|
32
39
|
/**
|
|
33
40
|
* Supported AI Provider Names
|
|
@@ -118,7 +125,7 @@ export interface TextGenerationOptions {
|
|
|
118
125
|
maxSteps?: number;
|
|
119
126
|
enableEvaluation?: boolean;
|
|
120
127
|
enableAnalytics?: boolean;
|
|
121
|
-
context?: Record<string,
|
|
128
|
+
context?: Record<string, JsonValue>;
|
|
122
129
|
evaluationDomain?: string;
|
|
123
130
|
toolUsageContext?: string;
|
|
124
131
|
conversationHistory?: Array<{
|
|
@@ -140,7 +147,7 @@ export interface AnalyticsData {
|
|
|
140
147
|
cost?: number;
|
|
141
148
|
responseTime: number;
|
|
142
149
|
timestamp: string;
|
|
143
|
-
context?: Record<string,
|
|
150
|
+
context?: Record<string, JsonValue>;
|
|
144
151
|
}
|
|
145
152
|
/**
|
|
146
153
|
* Response quality evaluation scores (Lighthouse-Compatible Schema)
|
|
@@ -12,7 +12,22 @@ export declare class CompatibilityConversionFactory {
|
|
|
12
12
|
/**
|
|
13
13
|
* Convert GenerateResult to legacy TextGenerationResult format
|
|
14
14
|
*/
|
|
15
|
-
static convertGenerateToText(result: GenerateResult):
|
|
15
|
+
static convertGenerateToText(result: GenerateResult): {
|
|
16
|
+
content: string;
|
|
17
|
+
provider?: string;
|
|
18
|
+
model?: string;
|
|
19
|
+
usage?: {
|
|
20
|
+
inputTokens: number;
|
|
21
|
+
outputTokens: number;
|
|
22
|
+
totalTokens: number;
|
|
23
|
+
};
|
|
24
|
+
responseTime?: number;
|
|
25
|
+
toolsUsed?: number;
|
|
26
|
+
toolExecutions?: unknown[];
|
|
27
|
+
analytics?: unknown;
|
|
28
|
+
evaluation?: unknown;
|
|
29
|
+
[key: string]: unknown;
|
|
30
|
+
};
|
|
16
31
|
/**
|
|
17
32
|
* Convert GenerateOptions to TextGenerationOptions
|
|
18
33
|
*/
|
|
@@ -37,7 +37,9 @@ export class CompatibilityConversionFactory {
|
|
|
37
37
|
model: result.model,
|
|
38
38
|
usage: result.usage,
|
|
39
39
|
responseTime: result.responseTime,
|
|
40
|
-
toolsUsed: result.toolsUsed
|
|
40
|
+
toolsUsed: Array.isArray(result.toolsUsed)
|
|
41
|
+
? result.toolsUsed.length
|
|
42
|
+
: result.toolsUsed,
|
|
41
43
|
toolExecutions: result.toolExecutions,
|
|
42
44
|
enhancedWithTools: result.enhancedWithTools,
|
|
43
45
|
availableTools: result.availableTools,
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import type { AIProvider, AIProviderName } from "../core/types.js";
|
|
2
|
+
import type { UnknownRecord } from "../types/common.js";
|
|
2
3
|
/**
|
|
3
4
|
* Provider constructor interface - supports both sync constructors and async factory functions
|
|
4
5
|
*/
|
|
5
6
|
type ProviderConstructor = {
|
|
6
|
-
new (modelName?: string, providerName?:
|
|
7
|
-
} | ((modelName?: string, providerName?:
|
|
7
|
+
new (modelName?: string, providerName?: string, sdk?: UnknownRecord): AIProvider;
|
|
8
|
+
} | ((modelName?: string, providerName?: string, sdk?: UnknownRecord) => Promise<AIProvider>);
|
|
8
9
|
/**
|
|
9
10
|
* Provider registration entry
|
|
10
11
|
*/
|
|
@@ -29,7 +30,7 @@ export declare class ProviderFactory {
|
|
|
29
30
|
/**
|
|
30
31
|
* Create a provider instance
|
|
31
32
|
*/
|
|
32
|
-
static createProvider(providerName: AIProviderName | string, modelName?: string, sdk?:
|
|
33
|
+
static createProvider(providerName: AIProviderName | string, modelName?: string, sdk?: UnknownRecord): Promise<AIProvider>;
|
|
33
34
|
/**
|
|
34
35
|
* Check if a provider is registered
|
|
35
36
|
*/
|
|
@@ -63,7 +64,7 @@ export declare class ProviderFactory {
|
|
|
63
64
|
* Create the best available provider for the given name
|
|
64
65
|
* Used by NeuroLink SDK for streaming and generation
|
|
65
66
|
*/
|
|
66
|
-
static createBestProvider(providerName: AIProviderName | string, modelName?: string, enableMCP?: boolean, sdk?:
|
|
67
|
+
static createBestProvider(providerName: AIProviderName | string, modelName?: string, enableMCP?: boolean, sdk?: UnknownRecord): Promise<AIProvider>;
|
|
67
68
|
}
|
|
68
69
|
/**
|
|
69
70
|
* Helper function to create providers with backward compatibility
|
|
@@ -37,32 +37,23 @@ export class ProviderFactory {
|
|
|
37
37
|
}
|
|
38
38
|
const model = modelName || registration.defaultModel;
|
|
39
39
|
try {
|
|
40
|
-
//
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
registration.constructor) {
|
|
46
|
-
// It's a class constructor
|
|
47
|
-
return new registration.constructor(model, providerName, sdk);
|
|
48
|
-
}
|
|
49
|
-
else {
|
|
50
|
-
// It's a factory function - call it and await if it returns a promise
|
|
51
|
-
const result = registration.constructor(model, providerName, sdk);
|
|
52
|
-
if (result && typeof result.then === "function") {
|
|
53
|
-
// It's a Promise (async factory)
|
|
54
|
-
return await result;
|
|
55
|
-
}
|
|
56
|
-
else {
|
|
57
|
-
// It's a sync result, return it
|
|
58
|
-
return result;
|
|
59
|
-
}
|
|
60
|
-
}
|
|
40
|
+
// Try calling as factory function first, then fallback to constructor
|
|
41
|
+
let result;
|
|
42
|
+
try {
|
|
43
|
+
// Try as factory function
|
|
44
|
+
result = registration.constructor(model, providerName, sdk);
|
|
61
45
|
}
|
|
62
|
-
|
|
63
|
-
// Fallback
|
|
64
|
-
|
|
46
|
+
catch (factoryError) {
|
|
47
|
+
// Fallback to constructor
|
|
48
|
+
result = new registration.constructor(model, providerName, sdk);
|
|
65
49
|
}
|
|
50
|
+
// Only await if result is actually a Promise
|
|
51
|
+
if (result &&
|
|
52
|
+
typeof result === "object" &&
|
|
53
|
+
typeof result.then === "function") {
|
|
54
|
+
return await result;
|
|
55
|
+
}
|
|
56
|
+
return result;
|
|
66
57
|
}
|
|
67
58
|
catch (error) {
|
|
68
59
|
logger.error(`Failed to create provider ${providerName}:`, error);
|
|
@@ -37,35 +37,41 @@ export class ProviderGenerateFactory {
|
|
|
37
37
|
try {
|
|
38
38
|
// Use existing generate method for identical performance
|
|
39
39
|
const textResult = await provider.generate(textOptions);
|
|
40
|
+
if (!textResult) {
|
|
41
|
+
throw new Error("Generate method returned null result");
|
|
42
|
+
}
|
|
40
43
|
// Convert back to GenerateResult format with type safety
|
|
41
44
|
const generateResult = {
|
|
42
|
-
content: textResult
|
|
43
|
-
outputs: { text: textResult
|
|
44
|
-
provider: textResult
|
|
45
|
-
model: textResult
|
|
46
|
-
usage: textResult
|
|
45
|
+
content: textResult.content || "",
|
|
46
|
+
outputs: { text: textResult.content || "" },
|
|
47
|
+
provider: textResult.provider,
|
|
48
|
+
model: textResult.model,
|
|
49
|
+
usage: textResult.usage
|
|
47
50
|
? {
|
|
48
|
-
inputTokens: textResult.usage
|
|
49
|
-
outputTokens: textResult.usage
|
|
50
|
-
totalTokens: textResult.usage
|
|
51
|
+
inputTokens: textResult.usage.inputTokens || 0,
|
|
52
|
+
outputTokens: textResult.usage.outputTokens || 0,
|
|
53
|
+
totalTokens: textResult.usage.totalTokens || 0,
|
|
51
54
|
}
|
|
52
55
|
: undefined,
|
|
53
|
-
responseTime: textResult
|
|
54
|
-
toolsUsed: textResult
|
|
55
|
-
toolExecutions: textResult
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
56
|
+
responseTime: textResult.responseTime,
|
|
57
|
+
toolsUsed: textResult.toolsUsed,
|
|
58
|
+
toolExecutions: textResult.toolExecutions?.map((te) => {
|
|
59
|
+
const toolExecution = te;
|
|
60
|
+
return {
|
|
61
|
+
name: toolExecution.toolName || toolExecution.name || "",
|
|
62
|
+
input: toolExecution.input || {},
|
|
63
|
+
output: toolExecution.output || toolExecution.result,
|
|
64
|
+
duration: toolExecution.executionTime || toolExecution.duration || 0,
|
|
65
|
+
};
|
|
66
|
+
}),
|
|
67
|
+
enhancedWithTools: textResult.enhancedWithTools,
|
|
68
|
+
availableTools: textResult.availableTools?.map((at) => ({
|
|
63
69
|
name: at.name || "",
|
|
64
70
|
description: at.description || "",
|
|
65
71
|
parameters: at.parameters || {},
|
|
66
72
|
})),
|
|
67
|
-
analytics: textResult
|
|
68
|
-
evaluation: textResult
|
|
73
|
+
analytics: textResult.analytics,
|
|
74
|
+
evaluation: textResult.evaluation,
|
|
69
75
|
};
|
|
70
76
|
return generateResult;
|
|
71
77
|
}
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
* Provides compatibility layer for existing MCP integrations
|
|
4
4
|
*/
|
|
5
5
|
import type { ExecutionContext } from "../contracts/mcp-contract.js";
|
|
6
|
+
import type { JsonValue, UnknownRecord, Unknown } from "../../types/common.js";
|
|
6
7
|
/**
|
|
7
8
|
* Bridge interface for legacy MCP compatibility
|
|
8
9
|
*/
|
|
@@ -22,18 +23,18 @@ export declare function enhanceExecutionContext(context: ExecutionContext): Exec
|
|
|
22
23
|
/**
|
|
23
24
|
* Utility function to adapt legacy MCP calls
|
|
24
25
|
*/
|
|
25
|
-
export declare function adaptLegacyMCPCall(context: ExecutionContext, operation: string, ...args:
|
|
26
|
+
export declare function adaptLegacyMCPCall(context: ExecutionContext, operation: string, ...args: JsonValue[]): Promise<Unknown>;
|
|
26
27
|
/**
|
|
27
28
|
* Quick plugin factory for simple plugin creation
|
|
28
29
|
*/
|
|
29
30
|
export declare class QuickPluginFactory {
|
|
30
|
-
static create(name: string, config:
|
|
31
|
+
static create(name: string, config: UnknownRecord): Promise<{
|
|
31
32
|
name: string;
|
|
32
|
-
config:
|
|
33
|
+
config: UnknownRecord;
|
|
33
34
|
initialized: boolean;
|
|
34
35
|
}>;
|
|
35
36
|
}
|
|
36
37
|
/**
|
|
37
38
|
* Execute plugin with enhanced context
|
|
38
39
|
*/
|
|
39
|
-
export declare function executePlugin(plugin:
|
|
40
|
+
export declare function executePlugin(plugin: UnknownRecord, context: ExecutionContext, operation: string, ...args: JsonValue[]): Promise<Unknown>;
|
|
@@ -46,12 +46,19 @@ export function enhanceExecutionContext(context) {
|
|
|
46
46
|
export async function adaptLegacyMCPCall(context, operation, ...args) {
|
|
47
47
|
const bridge = createLegacyBridge(context);
|
|
48
48
|
switch (operation) {
|
|
49
|
-
case "writeFile":
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
return bridge.
|
|
53
|
-
|
|
54
|
-
|
|
49
|
+
case "writeFile": {
|
|
50
|
+
const filePath = typeof args[0] === "string" ? args[0] : String(args[0]);
|
|
51
|
+
const content = typeof args[1] === "string" ? args[1] : String(args[1]);
|
|
52
|
+
return bridge.writeFile(filePath, content);
|
|
53
|
+
}
|
|
54
|
+
case "readFile": {
|
|
55
|
+
const readPath = typeof args[0] === "string" ? args[0] : String(args[0]);
|
|
56
|
+
return bridge.readFile(readPath);
|
|
57
|
+
}
|
|
58
|
+
case "listFiles": {
|
|
59
|
+
const listPath = typeof args[0] === "string" ? args[0] : String(args[0]);
|
|
60
|
+
return bridge.listFiles(listPath);
|
|
61
|
+
}
|
|
55
62
|
default:
|
|
56
63
|
throw new Error(`Unsupported legacy operation: ${operation}`);
|
|
57
64
|
}
|
package/dist/lib/mcp/client.d.ts
CHANGED
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
*/
|
|
5
5
|
import { EventEmitter } from "events";
|
|
6
6
|
import type { ToolResult, NeuroLinkExecutionContext } from "./factory.js";
|
|
7
|
+
import type { Unknown } from "../types/common.js";
|
|
7
8
|
/**
|
|
8
9
|
* MCP Client Configuration
|
|
9
10
|
*/
|
|
@@ -28,7 +29,7 @@ export declare class NeuroLinkMCPClient extends EventEmitter {
|
|
|
28
29
|
* Register a tool with the MCP client
|
|
29
30
|
* Following Lighthouse's pattern of namespacing tools with server ID
|
|
30
31
|
*/
|
|
31
|
-
registerTool(toolName: string, execute: (name: string, params: Record<string, unknown>) => Promise<
|
|
32
|
+
registerTool(toolName: string, execute: (name: string, params: Record<string, unknown>) => Promise<Unknown>, description?: string, inputSchema?: unknown): void;
|
|
32
33
|
/**
|
|
33
34
|
* Get all registered tools
|
|
34
35
|
*/
|
package/dist/lib/mcp/client.js
CHANGED
|
@@ -49,13 +49,14 @@ export class NeuroLinkMCPClient extends EventEmitter {
|
|
|
49
49
|
return result;
|
|
50
50
|
}
|
|
51
51
|
// If it's in Lighthouse format with content array
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
52
|
+
const lightouseResult = result;
|
|
53
|
+
if (lightouseResult.text &&
|
|
54
|
+
Array.isArray(lightouseResult.text) &&
|
|
55
|
+
lightouseResult.text[0]?.text) {
|
|
55
56
|
try {
|
|
56
|
-
const data = JSON.parse(
|
|
57
|
+
const data = JSON.parse(lightouseResult.text[0].text);
|
|
57
58
|
return {
|
|
58
|
-
success: !
|
|
59
|
+
success: !lightouseResult.isError,
|
|
59
60
|
data,
|
|
60
61
|
metadata: {
|
|
61
62
|
toolName,
|
|
@@ -68,8 +69,8 @@ export class NeuroLinkMCPClient extends EventEmitter {
|
|
|
68
69
|
catch (parseError) {
|
|
69
70
|
// If JSON parsing fails, return the text as-is
|
|
70
71
|
return {
|
|
71
|
-
success: !
|
|
72
|
-
data: { text:
|
|
72
|
+
success: !lightouseResult.isError,
|
|
73
|
+
data: { text: lightouseResult.text[0].text },
|
|
73
74
|
metadata: {
|
|
74
75
|
toolName,
|
|
75
76
|
serverId,
|
|
@@ -80,10 +81,11 @@ export class NeuroLinkMCPClient extends EventEmitter {
|
|
|
80
81
|
}
|
|
81
82
|
}
|
|
82
83
|
// If it has a direct text property
|
|
83
|
-
|
|
84
|
+
const textResult = result;
|
|
85
|
+
if (textResult.text) {
|
|
84
86
|
return {
|
|
85
87
|
success: true,
|
|
86
|
-
data: { text:
|
|
88
|
+
data: { text: textResult.text },
|
|
87
89
|
metadata: {
|
|
88
90
|
toolName,
|
|
89
91
|
serverId,
|
|
@@ -128,7 +130,7 @@ export class NeuroLinkMCPClient extends EventEmitter {
|
|
|
128
130
|
*/
|
|
129
131
|
getTools() {
|
|
130
132
|
const tools = {};
|
|
131
|
-
for (const [name, tool] of this.tools) {
|
|
133
|
+
for (const [name, tool] of Array.from(this.tools.entries())) {
|
|
132
134
|
tools[name] = {
|
|
133
135
|
name: name, // Include the tool name as a property
|
|
134
136
|
description: tool.description,
|
|
@@ -20,7 +20,7 @@ export interface ContextRequest {
|
|
|
20
20
|
frameworkType?: "react" | "vue" | "svelte" | "next" | "nuxt" | "sveltekit";
|
|
21
21
|
permissions?: string[];
|
|
22
22
|
securityLevel?: "public" | "private" | "organization";
|
|
23
|
-
[key: string]:
|
|
23
|
+
[key: string]: unknown;
|
|
24
24
|
}
|
|
25
25
|
/**
|
|
26
26
|
* Context manager for creating and managing execution contexts
|