adpa-enterprise-framework-automation
Version:
Modular, standards-compliant Node.js/TypeScript automation framework for enterprise requirements, project, and data management. Provides CLI and API for BABOK v3, PMBOK 7th Edition, and DMBOK 2.0 (in progress). Production-ready Express.js API with TypeSpe
112 lines • 4.45 kB
TypeScript
/**
* Enhanced Context Manager Module for Requirements Gathering Agent
*
* Provides advanced context management capabilities including project analysis integration,
* AI-powered content enhancement, and comprehensive document context building.
*
* @version 2.1.3
* @author Requirements Gathering Agent Team
* @created 2024
* @updated June 2025
*
* Key Features:
* - Enhanced project context creation with multi-source integration
* - AI-powered content analysis and enhancement
* - Intelligent content prioritization and relevance scoring
* - Context validation and consistency checking
* - Large context handling with token management
*
* @filepath c:\Users\menno\Source\Repos\requirements-gathering-agent\src\modules\contextManager.ts
*/
export declare class ContextManager {
private static instance;
private maxContextTokens;
private coreContext;
enrichedContext: Map<string, string>;
private contextCache;
private documentRelationships;
private modelTokenLimits;
private autoConfigDone;
constructor(maxTokens?: number);
/**
* Get singleton instance of ContextManager
*/
static getInstance(): ContextManager;
private initializeModelTokenLimits;
private autoAdjustTokenLimits;
private supportsLargeContext;
private getEffectiveTokenLimit;
private initializeDocumentRelationships;
private estimateTokens;
createCoreContext(readmeContent: string): Promise<string>;
buildContextForDocument(documentType: string, additionalContext?: string[]): string;
private getRelevantContext;
addEnrichedContext(key: string, content: string): void;
private clearRelatedCache;
private hashString;
getMetrics(): {
coreContextTokens: number;
enrichedContextCount: number;
cacheSize: number;
maxTokens: number;
};
getContextUtilizationReport(): string;
analyzeDocumentContext(documentType: string): {
totalTokens: number;
utilizationPercentage: number;
includedContexts: string[];
potentialContexts: string[];
recommendations: string[];
};
/**
* Direct Context Injection - Automatically discovers and injects high-relevance markdown files
* @param projectPath - The root directory of the project to analyze
* @param minRelevanceScore - Minimum relevance score for injection (default: 75)
* @param maxFiles - Maximum number of files to inject (default: 10)
* @returns Promise<number> - Number of files successfully injected
*/
injectHighRelevanceMarkdownFiles(projectPath: string, minRelevanceScore?: number, maxFiles?: number): Promise<number>;
/**
* Inject specific markdown files by file paths
* @param filePaths - Array of absolute file paths to inject
* @param projectRoot - Project root directory for relative path calculation
* @returns Promise<number> - Number of files successfully injected
*/
injectSpecificMarkdownFiles(filePaths: string[], projectRoot: string): Promise<number>;
/**
* Format injected markdown content with metadata
* @param file - ProjectMarkdownFile to format
* @returns Formatted content string
*/
private formatInjectedContent;
/**
* Get statistics about injected content
* @returns Object with injection statistics
*/
getInjectionStatistics(): {
totalInjected: number;
injectedKeys: string[];
totalTokensInjected: number;
remainingTokenBudget: number;
};
/**
* Clear all injected context
*/
clearInjectedContext(): void;
private autoAdjustConfig;
/**
* Loads existing generated documents as highest priority context
* This ensures manual edits and existing content are respected by the LLM
*/
loadExistingGeneratedDocuments(generatedDocsPath?: string): Promise<void>;
/**
* Recursively scans the generated-documents directory for existing documents
*/
private scanGeneratedDocuments;
}
export declare const contextManagerVersion = "2.1.2";
export declare function createAISummary(text: string, maxTokens: number): Promise<string | null>;
export declare function analyzeDocumentContextUtilization(documentType: string): any;
export declare function addProjectContext(key: string, content: string): void;
export type EnhancedContextManager = ContextManager;
//# sourceMappingURL=contextManager.d.ts.map