import { ResourceHandler, ResourceContent, Resource } from '../../src/types/index.js';\n\n/**\n * Example: Documentation Resource\n * This demonstrates how to create a new resource that can be added to the MCP server\n */\nexport class DocumentationResource implements ResourceHandler {\n private docs: Record<string, string> = {\n 'docs://api': 'API Documentation\\n\\nThis is sample API documentation content.',\n 'docs://guide': 'User Guide\\n\\nThis is sample user guide content.',\n };\n\n async read(uri: string): Promise<ResourceContent> {\n const content = this.docs[uri];\n \n if (!content) {\n throw new Error(`Documentation not found for URI: ${uri}`);\n }\n\n return {\n uri,\n mimeType: 'text/plain',\n text: content,\n };\n }\n}\n\n// Resource definitions for registration\nexport const DOCUMENTATION_RESOURCES: Resource[] = [\n {\n uri: 'docs://api',\n name: 'API Documentation',\n description: 'Complete API documentation',\n mimeType: 'text/plain',\n },\n {\n uri: 'docs://guide',\n name: 'User Guide',\n description: 'User guide and tutorials',\n mimeType: 'text/plain',\n },\n];\n\n/**\n * Example: Dynamic File Resource\n * This shows how to create a resource that reads from the file system\n */\nexport class FileSystemResource implements ResourceHandler {\n constructor(private basePath: string) {}\n\n async read(uri: string): Promise<ResourceContent> {\n // Extract file path from URI (e.g., \"file://config.json\" -> \"config.json\")\n const filePath = uri.replace('file://', '');\n const fullPath = `${this.basePath}/${filePath}`;\n \n try {\n // In a real implementation, you would use fs.readFile here\n // const fs = await import('fs/promises');\n // const content = await fs.readFile(fullPath, 'utf-8');\n \n // Mock file content for example\n const mockContent = `Mock content for file: ${filePath}`;\n \n return {\n uri,\n mimeType: this.getMimeType(filePath),\n text: mockContent,\n };\n } catch (error) {\n throw new Error(`Failed to read file: ${filePath}`);\n }\n }\n\n private getMimeType(filePath: string): string {\n const ext = filePath.split('.').pop()?.toLowerCase();\n switch (ext) {\n case 'json': return 'application/json';\n case 'txt': return 'text/plain';\n case 'md': return 'text/markdown';\n case 'js': return 'application/javascript';\n case 'ts': return 'application/typescript';\n default: return 'text/plain';\n }\n }\n}\n\n/**\n * To add these resources to your server:\n * \n * 1. Import the resources in your registry:\n * import { DocumentationResource, DOCUMENTATION_RESOURCES } from '../examples/resources/example-resource.js';\n * \n * 2. Register them in the ResourceRegistry constructor:\n * const docResource = new DocumentationResource();\n * DOCUMENTATION_RESOURCES.forEach(resource => {\n * this.resources.set(resource.uri, docResource);\n * this.resourceDefinitions.set(resource.uri, resource);\n * });\n */