/**
 * NeuroLink MCP Context Management System
 * Unified context creation and management for all tool executions
 * Ensures rich context flows through tool chain with session tracking
 */
import type { NeuroLinkExecutionContext } from './factory.js';
/**
 * Context creation request interface
 */
export interface ContextRequest {
    sessionId?: string;
    userId?: string;
    aiProvider?: string;
    modelId?: string;
    temperature?: number;
    maxTokens?: number;
    organizationId?: string;
    projectId?: string;
    environmentType?: 'development' | 'staging' | 'production';
    frameworkType?: 'react' | 'vue' | 'svelte' | 'next' | 'nuxt' | 'sveltekit';
    permissions?: string[];
    securityLevel?: 'public' | 'private' | 'organization';
    [key: string]: any;
}
/**
 * Context manager for creating and managing execution contexts
 * Provides rich context for all tool executions with session tracking
 */
export declare class ContextManager {
    private sessionCounter;
    private activeContexts;
    /**
     * Create a new execution context with rich information
     *
     * @param request Context creation request with optional fields
     * @returns Complete execution context ready for tool chain
     */
    createContext(request?: ContextRequest): NeuroLinkExecutionContext;
    /**
     * Add a tool to the execution chain
     *
     * @param context Execution context to modify
     * @param toolName Name of the tool being executed
     */
    addToToolChain(context: NeuroLinkExecutionContext, toolName: string): void;
    /**
     * Get the current tool chain for a context
     *
     * @param context Execution context
     * @returns Array of tool names in execution order
     */
    getToolChain(context: NeuroLinkExecutionContext): string[];
    /**
     * Set parent tool for nested tool execution
     *
     * @param context Execution context to modify
     * @param parentToolId ID of the parent tool
     */
    setParentTool(context: NeuroLinkExecutionContext, parentToolId: string): void;
    /**
     * Create child context for nested tool execution
     *
     * @param parentContext Parent execution context
     * @param childToolName Name of the child tool
     * @returns New child context with inherited properties
     */
    createChildContext(parentContext: NeuroLinkExecutionContext, childToolName: string): NeuroLinkExecutionContext;
    /**
     * Get context by session ID
     *
     * @param sessionId Session identifier
     * @returns Execution context or undefined if not found
     */
    getContext(sessionId: string): NeuroLinkExecutionContext | undefined;
    /**
     * Update context with new information
     *
     * @param sessionId Session identifier
     * @param updates Partial context updates
     */
    updateContext(sessionId: string, updates: Partial<NeuroLinkExecutionContext>): void;
    /**
     * Remove context from active tracking
     *
     * @param sessionId Session identifier
     */
    removeContext(sessionId: string): void;
    /**
     * Get all active contexts (for debugging/monitoring)
     *
     * @returns Array of all active contexts
     */
    getActiveContexts(): NeuroLinkExecutionContext[];
    /**
     * Clear all active contexts
     */
    clearAllContexts(): void;
    /**
     * Get context statistics
     *
     * @returns Context usage statistics
     */
    getStats(): {
        activeContexts: number;
        totalSessionsCreated: number;
        averageToolChainLength: number;
    };
    /**
     * Generate unique session ID
     *
     * @returns Unique session identifier
     */
    private generateSessionId;
    /**
     * Extract custom fields from request (excluding known fields)
     *
     * @param request Context creation request
     * @returns Custom fields object
     */
    private extractCustomFields;
}
/**
 * Default context manager instance
 * Can be used across the application for consistent context management
 */
export declare const defaultContextManager: ContextManager;
/**
 * Utility function to create context with defaults
 *
 * @param request Optional context request
 * @returns Execution context with sensible defaults
 */
export declare function createExecutionContext(request?: ContextRequest): NeuroLinkExecutionContext;
/**
 * Utility function to add tool to default context manager
 *
 * @param context Execution context
 * @param toolName Tool name to add
 */
export declare function addToolToChain(context: NeuroLinkExecutionContext, toolName: string): void;
/**
 * Context validation utilities
 */
export declare class ContextValidator {
    /**
     * Validate context has required fields for tool execution
     *
     * @param context Execution context to validate
     * @returns Validation result with details
     */
    static validateContext(context: NeuroLinkExecutionContext): {
        isValid: boolean;
        errors: string[];
        warnings: string[];
    };
    /**
     * Validate context permissions for tool execution
     *
     * @param context Execution context
     * @param requiredPermissions Permissions required by tool
     * @returns Whether context has required permissions
     */
    static hasPermissions(context: NeuroLinkExecutionContext, requiredPermissions: string[]): boolean;
}
