devibe
Version:
Intelligent repository cleanup with auto mode, AI learning, markdown consolidation, auto-consolidate workflow, context-aware classification, and cost optimization
80 lines • 2.7 kB
TypeScript
import type { FileClassification, FileCategory } from './types.js';
export interface RepositorySuggestion {
repositoryName: string;
confidence: number;
reasoning: string;
}
export interface BatchFileInfo {
fileName: string;
filePath: string;
contentPreview: string;
}
export interface BatchClassificationResult {
fileName: string;
category: FileCategory;
confidence: number;
reasoning: string;
suggestedRepo?: string;
}
export interface AIProvider {
name: string;
classify(filePath: string, content: string): Promise<FileClassification>;
classifyBatch?(files: BatchFileInfo[], repositories: Array<{
name: string;
path: string;
isRoot: boolean;
}>): Promise<BatchClassificationResult[]>;
suggestRepository(filePath: string, content: string, repositories: Array<{
name: string;
path: string;
isRoot: boolean;
}>): Promise<RepositorySuggestion>;
}
export declare class AnthropicClassifier implements AIProvider {
private apiKey;
name: string;
private apiUrl;
private modelId;
constructor(apiKey: string, modelId?: string);
classifyBatch(files: BatchFileInfo[], repositories: Array<{
name: string;
path: string;
isRoot: boolean;
}>): Promise<BatchClassificationResult[]>;
classify(filePath: string, content: string): Promise<FileClassification>;
private buildPrompt;
suggestRepository(filePath: string, content: string, repositories: Array<{
name: string;
path: string;
isRoot: boolean;
}>): Promise<RepositorySuggestion>;
private parseResponse;
}
export declare class OpenAIClassifier implements AIProvider {
private apiKey;
name: string;
private apiUrl;
private modelId;
constructor(apiKey: string, modelId?: string);
classify(filePath: string, content: string): Promise<FileClassification>;
private buildPrompt;
suggestRepository(filePath: string, content: string, repositories: Array<{
name: string;
path: string;
isRoot: boolean;
}>): Promise<RepositorySuggestion>;
private parseResponse;
}
export declare class AIClassifierFactory {
static create(provider?: 'anthropic' | 'openai', modelId?: string): Promise<AIProvider | null>;
static isAvailable(): Promise<boolean>;
static getPreferredProvider(): Promise<'anthropic' | 'openai' | 'google' | null>;
/**
* Get the specific model to use based on config/environment
*/
static getModelConfig(): Promise<{
provider: 'anthropic' | 'openai' | 'google';
modelId: string;
} | null>;
}
//# sourceMappingURL=ai-classifier.d.ts.map