ai-debug-local-mcp
Version:
🎯 ENHANCED AI GUIDANCE v4.1.2: Dramatically improved tool descriptions help AI users choose the right tools instead of 'close enough' options. Ultra-fast keyboard automation (10x speed), universal recording, multi-ecosystem debugging support, and compreh
154 lines • 4.78 kB
TypeScript
/**
* Bidirectional Context Sharing Manager
* Enables seamless context exchange between primary agent and sub-agents
* Ensures both are aware of the critical importance of context sharing
*/
import { EventEmitter } from 'events';
export interface ContextEntry {
id: string;
timestamp: Date;
source: 'primary_agent' | 'sub_agent' | 'background_agent' | 'user';
sourceId: string;
type: 'discovery' | 'decision' | 'progress' | 'error' | 'insight' | 'state_change';
priority: 'critical' | 'high' | 'medium' | 'low';
content: {
title: string;
description: string;
data?: any;
impact?: string;
recommendations?: string[];
};
contextual: {
sessionId?: string;
framework?: string;
phase?: string;
toolsInvolved?: string[];
relatedFindings?: string[];
};
sharing: {
shareWithPrimary: boolean;
shareWithSubAgents: boolean;
shareWithBackground: boolean;
criticalForDecisionMaking: boolean;
requiresAcknowledgment: boolean;
};
}
export interface ContextSharingAwareness {
agentId: string;
agentType: 'primary' | 'sub' | 'background';
awarenessLevel: 'full' | 'partial' | 'minimal';
lastContextSync: Date;
contextDependencies: string[];
contextContributions: string[];
sharingImportanceScore: number;
}
export interface ContextSynchronizationEvent {
eventType: 'context_added' | 'context_updated' | 'context_requested' | 'sync_required';
targetAgents: string[];
contextId: string;
urgency: 'immediate' | 'high' | 'normal' | 'background';
syncMetadata: {
requiredFor: string;
deadline?: Date;
alternatives?: string[];
};
}
/**
* Bidirectional Context Manager
* Central hub for context sharing between all agents
*/
export declare class BidirectionalContextManager extends EventEmitter {
private contextStore;
private agentAwareness;
private contextSubscriptions;
private contextDependencies;
private sharingMetrics;
constructor();
/**
* Register an agent with context sharing awareness
*/
registerAgent(agentId: string, agentType: 'primary' | 'sub' | 'background', config: {
contextDependencies: string[];
contextContributions: string[];
sharingImportanceScore: number;
}): void;
/**
* Share context from any agent to relevant agents
*/
shareContext(context: Omit<ContextEntry, 'id' | 'timestamp'>): Promise<string>;
/**
* Request specific context (pull model)
*/
requestContext(requestingAgentId: string, contextType: string, criteria: {
priority?: string;
maxAge?: number;
requiredFor: string;
}): Promise<ContextEntry[]>;
/**
* Update existing context (collaborative refinement)
*/
updateContext(contextId: string, updatingAgentId: string, updates: {
content?: Partial<ContextEntry['content']>;
contextual?: Partial<ContextEntry['contextual']>;
additionalInsights?: string[];
}): Promise<boolean>;
/**
* Get agent's context awareness status
*/
getAgentAwareness(agentId: string): ContextSharingAwareness | null;
/**
* Get comprehensive context sharing status
*/
getContextSharingStatus(): {
totalContexts: number;
activeAgents: number;
sharingMetrics: any;
recentActivity: ContextEntry[];
criticalGaps: string[];
};
/**
* Emphasize context sharing importance to agents
*/
emphasizeContextSharingImportance(agentId: string, scenario: string): {
importance: 'critical' | 'high' | 'medium';
reasoning: string;
recommendations: string[];
};
/**
* Determine target agents for context sharing
*/
private determineTargetAgents;
/**
* Calculate urgency for context synchronization
*/
private calculateUrgency;
/**
* Perform bidirectional context synchronization
*/
private synchronizeContext;
/**
* Sync context to a specific agent
*/
private syncContextToAgent;
/**
* Setup monitoring for critical context sharing
*/
private setupCriticalSharingMonitoring;
/**
* Identify critical context gaps
*/
private identifyCriticalContextGaps;
/**
* Calculate context sharing importance for an agent
*/
private calculateContextImportance;
/**
* Generate reasoning for context sharing importance
*/
private generateImportanceReasoning;
/**
* Generate context sharing recommendations
*/
private generateContextSharingRecommendations;
}
//# sourceMappingURL=bidirectional-context-manager.d.ts.map