AQYLPZ/bale ↗★ 0

bale

DSH plugin that compresses large tool outputs before they enter the model context, with hash-based retrieval of the original text.

套件
bale
相容性
待驗證
版本
0.1.3
授權
MIT
最近更新
2026年11月9日

安裝

$npx -p @deepseek-ai/dsh dsh plugin --profile web add github:AQYLPZ/bale

配置参考

插件配置(cordis.patch.yml 的 config)

键默认说明
enabledtrue总开关
minChars8192低于此长度不压缩
maxChars33554432超过此长度不压缩(32MB,防巨量输出卡死)
tools见下允许压缩的工具白名单
protectTools见下强制不压缩的工具
kinds["log","json","code","diff","search","generic"]允许的压缩类型(text 默认停用)
kindsAreOpentruetrue = 以 sidecar 判定为准,kinds 仅作参考;false = 严格按 kinds 过滤
sidecarUrlhttp://127.0.0.1:8797sidecar 地址
timeoutMs15000压缩超时(spill 全文场景自动放宽 4 倍)
replaceModereplacereplace 替换内容;preview 只加标记不替换
sidecarPythonnullsidecar 用的 pythonw 绝对路径
sidecarScriptnullsidecar.py 绝对路径
storeDirnull原文存储目录
wsDirnull工作区目录(CCR 缓存等)
logFilenull插件日志路径

默认白名单:

tools: ['ops_bash', 'bash', 'pwsh', 'web_fetch', 'run_code']

默认保护名单(输出必须逐字精确的场景):

protectTools:
  - read, edit, write, grep, glob
  - ops_read_files, ops_inspect_local_file, ops_edit_file,
    ops_write_file, ops_grep, ops_glob, ops_stat,
    ops_read_table, ops_read_docx, ops_read_pdf

读代码、搜索代码、读文档类的工具一律不压 —— 模型需要精确行号、路径和代码原文,任何折叠都可能误导它。

环境变量(sidecar 层)

变量默认说明
HEADROOM_DISABLED_KINDStext逗号分隔,禁用的 kind。设空串可全部启用
HEADROOM_STORE_DIR/store原文存储目录
HEADROOM_STORE_MAX_MB256store 容量上限(超限按 mtime 淘汰最旧)
HEADROOM_STORE_TTL_HOURS168store 保留时长(7 天)
HEADROOM_WORKSPACE_DIR/headroom_ws工作区
HEADROOM_LOG_DIR``sidecar 日志目录
HEADROOM_HF_HOME自动推导HuggingFace 缓存目录(text 压缩用)
HEADROOM_ALLOWED_PATHS空允许 /compress 读取的额外目录(path 模式白名单)
HEADROOM_CRIT_BUDGET200关键行提取上限(行数)
HEADROOM_SAMPLE_HEAD80generic 保留头部行数
HEADROOM_SAMPLE_TAIL40generic 保留尾部行数
HEADROOM_SAMPLE_MIN_CHARS8192generic 抽样触发阈值

插件配置(cordis.patch.yml 的 config)

键默认说明
enabledtrue总开关
minChars8192低于此长度不压缩
maxChars33554432超过此长度不压缩(32MB,防巨量输出卡死)
tools见下允许压缩的工具白名单
protectTools见下强制不压缩的工具
kinds["log","json","code","diff","search","generic"]允许的压缩类型(text 默认停用)
kindsAreOpentruetrue = 以 sidecar 判定为准,kinds 仅作参考;false = 严格按 kinds 过滤
sidecarUrlhttp://127.0.0.1:8797sidecar 地址
timeoutMs15000压缩超时(spill 全文场景自动放宽 4 倍)
replaceModereplacereplace 替换内容;preview 只加标记不替换
sidecarPythonnullsidecar 用的 pythonw 绝对路径
sidecarScriptnullsidecar.py 绝对路径
storeDirnull原文存储目录
wsDirnull工作区目录(CCR 缓存等)
logFilenull插件日志路径

默认白名单:

tools: ['ops_bash', 'bash', 'pwsh', 'web_fetch', 'run_code']

默认保护名单(输出必须逐字精确的场景):

protectTools:
  - read, edit, write, grep, glob
  - ops_read_files, ops_inspect_local_file, ops_edit_file,
    ops_write_file, ops_grep, ops_glob, ops_stat,
    ops_read_table, ops_read_docx, ops_read_pdf

读代码、搜索代码、读文档类的工具一律不压 —— 模型需要精确行号、路径和代码原文,任何折叠都可能误导它。

2. 移除配置