UNPKG

woaru

Version:

Universal Project Setup Autopilot - Analyze and automatically configure development tools for ANY programming language

403 lines 11.7 kB
export interface CoreTool { name: string; description: string; languages: string[]; fileExtensions: string[]; frameworks: string[]; recommended_flags: string[]; config_files: string[]; isDeprecated: boolean; popularity: number; priority: 'critical' | 'high' | 'medium' | 'low'; plugin_class: string; metadata: { npm_package?: string; pypi_package?: string; crate_name?: string; github_repo: string; weekly_downloads: number; last_check: string; }; } export interface ExperimentalTool { name: string; description: string; languages: string[]; fileExtensions: string[]; frameworks: string[]; commandTemplate: string; installCommand: string; configFiles: string[]; isExperimental: boolean; popularity: number; priority: 'critical' | 'high' | 'medium' | 'low'; metadata: { npm_package?: string; pypi_package?: string; github_repo: string; weekly_downloads: number; trending: boolean; last_check: string; }; } export interface HybridToolsDatabase { version: string; lastUpdated: string; schema_version: string; core_tools: { [toolName: string]: CoreTool; }; experimental_tools: { [toolName: string]: ExperimentalTool; }; deprecation_warnings: { [toolName: string]: { name: string; reason: string; successor: string; migration_guide: string; sunset_date: string | null; }; }; framework_recommendations: { [frameworkName: string]: { core_tools: string[]; experimental_tools: string[]; [configType: string]: unknown; }; }; legacy_categories?: { [categoryName: string]: { description: string; tools: { [toolName: string]: unknown; }; }; }; meta: { source_url: string; update_frequency: string; maintainers: string[]; schema_documentation: string; version_history: Array<{ version: string; date: string; changes: string; }>; }; } export interface ToolsDatabase { version: string; lastUpdated: string; categories: { [categoryName: string]: { description: string; tools: { [toolName: string]: { name: string; languages: string[]; frameworks: string[] | { [framework: string]: string; }; popularity: number; keywords: string[]; installCommand: string | { [platform: string]: string; }; configFiles?: string[]; description: string; homepage: string; isRecommended: boolean; isNewAndTrending?: boolean; successorOf?: string; priority?: 'critical' | 'high' | 'medium' | 'low'; filePatterns?: { [type: string]: string[]; }; downloads?: { weekly: number; lastWeek: string; }; stars?: number; lastCommit?: string; lastRelease?: string; openIssues?: number; contributors?: number; isDeprecated?: boolean; successor?: string; lastDataUpdate?: string; }; }; }; }; frameworks: { [frameworkName: string]: { name: string; language: string; keywords: string[]; recommendedTools: { [category: string]: string[]; }; }; }; meta: { sourceUrl: string; updateFrequency: string; maintainers: string[]; schemaVersion: string; }; } export interface AIModel { id: string; name: string; description: string; isLatest: boolean; category: 'flagship' | 'fast' | 'balanced' | 'specialized' | 'reliable'; contextWindow: number; supportedFeatures: string[]; } export interface AIProvider { name: string; description: string; apiKeyEnvVar: string; baseUrl: string; providerType: string; headers: Record<string, string>; bodyTemplate: string; timeout: number; maxTokens: number; temperature: number; models: AIModel[]; } export interface AIModelsDatabase { version: string; lastUpdated: string; llm_providers: Record<string, AIProvider>; } export declare class ToolsDatabaseManager { private cacheDir; private cacheFilePath; private aiModelsCacheFilePath; private defaultSourceUrl; private aiModelsSourceUrl; private localFallbackPath; private aiModelsLocalFallbackPath; private databasePath; constructor(); /** * Gets the hybrid tools database, loading from cache or downloading if needed */ getHybridDatabase(): Promise<HybridToolsDatabase>; /** * Gets the legacy tools database format (for backward compatibility) */ getDatabase(): Promise<ToolsDatabase>; /** * Downloads the hybrid tools database from remote source */ downloadHybridDatabase(): Promise<HybridToolsDatabase>; /** * Legacy database loading for backward compatibility */ private loadLegacyDatabase; /** * Downloads the tools database from the remote source */ private downloadDatabase; /** * Loads the local fallback tools.json from project root */ private loadLocalFallback; /** * Returns a minimal database as last resort */ private getMinimalDatabase; /** * Gets the last update time of the cached database */ getCacheInfo(): Promise<{ exists: boolean; lastModified?: Date; version?: string; }>; /** * Forces a fresh download and cache update */ forceUpdate(): Promise<ToolsDatabase>; /** * Clears the cache */ clearCache(): Promise<void>; /** * Gets tools by category */ getToolsByCategory(category: string): Promise<Record<string, unknown>>; /** * Gets recommended tools for a framework */ getRecommendedToolsForFramework(framework: string): Promise<{ [category: string]: string[]; }>; /** * Searches for tools by keywords */ searchToolsByKeywords(keywords: string[]): Promise<Array<Record<string, unknown>>>; /** * Checks for updates in the background and updates cache if newer version available * Enhanced version with version comparison and detailed logging */ checkForUpdates(): Promise<boolean>; /** * Gets the last-modified date from remote source using HEAD request */ private getRemoteLastModified; private backgroundInterval?; /** * Starts background update checking (call this when WOARU starts) */ startBackgroundUpdates(): Promise<void>; /** * Stops background update checking */ stopBackgroundUpdates(): void; /** * Gets remote version information including version and last modified date */ private getRemoteVersionInfo; /** * Determines if local cache should be updated based on version and timestamp */ private shouldUpdate; /** * Compares two semantic version strings */ private isNewerVersion; /** * Counts tools and categories in database for logging */ private countToolsInDatabase; /** * Gets database statistics for debugging */ getDatabaseStats(): Promise<{ version: string; toolCount: number; categories: string[]; lastUpdated: string; }>; /** * Gets core tool configuration for a specific tool */ getCoreToolConfig(toolName: string): Promise<CoreTool | null>; /** * Gets experimental tool configuration for a specific tool */ getExperimentalToolConfig(toolName: string): Promise<ExperimentalTool | null>; /** * Gets all core tools that support a specific file extension */ getCoreToolsForFileExtension(fileExtension: string): Promise<CoreTool[]>; /** * Gets all experimental tools that support a specific file extension */ getExperimentalToolsForFileExtension(fileExtension: string): Promise<ExperimentalTool[]>; /** * Gets framework-specific tool recommendations */ getFrameworkRecommendations(framework: string): Promise<{ core_tools: string[]; experimental_tools: string[]; } | null>; /** * Checks if a tool is deprecated and returns successor info */ getDeprecationInfo(toolName: string): Promise<{ name: string; reason: string; successor: string; migration_guide: string; } | null>; /** * Converts hybrid database to legacy format for backward compatibility */ private convertHybridToLegacy; /** * Creates legacy categories structure from core tools */ private createLegacyCategoriesFromCoreTools; /** * Loads hybrid local fallback */ private loadHybridLocalFallback; /** * Returns minimal hybrid database as last resort */ private getMinimalHybridDatabase; /** * Gets the AI models database, loading from cache or downloading if needed */ getAIModelsDatabase(): Promise<AIModelsDatabase>; /** * Downloads the AI models database from remote source */ private downloadAIModelsDatabase; /** * Loads the local fallback ai-models.json from project root */ private loadAIModelsLocalFallback; /** * Returns a minimal AI models database as last resort */ private getMinimalAIModelsDatabase; /** * Gets all available AI providers */ getAIProviders(): Promise<Record<string, AIProvider>>; /** * Gets models for a specific provider */ getModelsForProvider(providerName: string): Promise<AIModel[]>; /** * Gets all available models from all providers */ getAllAIModels(): Promise<Array<AIModel & { provider: string; }>>; /** * Gets latest/flagship models from all providers */ getLatestAIModels(): Promise<Array<AIModel & { provider: string; }>>; /** * Gets models by category (flagship, fast, balanced, etc.) */ getModelsByCategory(category: string): Promise<Array<AIModel & { provider: string; }>>; /** * Gets a specific model by ID across all providers */ getModelById(modelId: string): Promise<(AIModel & { provider: string; }) | null>; /** * Gets provider configuration for a specific provider */ getProviderConfig(providerName: string): Promise<AIProvider | null>; /** * Forces update of AI models database */ forceUpdateAIModels(): Promise<AIModelsDatabase>; /** * Gets AI models database statistics */ getAIModelsStats(): Promise<{ version: string; providers: number; totalModels: number; providerNames: string[]; lastUpdated: string; }>; } //# sourceMappingURL=ToolsDatabaseManager.d.ts.map