/** * @license * Copyright 2025 OSAgent OC * SPDX-License-Identifier: Apache-2.0 */ import type { ContextRule, ActiveContext, ContextHierarchy } from './types.js'; /** * Context Manager - handles auto-detection and loading of context */ export declare class ContextManager { private hierarchy; private currentContext; private customRules; constructor(hierarchy?: ContextHierarchy); /** * Create empty context */ private createEmptyContext; /** * Detect context from working directory and file */ detectContext(workingDirectory?: string, currentFile?: string, prompt?: string): ActiveContext; /** * Match directory pattern */ private matchDirectoryPattern; /** * Match file pattern */ private matchFilePattern; /** * Match keyword pattern */ private matchKeywordPattern; /** * Check if rule applies to current context */ private ruleApplies; /** * Extract project name from directory */ private extractProjectName; /** * Extract task type from pattern */ private extractTaskType; /** * Deduplicate rules by ID */ private deduplicateRules; /** * Get current context */ getCurrentContext(): ActiveContext; /** * Get current context (alias for getCurrentContext) */ getContext(): ActiveContext; /** * Update context with new detection */ updateContext(directory?: string, file?: string, task?: string): ActiveContext; /** * Add custom context rule */ addRule(rule: ContextRule): void; /** * Remove custom context rule */ removeRule(ruleId: string): boolean; /** * Get agents for current context */ getContextAgents(): string[]; /** * Get skills for current context */ getContextSkills(): string[]; /** * Check if an agent should be active in current context */ isAgentActive(agentId: string): boolean; /** * Check if a skill should be active in current context */ isSkillActive(skillId: string): boolean; /** * Get project-specific agents based on directory */ getProjectAgents(directory: string): string[]; /** * Export context hierarchy for persistence */ export(): ContextHierarchy; /** * Import context hierarchy */ import(hierarchy: ContextHierarchy): void; /** * Get context summary for display */ getContextSummary(): string; } export declare const defaultContextManager: ContextManager; export declare const PROJECT_CONTEXT_RULES: Record; export declare const FILE_CONTEXT_RULES: Record; export declare const TASK_CONTEXT_RULES: Record; /** * Utility function to get context from directory, file, and task */ export declare function getContext(directory?: string, file?: string, task?: string): ActiveContext; /** * Utility function to update context and return it */ export declare function updateContext(directory?: string, file?: string, task?: string): ActiveContext;