WODE25500/dsh-token-diet0

dsh-token-diet

DSH token-saving toolkit: proactively slim large text/JSON/CSV before they enter context (diet_text / diet_json / diet_csv / diet_estimate). Configurable compression presets (light/balanced/aggressive) + per-field overrides via settings. Zero-dependency pure functions.

包名
dsh-token-diet
版本
0.2.0
许可证
MIT
最近更新
2026年8月19日

安装

$npx -p @deepseek-ai/dsh dsh plugin --profile web add github:WODE25500/dsh-token-diet

压缩比例配置(settings)

插件注册 settings 命名空间 token-diet,在 Web UI 设置面板或 settings 文件中调整:

三档预设(preset,一键切换)

档位适用场景headCharsmaxKeysmaxSample压缩强度
light需要细节的任务(代码评审、精确引用)2000256
balanced(默认)大多数任务,骨架完整且 token 明显减少800123
aggressive极端省 token(长会话、批量处理)30062

逐项覆盖(可选,覆盖档位默认值)

headChars / tailChars / maxKeywords / maxKeys / maxSample / maxDepth / maxSampleRows / maxColStats


## 使用示例

diet_estimate text: "" → {"chars":102400,"tokens":25600,"verdict":"必须瘦身"} diet_csv csv: "" → 列统计 + 5 行抽样 + 建议 diet_json json: "" → 结构骨架 + 抽样 diet_text text: "" → 头 800 字 + 尾 300 字 + 高频词