{"_id":"@artale/pi-compact","_rev":"2-ee4251c49811d14ba98e6f1066b9af1c","name":"@artale/pi-compact","dist-tags":{"latest":"1.0.1"},"versions":{"1.0.0":{"name":"@artale/pi-compact","version":"1.0.0","keywords":["pi-package"],"author":{"name":"artale"},"license":"MIT","_id":"@artale/pi-compact@1.0.0","maintainers":[{"name":"artale","email":"arosstale1@gmail.com"}],"homepage":"https://github.com/arosstale/pi-compact#readme","bugs":{"url":"https://github.com/arosstale/pi-compact/issues"},"pi":{"extensions":["src/extension.ts"]},"dist":{"shasum":"8cc1a003d2b593273cf88d8fca0e4635adbce673","tarball":"https://registry.npmjs.org/@artale/pi-compact/-/pi-compact-1.0.0.tgz","fileCount":3,"integrity":"sha512-XQQhurgH+mBzY+3uizMxskyh2hWuSpEzoeaRgBX3dcIjhL5Q4ceiT6YYlA6C7ZvkQkr419o/pSsu96UnII99tw==","signatures":[{"sig":"MEUCIQCAOHbbIugeL723CfIpFcJd1t2KWMk05WkBzkGcWUq36gIgb2XhLXBCDfaQSnjxJIDg9h+87dF5PBuze2jN7EsEWVo=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":9985},"gitHead":"38cbd01adf1e8bce418df45ecf45781e22181fb1","_npmUser":{"name":"artale","email":"arosstale1@gmail.com"},"repository":{"url":"git+https://github.com/arosstale/pi-compact.git","type":"git"},"_npmVersion":"10.9.4","description":"Smart context compaction for Pi. Topic-aware summarization that preserves code context and drops chatter. Configurable strategies.","directories":{},"_nodeVersion":"22.22.0","_hasShrinkwrap":false,"peerDependencies":{"@mariozechner/pi-coding-agent":"*"},"_npmOperationalInternal":{"tmp":"tmp/pi-compact_1.0.0_1773451575718_0.2575286573688027","host":"s3://npm-registry-packages-npm-production"}},"1.0.1":{"name":"@artale/pi-compact","version":"1.0.1","description":"Smart context compaction for Pi. Topic-aware summarization that preserves code context and drops chatter. Configurable strategies.","keywords":["pi-package"],"license":"MIT","author":{"name":"artale"},"repository":{"type":"git","url":"git+https://github.com/arosstale/pi-compact.git"},"pi":{"extensions":["src/extension.ts"]},"peerDependencies":{"@mariozechner/pi-coding-agent":"*"},"_id":"@artale/pi-compact@1.0.1","gitHead":"517792d74e3ebf0a3390a11d9d201d7b47cd4f76","bugs":{"url":"https://github.com/arosstale/pi-compact/issues"},"homepage":"https://github.com/arosstale/pi-compact#readme","_nodeVersion":"22.22.0","_npmVersion":"10.9.4","dist":{"integrity":"sha512-JxOxP0lLyd472+ZMSHjizScwWCO19+IEg7+2KTWDKC4FFlmGhtH8QlZAoKh5QR6tJF3Os3coX/kq4utK6gTwTg==","shasum":"39cdb290bab4a45b129ba489085bf198488a427d","tarball":"https://registry.npmjs.org/@artale/pi-compact/-/pi-compact-1.0.1.tgz","fileCount":3,"unpackedSize":10033,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQDC+BUqS84FC5H6laXL7kvqs3XgVYP5x4Q/Tck03v1D1wIgN0A9mGyxjfGodPMqx4VjLata9KVWi0TDHN7gWK1XuVk="}]},"_npmUser":{"name":"artale","email":"arosstale1@gmail.com"},"directories":{},"maintainers":[{"name":"artale","email":"arosstale1@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/pi-compact_1.0.1_1773505898486_0.6984132504478784"},"_hasShrinkwrap":false}},"time":{"created":"2026-03-14T01:26:15.592Z","modified":"2026-03-14T16:31:38.752Z","1.0.0":"2026-03-14T01:26:15.896Z","1.0.1":"2026-03-14T16:31:38.623Z"},"bugs":{"url":"https://github.com/arosstale/pi-compact/issues"},"author":{"name":"artale"},"license":"MIT","homepage":"https://github.com/arosstale/pi-compact#readme","keywords":["pi-package"],"repository":{"type":"git","url":"git+https://github.com/arosstale/pi-compact.git"},"description":"Smart context compaction for Pi. Topic-aware summarization that preserves code context and drops chatter. Configurable strategies.","maintainers":[{"name":"artale","email":"arosstale1@gmail.com"}],"readme":"# pi-compact\n\nSmart context compaction for Pi. Topic-aware summarization that preserves code context and drops chatter.\n\n## Install\n\n```bash\npi install npm:@artale/pi-compact\n```\n\n## Strategies\n\n### balanced (default)\nKeep code + key decisions. Summarize long discussions.\n\n### code-first\nPreserve all code blocks, file paths, errors, tool calls. Summarize prose to 1-2 sentences each. Drop social chatter.\n\n### aggressive\nKeep only actions and outcomes. Drop everything else. Target <20% of original length.\n\n## Commands\n\n```\n/compact status              — show compaction stats and current strategy\n/compact strategy <name>     — switch strategy (code-first|aggressive|balanced)\n/compact now                 — force compaction immediately\n/compact dry                 — preview what compaction prompt would be used\n```\n\n## Tools\n\n- `compact_status` — show current strategy and stats\n- `compact_strategy` — switch strategy programmatically\n\n## How it works\n\nHooks into Pi's compaction system via `pre_compaction` event. When Pi triggers compaction (auto or manual), pi-compact injects strategy-specific prompts that tell the summarization model what to preserve and what to drop.\n\n- **code-first**: preserves code blocks, file paths, errors, stack traces, tool I/O. Summarizes discussions.\n- **aggressive**: keeps only tool calls, code, and final decisions. Drops everything else.\n- **balanced**: preserves code + decisions with reasoning. Summarizes discussions to key points.\n\nTracks compaction count and reduction ratio per session.\n\n## Zero dependencies\n\nUses only Pi's built-in extension API. No external packages.\n\n## License\n\nMIT\n","readmeFilename":"README.md"}