@juspay/neurolink 5.2.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 +82 -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/factories/command-factory.js +6 -5
- 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 +57 -23
- package/dist/core/constants.d.ts +1 -0
- package/dist/core/constants.js +1 -0
- 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 +57 -23
- package/dist/lib/core/constants.d.ts +1 -0
- package/dist/lib/core/constants.js +1 -0
- 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 +3 -1
- package/dist/lib/mcp/client.js +13 -10
- package/dist/lib/mcp/context-manager.d.ts +2 -1
- package/dist/lib/mcp/context-manager.js +8 -4
- 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 +14 -0
- package/dist/lib/mcp/function-calling.js +133 -34
- 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.d.ts +1 -0
- package/dist/lib/mcp/neurolink-mcp-client.js +22 -6
- 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 +66 -4
- package/dist/lib/providers/function-calling-provider.js +209 -10
- 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/mcp-provider.js +20 -5
- 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/streaming/streaming-manager.js +11 -10
- 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 +13 -12
- package/dist/lib/telemetry/telemetry-service.js +9 -8
- 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 +3 -1
- package/dist/mcp/client.js +13 -10
- package/dist/mcp/context-manager.d.ts +2 -1
- package/dist/mcp/context-manager.js +8 -4
- 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 +14 -0
- package/dist/mcp/function-calling.js +133 -34
- 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.d.ts +1 -0
- package/dist/mcp/neurolink-mcp-client.js +22 -6
- 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 +66 -4
- package/dist/providers/function-calling-provider.js +209 -10
- 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/mcp-provider.js +20 -5
- 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/streaming/streaming-manager.js +11 -10
- 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 +14 -12
- package/dist/telemetry/telemetry-service.js +9 -8
- 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 +12 -10
|
@@ -169,10 +169,12 @@ export class PluginManager {
|
|
|
169
169
|
return false;
|
|
170
170
|
}
|
|
171
171
|
const obj = manifest;
|
|
172
|
-
return (typeof obj.name === "string" &&
|
|
172
|
+
return Boolean(typeof obj.name === "string" &&
|
|
173
173
|
typeof obj.version === "string" &&
|
|
174
174
|
typeof obj.main === "string" &&
|
|
175
|
-
obj.engine
|
|
175
|
+
typeof obj.engine === "object" &&
|
|
176
|
+
obj.engine &&
|
|
177
|
+
"neurolink" in obj.engine &&
|
|
176
178
|
typeof obj.description === "string" &&
|
|
177
179
|
Array.isArray(obj.permissions));
|
|
178
180
|
}
|
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
*/
|
|
5
5
|
import { MCP } from "../../contracts/mcp-contract.js";
|
|
6
6
|
import type { MCPMetadata, ExecutionContext } from "../../contracts/mcp-contract.js";
|
|
7
|
+
import type { UnknownRecord } from "../../../types/common.js";
|
|
7
8
|
interface FileSystemConfig {
|
|
8
9
|
basePath: string;
|
|
9
10
|
allowedExtensions?: string[];
|
|
@@ -12,11 +13,11 @@ interface FileSystemArgs {
|
|
|
12
13
|
operation: "readFile" | "writeFile" | "listFiles" | "createDir";
|
|
13
14
|
path: string;
|
|
14
15
|
content?: string;
|
|
15
|
-
options?:
|
|
16
|
+
options?: UnknownRecord;
|
|
16
17
|
}
|
|
17
18
|
interface FileSystemResult {
|
|
18
19
|
success: boolean;
|
|
19
|
-
data?:
|
|
20
|
+
data?: UnknownRecord;
|
|
20
21
|
error?: string;
|
|
21
22
|
}
|
|
22
23
|
/**
|
|
@@ -77,7 +77,8 @@ export class FileSystemMCP extends MCP {
|
|
|
77
77
|
data: {
|
|
78
78
|
content,
|
|
79
79
|
size: stats.size,
|
|
80
|
-
lastModified: stats.mtime
|
|
80
|
+
lastModified: stats.mtime ||
|
|
81
|
+
new Date(stats.mtimeMs || Date.now()),
|
|
81
82
|
path: filePath,
|
|
82
83
|
},
|
|
83
84
|
};
|
|
@@ -104,7 +105,9 @@ export class FileSystemMCP extends MCP {
|
|
|
104
105
|
name: item,
|
|
105
106
|
type: stats.isDirectory() ? "directory" : "file",
|
|
106
107
|
size: stats.isFile() ? stats.size : undefined,
|
|
107
|
-
lastModified: stats.mtime
|
|
108
|
+
lastModified: stats.mtime ||
|
|
109
|
+
new Date(stats.mtimeMs ||
|
|
110
|
+
Date.now()),
|
|
108
111
|
});
|
|
109
112
|
}
|
|
110
113
|
catch {
|
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
* Based on research document recommendations
|
|
5
5
|
*/
|
|
6
6
|
import { MCP, type MCPMetadata, type ExecutionContext } from "../contracts/mcp-contract.js";
|
|
7
|
+
import type { Unknown } from "../../types/common.js";
|
|
7
8
|
/**
|
|
8
9
|
* FileSystem MCP Configuration
|
|
9
10
|
*/
|
|
@@ -29,7 +30,7 @@ export declare class FileSystemMCP extends MCP<FileSystemConfig> {
|
|
|
29
30
|
config: FileSystemConfig;
|
|
30
31
|
readonly metadata: MCPMetadata;
|
|
31
32
|
initialize(config: FileSystemConfig): Promise<void>;
|
|
32
|
-
execute(context: ExecutionContext, args: FileSystemArgs): Promise<
|
|
33
|
+
execute(context: ExecutionContext, args: FileSystemArgs): Promise<Unknown>;
|
|
33
34
|
private resolvePath;
|
|
34
35
|
dispose(): Promise<void>;
|
|
35
36
|
}
|
package/dist/mcp/registry.d.ts
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
* MCP Registry - Industry Standard Interface with camelCase
|
|
3
3
|
*/
|
|
4
4
|
import type { DiscoveredMcp, ExecutionContext, ToolInfo } from "./contracts/mcpContract.js";
|
|
5
|
+
import type { UnknownRecord } from "../types/common.js";
|
|
5
6
|
/**
|
|
6
7
|
* MCP Registry interface with optional methods for maximum flexibility
|
|
7
8
|
*/
|
|
@@ -59,7 +60,7 @@ export declare class MCPRegistry implements McpRegistry {
|
|
|
59
60
|
/**
|
|
60
61
|
* Execute a tool (legacy sync version)
|
|
61
62
|
*/
|
|
62
|
-
executeToolSync(toolName: string, args?: unknown):
|
|
63
|
+
executeToolSync(toolName: string, args?: unknown): UnknownRecord;
|
|
63
64
|
/**
|
|
64
65
|
* List all tools (legacy sync version)
|
|
65
66
|
*/
|
package/dist/mcp/registry.js
CHANGED
|
@@ -58,7 +58,8 @@ export class MCPRegistry {
|
|
|
58
58
|
metadata: {
|
|
59
59
|
name: serverId,
|
|
60
60
|
description: typeof serverConfig === "object" && serverConfig
|
|
61
|
-
? serverConfig.description ||
|
|
61
|
+
? serverConfig.description ||
|
|
62
|
+
"No description"
|
|
62
63
|
: "No description",
|
|
63
64
|
},
|
|
64
65
|
tools: typeof serverConfig === "object" && serverConfig
|
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
* Security Manager - Permission-Based Sandbox for MCP Operations
|
|
3
3
|
* Implements the research blueprint's security-by-design principles
|
|
4
4
|
*/
|
|
5
|
+
import type { Stats } from "fs";
|
|
6
|
+
import type { UnknownRecord } from "../types/common.js";
|
|
5
7
|
import type { ExecutionContext } from "./contracts/mcp-contract.js";
|
|
6
8
|
/**
|
|
7
9
|
* Security levels for plugin execution
|
|
@@ -66,8 +68,8 @@ export declare class SecurityManager {
|
|
|
66
68
|
readFile(filePath: string, encoding?: string): Promise<string | Buffer>;
|
|
67
69
|
writeFile(filePath: string, content: string | Buffer): Promise<void>;
|
|
68
70
|
readdir(dirPath: string): Promise<string[]>;
|
|
69
|
-
stat(filePath: string): Promise<
|
|
70
|
-
mkdir(dirPath: string, options?:
|
|
71
|
+
stat(filePath: string): Promise<Stats>;
|
|
72
|
+
mkdir(dirPath: string, options?: UnknownRecord): Promise<void>;
|
|
71
73
|
exists(filePath: string): Promise<boolean>;
|
|
72
74
|
};
|
|
73
75
|
/**
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
* NeuroLink Direct Tools Server
|
|
3
3
|
* Wraps the agent direct tools as an MCP server for proper registration
|
|
4
4
|
*/
|
|
5
|
+
import { z } from "zod";
|
|
5
6
|
import { createMCPServer } from "../../factory.js";
|
|
6
7
|
import { directAgentTools } from "../../../agent/direct-tools.js";
|
|
7
8
|
import { logger } from "../../../utils/logger.js";
|
|
@@ -22,9 +23,18 @@ Object.entries(directAgentTools).forEach(([toolName, toolDef]) => {
|
|
|
22
23
|
// The toolDef is a Vercel AI SDK Tool object
|
|
23
24
|
// Extract properties from the Tool object
|
|
24
25
|
const toolSpec = toolDef._spec || toolDef;
|
|
25
|
-
const description = toolSpec
|
|
26
|
-
|
|
27
|
-
|
|
26
|
+
const description = typeof toolSpec === "object" &&
|
|
27
|
+
toolSpec &&
|
|
28
|
+
"description" in toolSpec &&
|
|
29
|
+
typeof toolSpec.description === "string"
|
|
30
|
+
? toolSpec.description
|
|
31
|
+
: `Direct tool: ${toolName}`;
|
|
32
|
+
const inputSchema = typeof toolSpec === "object" && toolSpec && "parameters" in toolSpec
|
|
33
|
+
? toolSpec.parameters
|
|
34
|
+
: undefined;
|
|
35
|
+
const execute = typeof toolSpec === "object" && toolSpec && "execute" in toolSpec
|
|
36
|
+
? toolSpec.execute
|
|
37
|
+
: undefined;
|
|
28
38
|
directToolsServer.registerTool({
|
|
29
39
|
name: toolName,
|
|
30
40
|
description: description,
|
|
@@ -36,12 +46,15 @@ Object.entries(directAgentTools).forEach(([toolName, toolDef]) => {
|
|
|
36
46
|
try {
|
|
37
47
|
logger.debug(`[Direct Tools] Executing ${toolName} with params:`, params);
|
|
38
48
|
// Execute the direct tool
|
|
49
|
+
if (!execute || typeof execute !== "function") {
|
|
50
|
+
throw new Error(`Tool ${toolName} has no execute function`);
|
|
51
|
+
}
|
|
39
52
|
const result = await execute(params);
|
|
40
53
|
// Convert direct tool result to ToolResult format
|
|
41
|
-
if (result
|
|
54
|
+
if (result?.success) {
|
|
42
55
|
return {
|
|
43
56
|
success: true,
|
|
44
|
-
data: result,
|
|
57
|
+
data: result.data || result,
|
|
45
58
|
usage: {
|
|
46
59
|
executionTime: Date.now() - startTime,
|
|
47
60
|
},
|
|
@@ -56,7 +69,7 @@ Object.entries(directAgentTools).forEach(([toolName, toolDef]) => {
|
|
|
56
69
|
return {
|
|
57
70
|
success: false,
|
|
58
71
|
data: null,
|
|
59
|
-
error: result
|
|
72
|
+
error: String(result?.error) || "Unknown error",
|
|
60
73
|
usage: {
|
|
61
74
|
executionTime: Date.now() - startTime,
|
|
62
75
|
},
|
|
@@ -3,19 +3,4 @@
|
|
|
3
3
|
* AI-focused MCP tools for usage analysis, performance benchmarking, and parameter optimization
|
|
4
4
|
* Tools: analyze-ai-usage, benchmark-provider-performance, optimize-prompt-parameters
|
|
5
5
|
*/
|
|
6
|
-
|
|
7
|
-
/**
|
|
8
|
-
* AI Usage Analysis Tool
|
|
9
|
-
* Analyzes AI usage patterns, token consumption, and cost optimization opportunities
|
|
10
|
-
*/
|
|
11
|
-
export declare const analyzeAIUsageTool: NeuroLinkMCPTool;
|
|
12
|
-
/**
|
|
13
|
-
* Provider Performance Benchmarking Tool
|
|
14
|
-
* Benchmarks AI provider performance across latency, quality, and cost metrics
|
|
15
|
-
*/
|
|
16
|
-
export declare const benchmarkProviderPerformanceTool: NeuroLinkMCPTool;
|
|
17
|
-
/**
|
|
18
|
-
* Prompt Parameter Optimization Tool
|
|
19
|
-
* Optimizes prompt parameters (temperature, max tokens) for better AI output quality and efficiency
|
|
20
|
-
*/
|
|
21
|
-
export declare const optimizePromptParametersTool: NeuroLinkMCPTool;
|
|
6
|
+
export {};
|
|
@@ -77,7 +77,7 @@ const OptimizeParametersSchema = z.object({
|
|
|
77
77
|
* AI Usage Analysis Tool
|
|
78
78
|
* Analyzes AI usage patterns, token consumption, and cost optimization opportunities
|
|
79
79
|
*/
|
|
80
|
-
|
|
80
|
+
const analyzeAIUsageTool = {
|
|
81
81
|
name: "analyze-ai-usage",
|
|
82
82
|
description: "Analyze AI usage patterns, token consumption, and cost optimization opportunities",
|
|
83
83
|
category: "ai-analysis",
|
|
@@ -86,9 +86,10 @@ export const analyzeAIUsageTool = {
|
|
|
86
86
|
permissions: ["read", "analytics"],
|
|
87
87
|
version: "1.2.0", // Updated version with real AI
|
|
88
88
|
execute: async (params, context) => {
|
|
89
|
+
const typedParams = params;
|
|
89
90
|
const startTime = Date.now();
|
|
90
91
|
try {
|
|
91
|
-
console.log(`[AI-Analysis] Starting real AI-powered usage analysis for timeRange: ${
|
|
92
|
+
console.log(`[AI-Analysis] Starting real AI-powered usage analysis for timeRange: ${typedParams.timeRange}`);
|
|
92
93
|
const providerName = await getBestProvider();
|
|
93
94
|
const provider = await AIProviderFactory.createProvider(providerName);
|
|
94
95
|
if (!provider) {
|
|
@@ -96,8 +97,8 @@ export const analyzeAIUsageTool = {
|
|
|
96
97
|
}
|
|
97
98
|
const analysisPrompt = `
|
|
98
99
|
Analyze hypothetical AI usage data for a project based on the following parameters.
|
|
99
|
-
Time Range: ${
|
|
100
|
-
Provider Focus: ${
|
|
100
|
+
Time Range: ${typedParams.timeRange}
|
|
101
|
+
Provider Focus: ${typedParams.provider || "all"}
|
|
101
102
|
|
|
102
103
|
Generate a realistic analysis including:
|
|
103
104
|
1. A summary of usage statistics (totalRequests, totalTokens).
|
|
@@ -161,7 +162,7 @@ export const analyzeAIUsageTool = {
|
|
|
161
162
|
* Provider Performance Benchmarking Tool
|
|
162
163
|
* Benchmarks AI provider performance across latency, quality, and cost metrics
|
|
163
164
|
*/
|
|
164
|
-
|
|
165
|
+
const benchmarkProviderPerformanceTool = {
|
|
165
166
|
name: "benchmark-provider-performance",
|
|
166
167
|
description: "Benchmark AI provider performance across latency, quality, and cost metrics",
|
|
167
168
|
category: "ai-analysis",
|
|
@@ -170,10 +171,11 @@ export const benchmarkProviderPerformanceTool = {
|
|
|
170
171
|
permissions: ["read", "benchmark"],
|
|
171
172
|
version: "1.1.0", // Updated version with real AI
|
|
172
173
|
execute: async (params, context) => {
|
|
174
|
+
const typedParams = params;
|
|
173
175
|
const startTime = Date.now();
|
|
174
176
|
try {
|
|
175
|
-
const providersToTest =
|
|
176
|
-
const testPrompts =
|
|
177
|
+
const providersToTest = typedParams.providers || getAvailableProviders();
|
|
178
|
+
const testPrompts = typedParams.testPrompts || [
|
|
177
179
|
"Explain quantum computing in simple terms",
|
|
178
180
|
];
|
|
179
181
|
const benchmarkResults = [];
|
|
@@ -188,11 +190,11 @@ export const benchmarkProviderPerformanceTool = {
|
|
|
188
190
|
}
|
|
189
191
|
let totalLatency = 0, totalTokens = 0, successfulTests = 0;
|
|
190
192
|
for (const prompt of testPrompts) {
|
|
191
|
-
for (let i = 0; i <
|
|
193
|
+
for (let i = 0; i < typedParams.iterations; i++) {
|
|
192
194
|
const testStartTime = Date.now();
|
|
193
195
|
const result = await provider.generate({
|
|
194
196
|
prompt: prompt,
|
|
195
|
-
maxTokens:
|
|
197
|
+
maxTokens: typedParams.maxTokens,
|
|
196
198
|
});
|
|
197
199
|
if (result && result.usage) {
|
|
198
200
|
totalLatency += Date.now() - testStartTime;
|
|
@@ -208,7 +210,8 @@ export const benchmarkProviderPerformanceTool = {
|
|
|
208
210
|
? Math.round(totalLatency / successfulTests)
|
|
209
211
|
: 0,
|
|
210
212
|
totalTokens: totalTokens,
|
|
211
|
-
successRate: (successfulTests /
|
|
213
|
+
successRate: (successfulTests /
|
|
214
|
+
(testPrompts.length * typedParams.iterations)) *
|
|
212
215
|
100,
|
|
213
216
|
},
|
|
214
217
|
});
|
|
@@ -255,7 +258,7 @@ export const benchmarkProviderPerformanceTool = {
|
|
|
255
258
|
* Prompt Parameter Optimization Tool
|
|
256
259
|
* Optimizes prompt parameters (temperature, max tokens) for better AI output quality and efficiency
|
|
257
260
|
*/
|
|
258
|
-
|
|
261
|
+
const optimizePromptParametersTool = {
|
|
259
262
|
name: "optimize-prompt-parameters",
|
|
260
263
|
description: "Optimize prompt parameters (temperature, max tokens) for better AI output quality and efficiency",
|
|
261
264
|
category: "ai-optimization",
|
|
@@ -264,9 +267,10 @@ export const optimizePromptParametersTool = {
|
|
|
264
267
|
permissions: ["read", "optimize"],
|
|
265
268
|
version: "1.1.0", // Updated version with real AI
|
|
266
269
|
execute: async (params, context) => {
|
|
270
|
+
const typedParams = params;
|
|
267
271
|
const startTime = Date.now();
|
|
268
272
|
try {
|
|
269
|
-
const providerName =
|
|
273
|
+
const providerName = typedParams.provider || (await getBestProvider());
|
|
270
274
|
const provider = await AIProviderFactory.createProvider(providerName);
|
|
271
275
|
if (!provider) {
|
|
272
276
|
throw new Error(`Failed to create provider: ${providerName}`);
|
|
@@ -275,9 +279,9 @@ export const optimizePromptParametersTool = {
|
|
|
275
279
|
const temperatures = [0.2, 0.7, 1.0]; // Test a range of temperatures
|
|
276
280
|
for (const temp of temperatures) {
|
|
277
281
|
const result = await provider.generate({
|
|
278
|
-
prompt:
|
|
282
|
+
prompt: typedParams.prompt,
|
|
279
283
|
temperature: temp,
|
|
280
|
-
maxTokens:
|
|
284
|
+
maxTokens: typedParams.targetLength || 250,
|
|
281
285
|
});
|
|
282
286
|
if (result) {
|
|
283
287
|
optimizationResults.push({
|
|
@@ -292,7 +296,7 @@ export const optimizePromptParametersTool = {
|
|
|
292
296
|
throw new Error("Failed to create analysis provider.");
|
|
293
297
|
}
|
|
294
298
|
const analysisPrompt = `
|
|
295
|
-
Analyze the following AI-generated responses for the prompt "${
|
|
299
|
+
Analyze the following AI-generated responses for the prompt "${typedParams.prompt}" based on the optimization goal of "${typedParams.optimizeFor}".
|
|
296
300
|
|
|
297
301
|
Responses:
|
|
298
302
|
${optimizationResults.map((r, i) => `Response ${i + 1} (Temp: ${r.parameters.temperature}):\n${r.output}`).join("\n\n")}
|
|
@@ -313,8 +317,8 @@ export const optimizePromptParametersTool = {
|
|
|
313
317
|
success: true,
|
|
314
318
|
data: {
|
|
315
319
|
optimization: {
|
|
316
|
-
originalPrompt:
|
|
317
|
-
optimizeFor:
|
|
320
|
+
originalPrompt: typedParams.prompt,
|
|
321
|
+
optimizeFor: typedParams.optimizeFor,
|
|
318
322
|
provider: providerName,
|
|
319
323
|
},
|
|
320
324
|
results: optimizationResults,
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* Integrates AIProviderFactory with Factory-First MCP architecture
|
|
5
5
|
*/
|
|
6
6
|
/**
|
|
7
|
-
* AI Core Server - Central hub for AI provider
|
|
8
|
-
* Provides
|
|
7
|
+
* AI Core Server - Central hub for AI provider management
|
|
8
|
+
* Provides provider selection and status checking functionality
|
|
9
9
|
*/
|
|
10
10
|
export declare const aiCoreServer: import("../../factory.js").NeuroLinkMCPServer;
|
|
@@ -8,54 +8,23 @@ import { createMCPServer } from "../../factory.js";
|
|
|
8
8
|
import { ServiceRegistry } from "../../../core/service-registry.js";
|
|
9
9
|
import { getBestProvider, getAvailableProviders, } from "../../../utils/providerUtils.js";
|
|
10
10
|
import { logger } from "../../../utils/logger.js";
|
|
11
|
-
import { analyzeAIUsageTool, benchmarkProviderPerformanceTool, optimizePromptParametersTool, } from "./ai-analysis-tools.js";
|
|
12
|
-
import { generateTestCasesTool, refactorCodeTool, generateDocumentationTool, debugAIOutputTool, } from "./ai-workflow-tools.js";
|
|
13
11
|
/**
|
|
14
|
-
* AI Core Server - Central hub for AI provider
|
|
15
|
-
* Provides
|
|
12
|
+
* AI Core Server - Central hub for AI provider management
|
|
13
|
+
* Provides provider selection and status checking functionality
|
|
16
14
|
*/
|
|
17
15
|
export const aiCoreServer = createMCPServer({
|
|
18
16
|
id: "neurolink-ai-core",
|
|
19
17
|
title: "NeuroLink AI Core",
|
|
20
|
-
description: "Core AI provider
|
|
18
|
+
description: "Core AI provider management with automatic fallback and status monitoring",
|
|
21
19
|
category: "ai-providers",
|
|
22
20
|
version: "1.2.0",
|
|
23
21
|
capabilities: [
|
|
24
|
-
"text-generation",
|
|
25
22
|
"provider-selection",
|
|
26
23
|
"automatic-fallback",
|
|
27
|
-
"usage-tracking",
|
|
28
24
|
"multi-provider-support",
|
|
29
|
-
"
|
|
30
|
-
"test-generation",
|
|
31
|
-
"code-refactoring",
|
|
32
|
-
"documentation-generation",
|
|
33
|
-
"ai-debugging",
|
|
25
|
+
"provider-status-monitoring",
|
|
34
26
|
],
|
|
35
27
|
});
|
|
36
|
-
/**
|
|
37
|
-
* Text Generation Input Schema
|
|
38
|
-
*/
|
|
39
|
-
const TextGenerationSchema = z.object({
|
|
40
|
-
prompt: z.string().min(1, "Prompt is required"),
|
|
41
|
-
provider: z
|
|
42
|
-
.enum([
|
|
43
|
-
"openai",
|
|
44
|
-
"bedrock",
|
|
45
|
-
"vertex",
|
|
46
|
-
"anthropic",
|
|
47
|
-
"google-ai",
|
|
48
|
-
"azure",
|
|
49
|
-
"huggingface",
|
|
50
|
-
"ollama",
|
|
51
|
-
"mistral",
|
|
52
|
-
])
|
|
53
|
-
.optional(),
|
|
54
|
-
model: z.string().optional(),
|
|
55
|
-
temperature: z.number().min(0).max(2).optional(),
|
|
56
|
-
maxTokens: z.number().positive().optional(),
|
|
57
|
-
systemPrompt: z.string().optional(),
|
|
58
|
-
});
|
|
59
28
|
/**
|
|
60
29
|
* Provider Selection Input Schema
|
|
61
30
|
*/
|
|
@@ -70,79 +39,6 @@ const ProviderSelectionSchema = z.object({
|
|
|
70
39
|
})
|
|
71
40
|
.optional(),
|
|
72
41
|
});
|
|
73
|
-
/**
|
|
74
|
-
* Register Text Generation Tool
|
|
75
|
-
* Core tool that leverages existing AIProviderFactory for text generation
|
|
76
|
-
*/
|
|
77
|
-
aiCoreServer.registerTool({
|
|
78
|
-
name: "generate",
|
|
79
|
-
description: "Generate text using AI providers with automatic fallback and provider selection",
|
|
80
|
-
category: "text-generation",
|
|
81
|
-
inputSchema: TextGenerationSchema,
|
|
82
|
-
isImplemented: true,
|
|
83
|
-
execute: async (params, context) => {
|
|
84
|
-
const startTime = Date.now();
|
|
85
|
-
try {
|
|
86
|
-
logger.debug(`[AI-Core] Starting text generation: "${params.prompt.substring(0, 50)}..."`);
|
|
87
|
-
// Use existing AIProviderFactory with best provider selection
|
|
88
|
-
const selectedProvider = params.provider || (await getBestProvider(params.provider));
|
|
89
|
-
// Get AIProviderFactory from ServiceRegistry to avoid circular dependency
|
|
90
|
-
const AIProviderFactory = await ServiceRegistry.get("AIProviderFactory");
|
|
91
|
-
const provider = await AIProviderFactory.createBestProvider(selectedProvider);
|
|
92
|
-
// Generate text using existing NeuroLink patterns
|
|
93
|
-
const result = await provider.generate({
|
|
94
|
-
prompt: params.prompt,
|
|
95
|
-
model: params.model,
|
|
96
|
-
temperature: params.temperature,
|
|
97
|
-
maxTokens: params.maxTokens,
|
|
98
|
-
systemPrompt: params.systemPrompt,
|
|
99
|
-
});
|
|
100
|
-
if (!result) {
|
|
101
|
-
throw new Error("AI provider returned null result");
|
|
102
|
-
}
|
|
103
|
-
const executionTime = Date.now() - startTime;
|
|
104
|
-
logger.debug(`[AI-Core] Text generation successful in ${executionTime}ms using ${selectedProvider}`);
|
|
105
|
-
return {
|
|
106
|
-
success: true,
|
|
107
|
-
data: {
|
|
108
|
-
text: result.content,
|
|
109
|
-
model: params.model || "default",
|
|
110
|
-
provider: selectedProvider,
|
|
111
|
-
generatedAt: new Date().toISOString(),
|
|
112
|
-
},
|
|
113
|
-
usage: {
|
|
114
|
-
tokens: result.usage?.totalTokens,
|
|
115
|
-
provider: selectedProvider,
|
|
116
|
-
model: params.model || "default",
|
|
117
|
-
executionTime,
|
|
118
|
-
},
|
|
119
|
-
metadata: {
|
|
120
|
-
toolName: "generate",
|
|
121
|
-
serverId: "neurolink-ai-core",
|
|
122
|
-
sessionId: context.sessionId,
|
|
123
|
-
timestamp: Date.now(),
|
|
124
|
-
executionTime,
|
|
125
|
-
},
|
|
126
|
-
};
|
|
127
|
-
}
|
|
128
|
-
catch (error) {
|
|
129
|
-
const executionTime = Date.now() - startTime;
|
|
130
|
-
const errorMessage = error instanceof Error ? error.message : String(error);
|
|
131
|
-
logger.debug(`[AI-Core] Text generation failed: ${errorMessage}`);
|
|
132
|
-
return {
|
|
133
|
-
success: false,
|
|
134
|
-
error: errorMessage,
|
|
135
|
-
metadata: {
|
|
136
|
-
toolName: "generate",
|
|
137
|
-
serverId: "neurolink-ai-core",
|
|
138
|
-
sessionId: context.sessionId,
|
|
139
|
-
timestamp: Date.now(),
|
|
140
|
-
executionTime,
|
|
141
|
-
},
|
|
142
|
-
};
|
|
143
|
-
}
|
|
144
|
-
},
|
|
145
|
-
});
|
|
146
42
|
/**
|
|
147
43
|
* Register Provider Selection Tool
|
|
148
44
|
* Intelligent provider selection based on requirements and availability
|
|
@@ -156,10 +52,11 @@ aiCoreServer.registerTool({
|
|
|
156
52
|
execute: async (params, context) => {
|
|
157
53
|
const startTime = Date.now();
|
|
158
54
|
try {
|
|
159
|
-
|
|
55
|
+
const typedParams = params;
|
|
56
|
+
logger.debug(`[AI-Core] Selecting provider with requirements:`, typedParams.requirements);
|
|
160
57
|
// Use existing provider selection logic
|
|
161
58
|
const availableProviders = getAvailableProviders();
|
|
162
|
-
const selectedProvider = await getBestProvider(
|
|
59
|
+
const selectedProvider = await getBestProvider(typedParams.preferred);
|
|
163
60
|
// Get provider capabilities
|
|
164
61
|
const getProviderCapabilities = (provider) => ({
|
|
165
62
|
multimodal: provider === "openai" ||
|
|
@@ -190,8 +87,8 @@ aiCoreServer.registerTool({
|
|
|
190
87
|
provider: selectedProvider,
|
|
191
88
|
available: availableProviders,
|
|
192
89
|
capabilities,
|
|
193
|
-
reason:
|
|
194
|
-
? `Preferred provider ${
|
|
90
|
+
reason: typedParams.preferred
|
|
91
|
+
? `Preferred provider ${typedParams.preferred} selected`
|
|
195
92
|
: "Best available provider selected",
|
|
196
93
|
selectedAt: new Date().toISOString(),
|
|
197
94
|
},
|
|
@@ -241,11 +138,12 @@ aiCoreServer.registerTool({
|
|
|
241
138
|
execute: async (params, context) => {
|
|
242
139
|
const startTime = Date.now();
|
|
243
140
|
try {
|
|
244
|
-
|
|
141
|
+
const typedParams = params;
|
|
142
|
+
logger.debug(`[AI-Core] Checking provider status for: ${typedParams.provider || "all providers"}`);
|
|
245
143
|
const availableProviders = getAvailableProviders();
|
|
246
144
|
const providerStatuses = [];
|
|
247
|
-
const providersToCheck =
|
|
248
|
-
? [
|
|
145
|
+
const providersToCheck = typedParams.provider
|
|
146
|
+
? [typedParams.provider]
|
|
249
147
|
: availableProviders;
|
|
250
148
|
for (const provider of providersToCheck) {
|
|
251
149
|
try {
|
|
@@ -254,7 +152,7 @@ aiCoreServer.registerTool({
|
|
|
254
152
|
providerStatuses.push({
|
|
255
153
|
provider,
|
|
256
154
|
status: isAvailable ? "available" : "unavailable",
|
|
257
|
-
capabilities:
|
|
155
|
+
capabilities: typedParams.includeCapabilities
|
|
258
156
|
? {
|
|
259
157
|
textGeneration: true,
|
|
260
158
|
multimodal: provider === "openai" ||
|
|
@@ -330,20 +228,5 @@ aiCoreServer.registerTool({
|
|
|
330
228
|
}
|
|
331
229
|
},
|
|
332
230
|
});
|
|
333
|
-
/**
|
|
334
|
-
* Register AI Analysis Tools
|
|
335
|
-
* Usage analysis, performance benchmarking, and parameter optimization
|
|
336
|
-
*/
|
|
337
|
-
aiCoreServer.registerTool(analyzeAIUsageTool);
|
|
338
|
-
aiCoreServer.registerTool(benchmarkProviderPerformanceTool);
|
|
339
|
-
aiCoreServer.registerTool(optimizePromptParametersTool);
|
|
340
|
-
/**
|
|
341
|
-
* Register AI Development Workflow Tools
|
|
342
|
-
* Test generation, code refactoring, documentation generation, and AI debugging
|
|
343
|
-
*/
|
|
344
|
-
aiCoreServer.registerTool(generateTestCasesTool);
|
|
345
|
-
aiCoreServer.registerTool(refactorCodeTool);
|
|
346
|
-
aiCoreServer.registerTool(generateDocumentationTool);
|
|
347
|
-
aiCoreServer.registerTool(debugAIOutputTool);
|
|
348
231
|
// Log successful server creation
|
|
349
|
-
logger.debug("[AI-Core] NeuroLink AI Core Server v1.2.0 created with
|
|
232
|
+
logger.debug("[AI-Core] NeuroLink AI Core Server v1.2.0 created with provider management tools:", Object.keys(aiCoreServer.tools));
|
|
@@ -2,100 +2,4 @@
|
|
|
2
2
|
* AI Development Workflow Tools
|
|
3
3
|
* Phase 1.2 Implementation - 4 specialized tools for AI development lifecycle
|
|
4
4
|
*/
|
|
5
|
-
|
|
6
|
-
import type { NeuroLinkMCPTool } from "../../factory.js";
|
|
7
|
-
/**
|
|
8
|
-
* Generate test cases for code functions
|
|
9
|
-
*/
|
|
10
|
-
export declare const generateTestCasesTool: NeuroLinkMCPTool;
|
|
11
|
-
/**
|
|
12
|
-
* Refactor code for improved quality
|
|
13
|
-
*/
|
|
14
|
-
export declare const refactorCodeTool: NeuroLinkMCPTool;
|
|
15
|
-
/**
|
|
16
|
-
* Generate documentation from code
|
|
17
|
-
*/
|
|
18
|
-
export declare const generateDocumentationTool: NeuroLinkMCPTool;
|
|
19
|
-
/**
|
|
20
|
-
* Debug AI-generated output
|
|
21
|
-
*/
|
|
22
|
-
export declare const debugAIOutputTool: NeuroLinkMCPTool;
|
|
23
|
-
export declare const aiWorkflowTools: NeuroLinkMCPTool[];
|
|
24
|
-
export declare const workflowToolSchemas: {
|
|
25
|
-
"generate-test-cases": z.ZodObject<{
|
|
26
|
-
codeFunction: z.ZodString;
|
|
27
|
-
testTypes: z.ZodDefault<z.ZodArray<z.ZodEnum<["unit", "integration", "edge-cases", "performance", "security"]>, "many">>;
|
|
28
|
-
framework: z.ZodDefault<z.ZodEnum<["jest", "mocha", "vitest", "pytest", "unittest", "rspec"]>>;
|
|
29
|
-
coverageTarget: z.ZodDefault<z.ZodNumber>;
|
|
30
|
-
includeAsyncTests: z.ZodDefault<z.ZodBoolean>;
|
|
31
|
-
}, "strip", z.ZodTypeAny, {
|
|
32
|
-
codeFunction: string;
|
|
33
|
-
testTypes: ("integration" | "performance" | "unit" | "edge-cases" | "security")[];
|
|
34
|
-
framework: "jest" | "mocha" | "vitest" | "pytest" | "unittest" | "rspec";
|
|
35
|
-
coverageTarget: number;
|
|
36
|
-
includeAsyncTests: boolean;
|
|
37
|
-
}, {
|
|
38
|
-
codeFunction: string;
|
|
39
|
-
testTypes?: ("integration" | "performance" | "unit" | "edge-cases" | "security")[] | undefined;
|
|
40
|
-
framework?: "jest" | "mocha" | "vitest" | "pytest" | "unittest" | "rspec" | undefined;
|
|
41
|
-
coverageTarget?: number | undefined;
|
|
42
|
-
includeAsyncTests?: boolean | undefined;
|
|
43
|
-
}>;
|
|
44
|
-
"refactor-code": z.ZodObject<{
|
|
45
|
-
code: z.ZodString;
|
|
46
|
-
language: z.ZodDefault<z.ZodString>;
|
|
47
|
-
objectives: z.ZodDefault<z.ZodArray<z.ZodEnum<["readability", "performance", "maintainability", "testability", "modularity", "dry-principle", "solid-principles"]>, "many">>;
|
|
48
|
-
preserveFunctionality: z.ZodDefault<z.ZodBoolean>;
|
|
49
|
-
styleGuide: z.ZodOptional<z.ZodString>;
|
|
50
|
-
}, "strip", z.ZodTypeAny, {
|
|
51
|
-
code: string;
|
|
52
|
-
language: string;
|
|
53
|
-
objectives: ("performance" | "readability" | "maintainability" | "testability" | "modularity" | "dry-principle" | "solid-principles")[];
|
|
54
|
-
preserveFunctionality: boolean;
|
|
55
|
-
styleGuide?: string | undefined;
|
|
56
|
-
}, {
|
|
57
|
-
code: string;
|
|
58
|
-
language?: string | undefined;
|
|
59
|
-
objectives?: ("performance" | "readability" | "maintainability" | "testability" | "modularity" | "dry-principle" | "solid-principles")[] | undefined;
|
|
60
|
-
preserveFunctionality?: boolean | undefined;
|
|
61
|
-
styleGuide?: string | undefined;
|
|
62
|
-
}>;
|
|
63
|
-
"generate-documentation": z.ZodObject<{
|
|
64
|
-
code: z.ZodString;
|
|
65
|
-
language: z.ZodDefault<z.ZodString>;
|
|
66
|
-
documentationType: z.ZodDefault<z.ZodEnum<["jsdoc", "markdown", "sphinx", "doxygen", "readme"]>>;
|
|
67
|
-
includeExamples: z.ZodDefault<z.ZodBoolean>;
|
|
68
|
-
detailLevel: z.ZodDefault<z.ZodEnum<["minimal", "standard", "comprehensive"]>>;
|
|
69
|
-
}, "strip", z.ZodTypeAny, {
|
|
70
|
-
code: string;
|
|
71
|
-
language: string;
|
|
72
|
-
documentationType: "jsdoc" | "markdown" | "sphinx" | "doxygen" | "readme";
|
|
73
|
-
includeExamples: boolean;
|
|
74
|
-
detailLevel: "minimal" | "standard" | "comprehensive";
|
|
75
|
-
}, {
|
|
76
|
-
code: string;
|
|
77
|
-
language?: string | undefined;
|
|
78
|
-
documentationType?: "jsdoc" | "markdown" | "sphinx" | "doxygen" | "readme" | undefined;
|
|
79
|
-
includeExamples?: boolean | undefined;
|
|
80
|
-
detailLevel?: "minimal" | "standard" | "comprehensive" | undefined;
|
|
81
|
-
}>;
|
|
82
|
-
"debug-ai-output": z.ZodObject<{
|
|
83
|
-
aiOutput: z.ZodString;
|
|
84
|
-
expectedBehavior: z.ZodString;
|
|
85
|
-
context: z.ZodOptional<z.ZodString>;
|
|
86
|
-
outputType: z.ZodDefault<z.ZodEnum<["code", "text", "structured-data", "conversation"]>>;
|
|
87
|
-
includeFixSuggestions: z.ZodDefault<z.ZodBoolean>;
|
|
88
|
-
}, "strip", z.ZodTypeAny, {
|
|
89
|
-
aiOutput: string;
|
|
90
|
-
expectedBehavior: string;
|
|
91
|
-
outputType: "text" | "code" | "structured-data" | "conversation";
|
|
92
|
-
includeFixSuggestions: boolean;
|
|
93
|
-
context?: string | undefined;
|
|
94
|
-
}, {
|
|
95
|
-
aiOutput: string;
|
|
96
|
-
expectedBehavior: string;
|
|
97
|
-
context?: string | undefined;
|
|
98
|
-
outputType?: "text" | "code" | "structured-data" | "conversation" | undefined;
|
|
99
|
-
includeFixSuggestions?: boolean | undefined;
|
|
100
|
-
}>;
|
|
101
|
-
};
|
|
5
|
+
export {};
|