/**
 * Configuration for a context loader.
 */
export interface ContextLoaderConfig {
    /** Agent ID (session name) */
    agentId: string;
    /** Agent's role */
    role: string;
    /** Project path */
    projectPath?: string;
    /** Team ID */
    teamId?: string;
}
/**
 * Result of loading a context module.
 */
export interface ContextLoadResult {
    /** Context module name */
    name: string;
    /** Loaded content */
    content: string;
    /** Estimated token count */
    estimatedTokens: number;
    /** When this context was loaded */
    loadedAt: Date;
}
/**
 * A context loader function that retrieves dynamic data for a context module.
 */
export type ContextLoader = (config: ContextLoaderConfig) => Promise<string>;
/**
 * Service that manages runtime context assembly for agents.
 *
 * Unlike prompt modules (static, assembled once at startup), context modules
 * contain dynamic data that can be refreshed mid-session. Context is compactable
 * by F13 ContextWindowMonitor.
 *
 * Responsibilities:
 * - Registers context loaders for different data sources
 * - Loads and assembles context on demand
 * - Supports mid-session refresh without full rebuild
 * - Enforces context token budgets
 * - Tracks loaded context for cache/refresh management
 *
 * @example
 * ```typescript
 * const contextService = new ContextAssemblyService();
 *
 * contextService.registerLoader('memory', async (config) => {
 *   const memoryService = MemoryService.getInstance();
 *   return memoryService.getFullContext(config.agentId, config.projectPath);
 * });
 *
 * const context = await contextService.loadAll({
 *   agentId: 'crewly-dev-001',
 *   role: 'developer',
 *   projectPath: '/path/to/project',
 * });
 * ```
 */
export declare class ContextAssemblyService {
    private logger;
    private loaders;
    private cache;
    private totalTokenBudget;
    constructor(tokenBudget?: number);
    /**
     * Register a context loader for a named context module.
     *
     * @param name - Context module name (e.g., 'memory', 'team_context')
     * @param loader - Async function that loads context data
     */
    registerLoader(name: string, loader: ContextLoader): void;
    /**
     * Remove a registered context loader.
     *
     * @param name - Context module name to remove
     */
    removeLoader(name: string): void;
    /**
     * Get names of all registered loaders.
     *
     * @returns Array of registered loader names
     */
    getLoaderNames(): string[];
    /**
     * Load a single context module by name.
     *
     * @param name - Context module name
     * @param config - Loader configuration
     * @param useCache - Whether to return cached result if available (default: false)
     * @returns Context load result or null if loader not found
     */
    load(name: string, config: ContextLoaderConfig, useCache?: boolean): Promise<ContextLoadResult | null>;
    /**
     * Load all registered context modules and assemble into a single string.
     *
     * @param config - Loader configuration
     * @returns Assembled context string
     */
    loadAll(config: ContextLoaderConfig): Promise<string>;
    /**
     * Refresh a specific context module (reload from source).
     *
     * @param name - Context module name to refresh
     * @param config - Loader configuration
     * @returns Refreshed context or null
     */
    refresh(name: string, config: ContextLoaderConfig): Promise<ContextLoadResult | null>;
    /**
     * Clear all cached context data.
     */
    clearCache(): void;
    /**
     * Get cached context by name (without reloading).
     *
     * @param name - Context module name
     * @returns Cached result or null
     */
    getCached(name: string): ContextLoadResult | null;
    /**
     * Get or set the total token budget.
     *
     * @param budget - Optional new budget to set
     * @returns Current token budget
     */
    tokenBudget(budget?: number): number;
    /**
     * Refresh context with a reduced budget — triggered by ContextWindowMonitorService
     * (Feature F13) when context window usage exceeds the compaction threshold (80%).
     *
     * Only reloads the highest-priority loaders that fit within the reduced budget.
     * Loaders are loaded in registration order; once budget is exhausted, remaining
     * loaders are skipped.
     *
     * Integration: ContextWindowMonitorService calls this via
     * `contextAssembly.compactRefresh(config, reducedBudget)` when usage > 80%.
     *
     * @param config - Loader configuration
     * @param reducedBudget - Reduced token budget for compacted context
     * @returns Assembled context string within reduced budget
     */
    compactRefresh(config: ContextLoaderConfig, reducedBudget: number): Promise<string>;
}
//# sourceMappingURL=context-assembly.service.d.ts.map