/** * PromptOptimizer — reduces token count of agent instruction strings. * * Strategies applied (in order): * 1. stripEmojiFromHeaders — removes leading emoji from markdown headings * 2. removeIdentitySection — deletes the boilerplate "Identity & Memory / Mindset" block * 3. removePersonalitySection — deletes "Communication Style / Personality" flavour text * 4. collapseBlankLines — 3+ consecutive newlines → 2 * * Usage: * PromptOptimizer.compress(instructionText) // all passes * PromptOptimizer.estimateTokens(text) // rough token count (chars / 4) */ export declare class PromptOptimizer { /** * Strip leading emoji from markdown headings only. * "## 🎯 Core Mission" → "## Core Mission" * Body text emoji are preserved (they may carry semantic meaning). */ static stripEmojiFromHeaders(text: string): string; /** * Remove the "Identity & Memory" / "Identity & Mindset" section. * This is a ~60-token boilerplate block in every agent that restates the * role description already present in the frontmatter and opening sentence. * * Removes everything from the heading line up to (but not including) the * next same-level or higher heading. */ static removeIdentitySection(text: string): string; /** * Remove the "Communication Style" / "Your Communication Style" section. * These personality flavour sections add no operational instruction. */ static removeCommunicationStyleSection(text: string): string; /** * Collapse 3+ consecutive blank lines into at most 2. */ static collapseBlankLines(text: string): string; /** * Estimate token count using the ~4 chars per token heuristic. * Accurate to within ±15% for English prose and code. */ static estimateTokens(text: string): number; /** * Apply all compression passes and return the optimised text. * Typical savings: 15–25% reduction in token count. */ static compress(text: string): string; /** * Return a report comparing original vs compressed sizes. */ static report(original: string, compressed: string): { originalTokens: number; compressedTokens: number; savedTokens: number; reductionPct: number; }; } //# sourceMappingURL=PromptOptimizer.d.ts.map