@juspay/neurolink
Version:
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
107 lines (106 loc) • 2.41 kB
TypeScript
/**
* MCP Contract - Core Type Definitions
* Industry standard camelCase interfaces for maximum flexibility
*/
import type { StandardRecord } from "../../types/typeAliases.js";
/**
* Generic execution context for MCP operations
* All properties optional for maximum flexibility
*/
export interface ExecutionContext<T = StandardRecord> {
sessionId?: string;
userId?: string;
config?: T;
metadata?: StandardRecord;
cacheOptions?: CacheOptions;
fallbackOptions?: FallbackOptions;
timeoutMs?: number;
startTime?: number;
}
/**
* Cache configuration options
*/
export interface CacheOptions {
enabled?: boolean;
ttlMs?: number;
strategy?: "memory" | "writeThrough" | "cacheAside";
}
/**
* Fallback configuration options
*/
export interface FallbackOptions {
enabled?: boolean;
maxAttempts?: number;
delayMs?: number;
circuitBreaker?: boolean;
}
/**
* Tool information with extensibility
*/
export interface ToolInfo {
name: string;
description?: string;
category?: string;
serverId?: string;
inputSchema?: StandardRecord;
outputSchema?: StandardRecord;
[key: string]: unknown;
}
/**
* Discovered MCP server/plugin definition
*/
export interface DiscoveredMcp<TTools = StandardRecord> {
metadata: McpMetadata;
tools?: TTools;
capabilities?: string[];
version?: string;
configuration?: Record<string, string | number | boolean>;
[key: string]: unknown;
}
/**
* MCP server metadata
*/
export interface McpMetadata {
name: string;
description?: string;
version?: string;
author?: string;
homepage?: string;
repository?: string;
category?: string;
}
/**
* Tool execution result
*/
export interface ToolExecutionResult<T = unknown> {
result: T;
context?: ExecutionContext;
performance?: {
duration: number;
tokensUsed?: number;
cost?: number;
};
validation?: ValidationResult;
cached?: boolean;
fallback?: boolean;
}
/**
* Validation result for runtime checks
*/
export interface ValidationResult {
valid: boolean;
missing: string[];
warnings: string[];
recommendations: string[];
}
/**
* Provider status information
*/
export interface ProviderStatus {
available: boolean;
lastCheck: number;
reason?: string;
model?: string;
cost?: number;
latencyMs?: number;
}