Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
59 changes: 0 additions & 59 deletions .claude/settings.local.json

This file was deleted.

3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -112,3 +112,6 @@ test-directTools-temp/
site/
_site/
quality-metrics.json

# Claude Code
.claude/
15 changes: 1 addition & 14 deletions src/cli/factories/sagemakerCommandFactory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,20 +20,7 @@ import {
runQuickDiagnostics,
formatDiagnosticReport,
} from "../../lib/providers/sagemaker/diagnostics.js";

/**
* Secure configuration container that avoids process.env exposure
*/
interface SecureConfiguration {
accessKeyId: string;
secretAccessKey: string;
region: string;
endpointName: string;
timeout: number;
maxRetries: number;
sessionId: string;
createdAt: number;
}
import type { SecureConfiguration } from "../../lib/types/cli.js";

/**
* Factory for creating SageMaker CLI commands using the Factory Pattern
Expand Down
132 changes: 15 additions & 117 deletions src/lib/mcp/contracts/mcpContract.ts
Original file line number Diff line number Diff line change
@@ -1,121 +1,19 @@
/**
* 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> {
// Core identifiers (optional)
sessionId?: string; // Session/request identifier
userId?: string; // User identifier

// Generic extensibility (industry standard)
config?: T; // Generic configuration payload
metadata?: StandardRecord; // Flexible metadata

// Performance & resilience (standard patterns)
cacheOptions?: CacheOptions;
fallbackOptions?: FallbackOptions;
timeoutMs?: number;
startTime?: number;
}

/**
* Cache configuration options
*/
export interface CacheOptions {
enabled?: boolean;
ttlMs?: number; // Time to live (milliseconds)
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; // Generic extensibility
}

/**
* 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; // Generic extensibility
}

/**
* MCP server metadata
*/
export interface McpMetadata {
name: string;
description?: string;
version?: string;
author?: string;
homepage?: string;
repository?: string;
category?: string; // Server category (e.g., "ai-tools", "database", "api")
}

/**
* Tool execution result
*/
export interface ToolExecutionResult<T = unknown> {
result: T;
context?: ExecutionContext; // Updated context after execution
performance?: {
duration: number;
tokensUsed?: number;
cost?: number;
};
validation?: ValidationResult; // Runtime validation results
cached?: boolean; // Whether result came from cache
fallback?: boolean; // Whether result came from fallback
}

/**
* 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;
}
// Re-export for backward compatibility
export type {
DiscoveredMcp,
McpMetadata,
ProviderStatus,
// } from "../../types/mcpTypes.js";

// export type {
ToolExecutionResult,
ExecutionContext,
CacheOptions,
FallbackOptions,
ToolInfo,
ValidationResult,
} from "../../types/index.js";
Loading
Loading