JessenReinhart/dsh-snapcompact ↗★ 0
dsh-snapcompact
Bitmap-frame context compression plugin for DSH: deterministic pixel-font visual archiving of conversation history 适合需要对历史对话进行像素级视觉归档以节省Token用量的用户。
설치
$
npx -p @deepseek-ai/dsh dsh plugin --profile web add github:JessenReinhart/dsh-snapcompact2. Register Bundle in Profile Configuration
Add packages/dsh-snapcompact to dsh.profile.bundles in your profile's package.json (e.g. ~/.dsh/profiles/desktop/package.json):
{
"dsh": {
"profile": {
"bundles": [
"packages/dsh-snapcompact"
]
}
}
}
The plugin automatically mounts its Cordis row via the bundled cordis.patch.yml.
Usage
Commands
In any DSH session chat:
/snapcompact— Archive older history immediately using smart defaults (auto shape, max 8 frames, retains 16% recent tokens in plain text)./snapcompact auto— Toggle automatic background compaction when the agent is idle./snapcompact auto on— Enable automatic idle compaction./snapcompact auto off— Disable automatic idle compaction./snapcompact auto threshold— Set context window threshold percentage to trigger idle compaction (default 80%)./snapcompact status— Display current configuration, threshold, and live session token usage./snapcompact --frames— Archive history with custom maximum frame count./snapcompact --shape— Archive history with specific font/shape variant (11on16-bw,8on22-bw,silver16-bw)./snapcompact --all— Archive all eligible history without retaining recent plain text.
Persistence
Auto-compaction preferences are saved to ~/.dsh/snapcompact-config.json and persist across sessions and application restarts.
Programmatic Compaction
const snapcompact = ctx.get("snapcompact");
await snapcompact.compactNow(agent, signal);