Reverse engineered prompt

GitHub

Build me a small TypeScript package for Pi that does dynamic context pruning for chat style prompts. The idea is to help keep the prompt size under control by automatically trimming or summarizing older context while keeping the most important recent and relevant parts, so a Pi app can keep going without blowing up the context window.

Please make it feel like an early but usable MVP, not overengineered. I want a clean public API from the main entry file, sensible defaults, and a simple way to feed in conversation history and get back a pruned version that still preserves key information. Include a few tests that show the basic behavior, especially keeping important messages and dropping less useful ones when things get too long.

If anything about Pi or the pruning approach is unclear, look up the current docs online and make reasonable choices. Also add a short README example so someone can see how to use it right away.

Have a live product UI? Try website reverse