@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
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Provider-specific type definitions for NeuroLink
|
|
3
|
+
* Replaces 'any' types in provider implementations
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* Type guard for provider error
|
|
7
|
+
*/
|
|
8
|
+
export function isProviderError(error) {
|
|
9
|
+
return error instanceof Error && "provider" in error;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Type guard for token usage
|
|
13
|
+
*/
|
|
14
|
+
export function isTokenUsage(value) {
|
|
15
|
+
return (typeof value === "object" &&
|
|
16
|
+
value !== null &&
|
|
17
|
+
"inputTokens" in value &&
|
|
18
|
+
"outputTokens" in value &&
|
|
19
|
+
"totalTokens" in value &&
|
|
20
|
+
typeof value.inputTokens === "number" &&
|
|
21
|
+
typeof value.outputTokens === "number" &&
|
|
22
|
+
typeof value.totalTokens === "number");
|
|
23
|
+
}
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import type { ZodType, ZodTypeDef } from "zod";
|
|
2
2
|
import type { Tool, Schema } from "ai";
|
|
3
3
|
import type { AIProviderName, AnalyticsData, EvaluationData } from "../core/types.js";
|
|
4
|
+
import type { UnknownRecord, Unknown } from "./common.js";
|
|
4
5
|
/**
|
|
5
6
|
* Interface for tool execution calls
|
|
6
7
|
*/
|
|
7
8
|
export interface ToolCall {
|
|
8
9
|
toolName: string;
|
|
9
|
-
parameters:
|
|
10
|
+
parameters: UnknownRecord;
|
|
10
11
|
id?: string;
|
|
11
12
|
}
|
|
12
13
|
/**
|
|
@@ -15,7 +16,7 @@ export interface ToolCall {
|
|
|
15
16
|
export interface ToolResult {
|
|
16
17
|
toolName: string;
|
|
17
18
|
status: "success" | "failure";
|
|
18
|
-
output?:
|
|
19
|
+
output?: Unknown;
|
|
19
20
|
error?: string;
|
|
20
21
|
id?: string;
|
|
21
22
|
executionTime?: number;
|
|
@@ -48,7 +49,7 @@ export interface StreamOptions {
|
|
|
48
49
|
maxSteps?: number;
|
|
49
50
|
enableEvaluation?: boolean;
|
|
50
51
|
enableAnalytics?: boolean;
|
|
51
|
-
context?:
|
|
52
|
+
context?: UnknownRecord;
|
|
52
53
|
evaluationDomain?: string;
|
|
53
54
|
toolUsageContext?: string;
|
|
54
55
|
conversationHistory?: Array<{
|
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Tool system type definitions for NeuroLink
|
|
3
|
+
* Replaces 'any' types in tool registration and execution
|
|
4
|
+
*/
|
|
5
|
+
import { z } from "zod";
|
|
6
|
+
import type { Result, JsonValue, ErrorInfo } from "./common.js";
|
|
7
|
+
/**
|
|
8
|
+
* Tool parameter schema types
|
|
9
|
+
*/
|
|
10
|
+
export type ToolParameterSchema = z.ZodSchema | Record<string, JsonValue>;
|
|
11
|
+
/**
|
|
12
|
+
* Standard tool input parameters
|
|
13
|
+
*/
|
|
14
|
+
export interface BaseToolArgs {
|
|
15
|
+
[key: string]: JsonValue | undefined;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Tool execution arguments with specific common patterns
|
|
19
|
+
*/
|
|
20
|
+
export interface ToolArgs extends BaseToolArgs {
|
|
21
|
+
input?: JsonValue;
|
|
22
|
+
data?: JsonValue;
|
|
23
|
+
options?: JsonValue;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Tool execution metadata
|
|
27
|
+
*/
|
|
28
|
+
export interface ToolExecutionMetadata {
|
|
29
|
+
requestId?: string;
|
|
30
|
+
startTime?: number;
|
|
31
|
+
version?: string;
|
|
32
|
+
[key: string]: JsonValue | undefined;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Tool execution context
|
|
36
|
+
*/
|
|
37
|
+
export interface ToolContext {
|
|
38
|
+
sessionId?: string;
|
|
39
|
+
userId?: string;
|
|
40
|
+
aiProvider?: string;
|
|
41
|
+
metadata?: ToolExecutionMetadata;
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Tool execution result metadata
|
|
45
|
+
*/
|
|
46
|
+
export interface ToolResultMetadata {
|
|
47
|
+
toolName?: string;
|
|
48
|
+
executionTime?: number;
|
|
49
|
+
timestamp?: number;
|
|
50
|
+
source?: string;
|
|
51
|
+
version?: string;
|
|
52
|
+
serverId?: string;
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Tool execution result
|
|
56
|
+
*/
|
|
57
|
+
export interface ToolResult<T = JsonValue> extends Result<T, ErrorInfo> {
|
|
58
|
+
success: boolean;
|
|
59
|
+
data?: T;
|
|
60
|
+
error?: ErrorInfo;
|
|
61
|
+
metadata?: ToolResultMetadata;
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* Tool metadata for registration
|
|
65
|
+
*/
|
|
66
|
+
export interface ToolMetadata {
|
|
67
|
+
category?: string;
|
|
68
|
+
version?: string;
|
|
69
|
+
author?: string;
|
|
70
|
+
tags?: string[];
|
|
71
|
+
documentation?: string;
|
|
72
|
+
[key: string]: JsonValue | undefined;
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* Tool definition interface
|
|
76
|
+
*/
|
|
77
|
+
export interface ToolDefinition<TArgs = ToolArgs, TResult = JsonValue> {
|
|
78
|
+
description: string;
|
|
79
|
+
parameters?: ToolParameterSchema;
|
|
80
|
+
metadata?: ToolMetadata;
|
|
81
|
+
execute: (args: TArgs, context?: ToolContext) => Promise<ToolResult<TResult>> | ToolResult<TResult>;
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* Simple tool interface (for SDK)
|
|
85
|
+
*/
|
|
86
|
+
export interface SimpleTool<TArgs = ToolArgs, TResult = JsonValue> {
|
|
87
|
+
description: string;
|
|
88
|
+
parameters?: z.ZodSchema;
|
|
89
|
+
metadata?: ToolMetadata;
|
|
90
|
+
execute: (args: TArgs, context?: ToolContext) => Promise<TResult> | TResult;
|
|
91
|
+
}
|
|
92
|
+
/**
|
|
93
|
+
* Tool registry entry
|
|
94
|
+
*/
|
|
95
|
+
export interface ToolRegistryEntry {
|
|
96
|
+
name: string;
|
|
97
|
+
description: string;
|
|
98
|
+
serverId?: string;
|
|
99
|
+
isImplemented?: boolean;
|
|
100
|
+
parameters?: ToolParameterSchema;
|
|
101
|
+
execute?: ToolDefinition["execute"];
|
|
102
|
+
}
|
|
103
|
+
/**
|
|
104
|
+
* Tool execution information
|
|
105
|
+
*/
|
|
106
|
+
export interface ToolExecution {
|
|
107
|
+
toolName: string;
|
|
108
|
+
args: ToolArgs;
|
|
109
|
+
result: ToolResult;
|
|
110
|
+
executionTime: number;
|
|
111
|
+
timestamp: number;
|
|
112
|
+
}
|
|
113
|
+
/**
|
|
114
|
+
* Available tool information
|
|
115
|
+
*/
|
|
116
|
+
export interface AvailableTool {
|
|
117
|
+
name: string;
|
|
118
|
+
description: string;
|
|
119
|
+
serverId?: string;
|
|
120
|
+
toolName?: string;
|
|
121
|
+
parameters?: ToolParameterSchema;
|
|
122
|
+
}
|
|
123
|
+
/**
|
|
124
|
+
* Tool validation options
|
|
125
|
+
*/
|
|
126
|
+
export interface ToolValidationOptions {
|
|
127
|
+
customValidator?: (toolName: string, args: ToolArgs) => boolean | Promise<boolean>;
|
|
128
|
+
validateSchema?: boolean;
|
|
129
|
+
allowUnknownProperties?: boolean;
|
|
130
|
+
}
|
|
131
|
+
/**
|
|
132
|
+
* Tool call information (for AI SDK integration)
|
|
133
|
+
*/
|
|
134
|
+
export interface ToolCall {
|
|
135
|
+
toolName: string;
|
|
136
|
+
parameters: ToolArgs;
|
|
137
|
+
id?: string;
|
|
138
|
+
}
|
|
139
|
+
/**
|
|
140
|
+
* Tool call result (for AI SDK integration)
|
|
141
|
+
*/
|
|
142
|
+
export interface ToolCallResult {
|
|
143
|
+
id?: string;
|
|
144
|
+
result: ToolResult;
|
|
145
|
+
formattedForAI: string;
|
|
146
|
+
}
|
|
147
|
+
/**
|
|
148
|
+
* Type guard for tool result
|
|
149
|
+
*/
|
|
150
|
+
export declare function isToolResult(value: unknown): value is ToolResult;
|
|
151
|
+
/**
|
|
152
|
+
* Type guard for tool definition
|
|
153
|
+
*/
|
|
154
|
+
export declare function isToolDefinition(value: unknown): value is ToolDefinition;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Tool system type definitions for NeuroLink
|
|
3
|
+
* Replaces 'any' types in tool registration and execution
|
|
4
|
+
*/
|
|
5
|
+
import { z } from "zod";
|
|
6
|
+
/**
|
|
7
|
+
* Type guard for tool result
|
|
8
|
+
*/
|
|
9
|
+
export function isToolResult(value) {
|
|
10
|
+
return (typeof value === "object" &&
|
|
11
|
+
value !== null &&
|
|
12
|
+
"success" in value &&
|
|
13
|
+
typeof value.success === "boolean");
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Type guard for tool definition
|
|
17
|
+
*/
|
|
18
|
+
export function isToolDefinition(value) {
|
|
19
|
+
return (typeof value === "object" &&
|
|
20
|
+
value !== null &&
|
|
21
|
+
"description" in value &&
|
|
22
|
+
"execute" in value &&
|
|
23
|
+
typeof value.description === "string" &&
|
|
24
|
+
typeof value.execute === "function");
|
|
25
|
+
}
|
package/dist/utils/logger.d.ts
CHANGED
|
@@ -4,9 +4,9 @@
|
|
|
4
4
|
* Provides conditional logging based on NEUROLINK_DEBUG environment variable
|
|
5
5
|
*/
|
|
6
6
|
export declare const logger: {
|
|
7
|
-
debug: (...args:
|
|
8
|
-
info: (...args:
|
|
9
|
-
warn: (...args:
|
|
10
|
-
error: (...args:
|
|
11
|
-
always: (...args:
|
|
7
|
+
debug: (...args: unknown[]) => void;
|
|
8
|
+
info: (...args: unknown[]) => void;
|
|
9
|
+
warn: (...args: unknown[]) => void;
|
|
10
|
+
error: (...args: unknown[]) => void;
|
|
11
|
+
always: (...args: unknown[]) => void;
|
|
12
12
|
};
|
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
* - Proper error classification
|
|
8
8
|
* - Rate-limit friendly validation
|
|
9
9
|
*/
|
|
10
|
+
import type { UnknownRecord } from "../types/common.js";
|
|
10
11
|
export interface ProviderValidationResult {
|
|
11
12
|
configured: boolean;
|
|
12
13
|
formatValid: boolean;
|
|
@@ -15,7 +16,7 @@ export interface ProviderValidationResult {
|
|
|
15
16
|
error?: string;
|
|
16
17
|
errorType?: "config" | "format" | "auth" | "network" | "quota" | "unknown";
|
|
17
18
|
responseTime?: number;
|
|
18
|
-
details?:
|
|
19
|
+
details?: UnknownRecord;
|
|
19
20
|
}
|
|
20
21
|
/**
|
|
21
22
|
* Validate API key format for a specific provider
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@juspay/neurolink",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "6.0.0",
|
|
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",
|