/** * Context Budget Manager * Ranks installed skills by relevance to the current project and selects * the best combination that fits within a token budget. * * Relevance scoring (no LLM required): * 1. File extension matching — project files vs. skill code languages * 2. Dependency matching — package.json / requirements.txt keywords * 3. Keyword density — skill keywords vs. project file names * 4. Recency boost — recently installed skills get a small bump */ export interface SkillWithRelevance { /** Skill name */ name: string; /** Path to skill directory */ path: string; /** Estimated token count */ tokens: number; /** Relevance score 0-100 */ relevance: number; /** Why this relevance score */ reason: string; /** Full SKILL.md content (for output) */ content: string; } export interface ContextPlan { /** Skills selected to load (within budget) */ loaded: SkillWithRelevance[]; /** Skills skipped (didn't fit or too irrelevant) */ skipped: SkillWithRelevance[]; /** Total tokens used */ totalTokens: number; /** Budget that was set */ budget: number; /** Budget remaining */ budgetRemaining: number; } export interface ContextOptions { /** Token budget */ budget: number; /** Minimum relevance score to include (0-100, default 10) */ minRelevance?: number; /** Project directory to analyze (default: process.cwd()) */ projectDir?: string; /** Output format */ format?: 'text' | 'xml' | 'json'; } /** * Build a context plan that fits installed skills into a token budget. * * @param skillPaths — array of absolute paths to skill directories * @param options — budget + project analysis options */ export declare function buildContextPlan(skillPaths: string[], options: ContextOptions): Promise; /** * Format the context plan as XML for agent consumption. */ export declare function formatContextXML(plan: ContextPlan): string; /** * Format the context plan as JSON. */ export declare function formatContextJSON(plan: ContextPlan): string; //# sourceMappingURL=context-budget.d.ts.map