codecrucible-synth
Version:
Production-Ready AI Development Platform with Multi-Voice Synthesis, Smithery MCP Integration, Enterprise Security, and Zero-Timeout Reliability
154 lines • 4.37 kB
TypeScript
import { SynthesisResult } from '../types.js';
export interface ProjectContext {
guidance: string;
preferences: VoicePreferences;
constraints: string[];
patterns: CodePattern[];
history: InteractionSummary[];
metadata: ProjectMetadata;
}
export interface VoicePreferences {
primary: string[];
secondary: string[];
disabled: string[];
customSettings: Record<string, any>;
}
export interface CodePattern {
name: string;
description: string;
pattern: string;
examples: string[];
category: 'architectural' | 'stylistic' | 'security' | 'performance';
}
export interface InteractionSummary {
timestamp: number;
prompt: string;
response: string;
voicesUsed: string[];
outcome: 'successful' | 'partial' | 'failed';
userFeedback?: 'positive' | 'negative' | 'neutral';
topics: string[];
}
export interface ProjectMetadata {
name: string;
type: 'web' | 'mobile' | 'desktop' | 'library' | 'tool' | 'other';
languages: string[];
frameworks: string[];
lastUpdated: number;
totalInteractions: number;
averageComplexity: number;
}
export interface ContextLayer {
level: 'global' | 'repo' | 'subfolder';
path: string;
content: ProjectContext;
priority: number;
}
export interface ContextHierarchy {
layers: ContextLayer[];
merged: ProjectContext;
conflicts: ContextConflict[];
}
export interface ContextConflict {
property: string;
layers: string[];
resolution: 'merge' | 'override' | 'manual';
value: any;
}
/**
* Project Memory System implementing hierarchical context management
* Inspired by Codex CLI's AGENTS.md pattern with intelligent merging
*/
export declare class ProjectMemorySystem {
private contextPath;
private globalContextPath;
private cache;
private watchedPaths;
constructor(workspaceRoot: string);
/**
* Load and merge project context from hierarchy
*/
loadProjectContext(currentPath?: string): Promise<ProjectContext>;
/**
* Save project context at appropriate level
*/
saveProjectContext(context: Partial<ProjectContext>, level?: 'global' | 'repo' | 'subfolder', subfolderPath?: string): Promise<void>;
/**
* Store interaction in project history
*/
storeInteraction(prompt: string, response: SynthesisResult, context: ProjectContext, userFeedback?: 'positive' | 'negative' | 'neutral'): Promise<void>;
/**
* Search interaction history
*/
searchHistory(query: string, options?: {
limit?: number;
timeRange?: {
start: number;
end: number;
};
outcome?: 'successful' | 'partial' | 'failed';
voices?: string[];
}): Promise<InteractionSummary[]>;
/**
* Get context recommendations for current task
*/
getContextRecommendations(currentPrompt: string): Promise<{
relevantPatterns: CodePattern[];
similarInteractions: InteractionSummary[];
suggestedVoices: string[];
constraints: string[];
}>;
/**
* Load context hierarchy from global -> repo -> subfolder
*/
private loadContextHierarchy;
/**
* Load context from a specific path
*/
private loadContextFromPath;
/**
* Save context files to disk
*/
private saveContextFiles;
/**
* Merge multiple contexts with priority-based resolution
*/
private mergeContextLayers;
/**
* Merge contexts with intelligent conflict resolution
*/
private mergeContexts;
/**
* Detect conflicts between context layers
*/
private detectConflicts;
/**
* Detect voice preference conflicts
*/
private detectVoiceConflicts;
/**
* Create default project context
*/
private createDefaultContext;
/**
* Extract topics from prompt and response
*/
private extractTopics;
/**
* Extract topics from text using simple keyword matching
*/
private extractTopicsFromText;
/**
* Calculate average complexity from interaction history
*/
private calculateAverageComplexity;
/**
* Ensure directory exists
*/
private ensureDirectoryExists;
/**
* Cleanup resources and save pending data
*/
dispose(): Promise<void>;
}
//# sourceMappingURL=project-memory.d.ts.map