UNPKG

apple-hig-mcp

Version:

High-performance MCP server providing instant access to Apple's Human Interface Guidelines via hybrid static/dynamic content delivery

282 lines 7.33 kB
/** * Types for Apple Human Interface Guidelines MCP Server */ export interface HIGSection { id: string; title: string; url: string; platform: ApplePlatform; category: HIGCategory; content?: string; lastUpdated?: Date; quality?: ContentQualityMetrics; extractionMethod?: 'crawlee' | 'fallback' | 'static'; structuredContent?: StructuredHIGContent; } export interface HIGComponent { id: string; title: string; description: string; platforms: ApplePlatform[]; url: string; specifications?: ComponentSpec; guidelines?: string[]; examples?: string[]; lastUpdated?: Date; } export interface ComponentSpec { dimensions?: { width?: string; height?: string; minWidth?: string; minHeight?: string; }; spacing?: { padding?: string; margin?: string; }; typography?: { fontSize?: string; fontWeight?: string; lineHeight?: string; }; colors?: { primary?: string; secondary?: string; background?: string; }; touchTarget?: string; minimumSize?: string; } export interface StructuredHIGContent { overview: string; guidelines: string[]; examples: string[]; specifications?: ComponentSpec; relatedConcepts: string[]; platformSpecific?: { [platform: string]: { guidelines?: string[]; examples?: string[]; specifications?: ComponentSpec; }; }; } export interface EnhancedHIGSection extends HIGSection { structuredContent?: StructuredHIGContent; rawHtml?: string; processingMetrics?: { extractionTime: number; contentLength: number; structureScore: number; cleaningScore: number; }; } export interface ProcessedContentResult { cleanedMarkdown: string; structuredContent: StructuredHIGContent; quality: ContentQualityMetrics; processingMetrics: { extractionTime: number; contentLength: number; structureScore: number; cleaningScore: number; }; } export interface SearchResult { id: string; title: string; url: string; platform: ApplePlatform; category?: HIGCategory; relevanceScore: number; snippet: string; type: 'section' | 'component' | 'guideline'; highlights?: string[]; } export interface HIGUpdate { id: string; title: string; description: string; url: string; date: Date; platform: ApplePlatform; type: 'new' | 'updated' | 'deprecated'; category: HIGCategory; } export type ApplePlatform = 'iOS' | 'macOS' | 'watchOS' | 'tvOS' | 'visionOS' | 'universal'; export type HIGCategory = 'foundations' | 'layout' | 'navigation' | 'presentation' | 'selection-and-input' | 'status' | 'system-capabilities' | 'visual-design' | 'icons-and-images' | 'color-and-materials' | 'typography' | 'motion' | 'technologies'; export interface CacheEntry<T> { data: T; timestamp: Date; ttl: number; } export interface ScrapingConfig { baseUrl: string; userAgent: string; requestDelay: number; retryAttempts: number; timeout: number; } export interface HIGResource { uri: string; name: string; description: string; mimeType: string; content: string; } export interface SearchGuidelinesArgs { query: string; platform?: ApplePlatform; category?: HIGCategory; limit?: number; } export interface GetComponentSpecArgs { componentName: string; platform?: ApplePlatform; } export interface ComparePlatformsArgs { componentName: string; platforms: ApplePlatform[]; } export interface GetLatestUpdatesArgs { since?: string; platform?: ApplePlatform; limit?: number; } export interface ContentQualityMetrics { score: number; length: number; structureScore: number; appleTermsScore: number; codeExamplesCount: number; imageReferencesCount: number; headingCount: number; isFallbackContent: boolean; extractionMethod: string; confidence: number; } export interface ProcessedContent { content: string; summary: string; tableOfContents: string; codeExamples: string[]; imageReferences: string[]; relatedSections: string[]; keywords: string[]; quality: ContentQualityMetrics; } export interface DiscoveredLink { url: string; title: string; platform: ApplePlatform; category: HIGCategory; depth: number; } export interface DiscoveryConfig { baseUrl: string; maxDepth: number; maxPages: number; respectfulDelay: number; cacheKey: string; cacheTTL: number; } export interface ContentExtractionResult { content: string; quality: number; extractionMethod: 'crawlee' | 'fallback'; timestamp: Date; } export interface CrawleeConfig extends ScrapingConfig { maxConcurrency: number; browserOptions: { headless: boolean; viewport: { width: number; height: number; }; args: string[]; }; waitOptions: { networkIdle: number; timeout: number; }; } export interface QualityValidationResult { isValid: boolean; score: number; confidence: number; issues: string[]; recommendations: string[]; } export interface ExtractionStatistics { totalSections: number; successfulExtractions: number; fallbackUsage: number; averageQuality: number; averageConfidence: number; extractionSuccessRate: number; } export interface SemanticSearchResult extends SearchResult { semanticScore: number; keywordScore: number; structureScore: number; contextualScore: number; combinedScore: number; searchTerms: string[]; matchedConcepts: string[]; } export interface QueryAnalysis { originalQuery: string; processedQuery: string; intent: SearchIntent; entities: EntityMatch[]; keywords: string[]; concepts: string[]; platform?: ApplePlatform; category?: HIGCategory; } export interface EntityMatch { text: string; type: EntityType; confidence: number; normalizedValue?: string; } export type EntityType = 'component' | 'platform' | 'property' | 'action' | 'concept' | 'measurement'; export type SearchIntent = 'find_component' | 'find_guideline' | 'compare_platforms' | 'find_specification' | 'find_example' | 'troubleshoot' | 'general_search'; export interface EmbeddingVector { values: number[]; dimension: number; model: string; } export interface SemanticIndex { sectionId: string; embeddings: { title: EmbeddingVector; overview: EmbeddingVector; guidelines: EmbeddingVector; fullContent: EmbeddingVector; }; metadata: { platform: ApplePlatform; category: HIGCategory; concepts: string[]; lastUpdated: Date; qualityScore: number; }; } export interface SearchConfig { semanticWeight: number; keywordWeight: number; structureWeight: number; contextWeight: number; minSemanticThreshold: number; maxResults: number; boostFactors: { exactTitle: number; platformMatch: number; categoryMatch: number; recentContent: number; }; } //# sourceMappingURL=types.d.ts.map