solidworks-mcp-server
Version:
Clean Architecture SolidWorks MCP Server - Production-ready with SOLID principles
59 lines • 1.63 kB
TypeScript
/**
* Resource Registry for SolidWorks MCP
* Manages all available resource types and their schemas
*/
import { z } from 'zod';
import { SolidWorksResource } from './base.js';
export interface ResourceDefinition {
type: string;
name: string;
description: string;
schema: z.ZodSchema<any>;
factory: (id: string, name: string, properties: any) => SolidWorksResource;
examples?: Record<string, any>[];
}
declare class ResourceRegistry {
private resources;
/**
* Register a new resource type
*/
register(definition: ResourceDefinition): void;
/**
* Get a resource definition by type
*/
get(type: string): ResourceDefinition | undefined;
/**
* Get all registered resource types
*/
getAllTypes(): string[];
/**
* Get all resource definitions
*/
getAllDefinitions(): ResourceDefinition[];
/**
* Create a resource instance
*/
createResource(type: string, id: string, name: string, properties: any): SolidWorksResource;
/**
* Validate resource properties
*/
validateProperties(type: string, properties: any): {
valid: boolean;
errors?: any[];
};
/**
* Get schema for a resource type
*/
getSchema(type: string): z.ZodSchema<any> | undefined;
/**
* Get examples for a resource type
*/
getExamples(type: string): Record<string, any>[] | undefined;
/**
* Clear all registered resources (useful for testing)
*/
clear(): void;
}
export declare const resourceRegistry: ResourceRegistry;
export {};
//# sourceMappingURL=registry.d.ts.map