import { Server } from '@modelcontextprotocol/sdk/server/index.js'; type TigercatFramework = 'react' | 'vue'; interface TigercatMcpOptions { /** 本地 Tigercat 仓库根目录;提供时优先于 baseUrl,走文件系统读取。 */ root?: string; /** 远程 skills 基地址(GitHub Pages /mcp/ 路由或其镜像);缺省用官方地址。 */ baseUrl?: string; /** 远程 fetch 超时毫秒数。 */ timeoutMs?: number; } type LoadSkillIndexOptions = TigercatMcpOptions; interface SkillSource { readonly kind: 'fs' | 'http'; /** fs: 绝对仓库根目录;http: 规范化(以 / 结尾)的 base URL。 */ readonly origin: string; /** 读取 origin 下 repo-relative 路径的 UTF-8 文本;path 需已经 normalizeRelativePath。 */ readText(path: string): Promise; /** doctor 可读性探测,不可读时抛错。 */ probe(path: string): Promise; } interface ReferenceSource { path: string; reason: string; truncated: boolean; /** 抽取的 `##
` 小节名;整文件读取时缺省。 */ section?: string; /** 内联正文;指针型 source(建议每会话经 tigercat_reference 另读一次)不带 text。 */ text?: string; } interface ComponentReferences { componentIndex: string; props: string; examples: string; react: string; vue: string; } interface ComponentMetadata { name: string; aliases: string[]; category: string; slug: string; testGroup: string; packageSubpath: string; packageTarget: string; typeSource: string; sourceFiles: string[]; propsInterfaces: string[]; frameworks: TigercatFramework[]; references: ComponentReferences; } interface TopicMetadata { title: string; references: string[]; keywords: string[]; } interface CommandApiMetadata { name: string; title: string; topic: string; references: string[]; } interface TigercatContext7 { url?: string; public_key?: string; generated_by?: string; component_count?: number; reference_paths?: Record; /** 全部 skill markdown 的仓库相对路径清单(远程模式的 allow-list 契约)。 */ skill_files?: string[]; aliases?: Record; command_apis?: Record; topics?: Record; components?: Record; component_index?: Record; } interface SkillIndex { /** fs: 绝对仓库根目录;http: base URL。与 source.origin 一致,兼容既有读者。 */ root: string; source: SkillSource; context7: TigercatContext7; components: Map; componentsByNormalizedName: Map; aliasTargetsByNormalizedName: Map; topics: Map; allowedReferencePaths: Set; } interface ComponentRoute { component: ComponentMetadata; sources: ReferenceSource[]; } interface ComponentLookupResult { query: string; found: boolean; matches: ComponentRoute[]; candidates: SearchResult[]; } interface SearchResult { kind: 'component' | 'alias' | 'category' | 'topic' | 'command'; name: string; score: number; reason: string; component?: ComponentMetadata; components?: ComponentMetadata[]; topic?: string; } interface SearchResponse { query: string; framework?: TigercatFramework; results: SearchResult[]; } interface TopicRoute { slug: string; title: string; sources: ReferenceSource[]; } interface TaskRouteResult { task: string; framework?: TigercatFramework; intent: 'component' | 'topic' | 'mixed' | 'unknown'; matches: ComponentRoute[]; topics: TopicRoute[]; candidates: SearchResult[]; sources: ReferenceSource[]; } interface InventorySummary { componentCount: number; categories: Array<{ slug: string; name: string; count: number; }>; aliases: Record; topics: Record; components: ComponentMetadata[]; } interface DoctorResult { ok: boolean; root: string; mode: 'fs' | 'http'; componentCount: number; aliasCount: number; topicCount: number; readableReferenceCount: number; /** http 模式下 best-effort 读取的远程 version.json 版本。 */ remoteVersion?: string; issues: string[]; } declare function createTigercatMcpServer(options?: TigercatMcpOptions): Server; declare function loadSkillIndex(options?: string | LoadSkillIndexOptions): Promise; declare function diagnoseTigercatMcp(options?: string | LoadSkillIndexOptions): Promise; declare const DEFAULT_REMOTE_BASE_URL = "https://expcat.github.io/Tigercat/mcp/"; interface RouteTaskInput { task: string; framework?: TigercatFramework; maxBytes?: number; limit?: number; } interface ComponentInput { component: string; framework?: TigercatFramework; maxBytes?: number; } interface SearchInput { query: string; framework?: TigercatFramework; limit?: number; } declare function searchTigercat(index: SkillIndex, input: SearchInput): Promise; declare function getTigercatComponent(index: SkillIndex, input: ComponentInput): Promise; declare function routeTigercatTask(index: SkillIndex, input: RouteTaskInput): Promise; declare function getInventory(index: SkillIndex): InventorySummary; declare function getCategoryComponents(index: SkillIndex, slugOrCategory: string): ComponentMetadata[]; export { type ComponentLookupResult, type ComponentMetadata, type ComponentRoute, DEFAULT_REMOTE_BASE_URL, type DoctorResult, type InventorySummary, type LoadSkillIndexOptions, type ReferenceSource, type SearchResponse, type SearchResult, type SkillIndex, type SkillSource, type TaskRouteResult, type TigercatFramework, type TigercatMcpOptions, createTigercatMcpServer, diagnoseTigercatMcp, getCategoryComponents, getInventory, getTigercatComponent, loadSkillIndex, routeTigercatTask, searchTigercat };