@bonginkan/maria
Version:
MARIA OS v5.9.5 – Self-Evolving Organizational Intelligence OS | Speed Improvement Phase 3: LLM Optimization + Command Refactoring | Performance Measurement + Run Evidence System | Zero ESLint/TypeScript Errors | 人とAIが役割を持ち、学び、進化し続けるための仕事のOS | GraphRAG ×
97 lines (96 loc) • 2.7 kB
TypeScript
/**
* Intelligent Document Save Service
* Autonomously determines file names, extensions, and directory organization
* Integrates with FilenameInferenceService for intelligent naming
*/
import type { ProjectContext } from './code-intent/types/filename-inference.types.js';
/**
* Enhanced save options with intelligent features
*/
export interface IntelligentSaveOptions {
userIntent?: string;
projectContext?: ProjectContext;
autoOrganize?: boolean;
trackRelationships?: boolean;
learnFromUser?: boolean;
suggestAlternatives?: boolean;
}
/**
* Save result with additional metadata
*/
export interface IntelligentSaveResult {
path: string;
filename: string;
directory: string;
confidence: number;
reasoning: string;
alternatives?: string[];
relationships?: string[];
}
/**
* Intelligent Document Save Service
*/
export declare class IntelligentDocumentSaveService {
private filenameInference;
private projectContext;
constructor(projectContext?: ProjectContext);
/**
* Intelligently save content with autonomous decision making
*/
save(content: string, options?: IntelligentSaveOptions): Promise<IntelligentSaveResult>;
/**
* Save multiple documents intelligently
*/
saveMultiple(documents: Array<{
content: string;
hint?: string;
}>, options?: IntelligentSaveOptions): Promise<IntelligentSaveResult[]>;
/**
* Analyze content to understand its nature
*/
private analyzeContent;
/**
* Extract keywords from content
*/
private extractKeywords;
/**
* Detect programming language
*/
private detectLanguage;
/**
* Detect framework
*/
private detectFramework;
/**
* Generate content summary
*/
private generateSummary;
/**
* Track file relationships
*/
private trackRelationships;
/**
* Extract import statements
*/
private extractImports;
/**
* Learn from user save patterns
*/
private learnFromSave;
/**
* Check if file extension indicates code file
*/
private isCodeFile;
/**
* Get suggestions for better organization
*/
getSuggestions(content: string): Promise<{
filename: string;
directory: string;
reasoning: string;
}[]>;
}
export declare const intelligentSave: IntelligentDocumentSaveService;
export declare function autoSaveIntelligently(content: string, userHint?: string): Promise<string | null>;
export declare function autoSaveMultipleIntelligently(content: string, baseHint?: string): Promise<string[]>;
export default IntelligentDocumentSaveService;