apple-hig-mcp
Version:
High-performance MCP server providing instant access to Apple's Human Interface Guidelines via hybrid static/dynamic content delivery
121 lines • 3.65 kB
TypeScript
/**
* MCP Tools implementation for Apple HIG interactive functionality
*/
import type { CrawleeHIGService } from './services/crawlee-hig.service.js';
import type { HIGCache } from './cache.js';
import type { HIGResourceProvider } from './resources.js';
import type { HIGStaticContentProvider } from './static-content.js';
import type { SearchGuidelinesArgs, GetComponentSpecArgs, SearchResult, HIGComponent, ApplePlatform } from './types.js';
export declare class HIGToolProvider {
private crawleeService;
private _cache;
private resourceProvider;
private staticContentProvider?;
constructor(crawleeService: CrawleeHIGService, cache: HIGCache, resourceProvider: HIGResourceProvider, staticContentProvider?: HIGStaticContentProvider);
/**
* Search HIG content by keywords/topics with input validation
*/
searchGuidelines(args: SearchGuidelinesArgs): Promise<{
results: SearchResult[];
total: number;
query: string;
filters: {
platform?: ApplePlatform;
category?: string;
};
}>;
/**
* Minimal fallback search with hardcoded results (last resort only)
*/
private getMinimalFallbackResults;
/**
* Get detailed specifications for a UI component with input validation
*/
getComponentSpec(args: GetComponentSpecArgs): Promise<{
component: HIGComponent | null;
relatedComponents: string[];
platforms: ApplePlatform[];
lastUpdated: string;
liquidGlassUpdates?: string;
}>;
private getComponentFromStaticContent;
private extractGuidelines;
private extractExamples;
private extractSpecifications;
/**
* Fallback method for component specs to avoid timeouts
*/
private getComponentSpecFallback;
/**
* Get design tokens for specific components
*/
getDesignTokens(args: {
component: string;
platform: string;
tokenType?: string;
}): Promise<{
component: string;
platform: string;
tokens: {
colors?: {
[key: string]: string;
};
spacing?: {
[key: string]: string;
};
typography?: {
[key: string]: string;
};
dimensions?: {
[key: string]: string;
};
};
}>;
/**
* Get accessibility requirements for specific components
*/
getAccessibilityRequirements(args: {
component: string;
platform: string;
}): Promise<{
component: string;
platform: string;
requirements: {
minimumTouchTarget: string;
contrastRatio: string;
voiceOverSupport: string[];
keyboardNavigation: string[];
wcagCompliance: string;
additionalGuidelines: string[];
};
}>;
/**
* Extract enhanced snippet with more context
*/
private extractEnhancedSnippet;
/**
* Find related components
*/
private findRelatedComponents;
/**
* Extract current design system information from content
*/
private extractLiquidGlassInfo;
/**
* Find common elements across arrays
*/
private findCommonElements;
/**
* Identify key differences between platforms
*/
private identifyKeyDifferences;
/**
* Get design token database for components
*/
private getDesignTokenDatabase;
/**
* Get accessibility requirements database
*/
private getAccessibilityDatabase;
}
//# sourceMappingURL=tools.d.ts.map