DeepSHPlugins
dsh-funnel 项目预览
GITHUB / COMMUNITY PROJECT

dsh-funnel

工具与集成JavaScriptMIT

摄入时点的工具输出治理:保留 error/warning 行与头尾,全文落盘留指针供模型按需读回;覆盖所有返回文本的工具,小结果原样通过。

2 StarsYuanyuanMa03 更新时间 2026-08-15
访问 GitHub 仓库
dsh-funnel 项目预览

项目介绍

中文

摄入时点的工具输出治理:保留 error/warning 行与头尾,全文落盘留指针供模型按需读回;覆盖所有返回文本的工具,小结果原样通过。

English

Ingestion-time tool-output curation: keeps error and warning lines plus head and tail, spills the full text to disk with a pointer the model can read back; covers every text tool, small results pass through untouched.

项目信息与收录信号

快照 2026-09-11
作者 / 组织
YuanyuanMa03
仓库
YuanyuanMa03/dsh-funnel
GitHub Stars
2
Forks
0
开发语言
JavaScript
许可证
MIT
最近推送
2026-08-15
Manifest
数据中检测到声明

公开仓库不自动等于可商用;许可证与当前兼容性以原项目文档为准。Manifest 和数据评分不构成安装安全认证。

数据评分

56/ 100
维护活跃
81
文档与实用信息
85
生态关注度
14
安装便捷信号
100
项目声明信号
100

README 含完整安装与使用说明;关注度尚低(2);标准命令一键安装。

评分来自已有数据快照的五维模型,仅作浏览参考,不是实际使用评测或安全检测结论。

安装与使用

所有项目资料与许可均以对应 GitHub 仓库为准。

dsh plugin --profile web add dsh-funnel

复制命令不会自动执行。请先阅读仓库文档,确认环境要求与许可证。

项目截图

仓库 README

GitHub 原文

已保存的仓库文档快照;文档抓取时间未记录,可能与上方目录介绍处于不同版本。安装前请核对当前仓库说明。

dsh-funnel

English | 中文

Curate tool output before it enters the model's context — keep the lines that matter, spill the rest to disk with a pointer. Faster turns, smaller context, sharper attention, for every tool.

The problem

Every tool result is appended to the conversation and re-sent on every subsequent model request. A npm test run that prints 500 lines rides along for the rest of the session: you pay for it on each turn, it fills the context window, and it buries the one AssertionError the model actually needs.

The existing layers don't cover this:

LayerWhat existsWhat it doesn't do
Capture (executor)64 MB spill protects the process from OOMnothing about what the model sees
Execution (bash only)maxOutputBytes byte-cap, head truncationshell tools only; blind cut, no error lines kept
Compaction timeofficial tool-result-pruner rewrites over-budget results on the surfacefires only when compacting; blind head/tail; model can't read the original back
Ingestion — every result, immediately—← dsh-funnel

Compaction-time pruning cleans up after the budget is already blown; dsh-funnel keeps it from being blown. They compose.

What you get

  1. Install and forget. One command, zero configuration. The plugin covers every tool that returns text — bash, file reads, web fetch, search — and results under the threshold pass through byte-identical, so you never notice it until it saves you.
  2. A ~24× smaller model view, measured. In a real headless session, a 2001-line (8,893-byte) bash result reached the model as 370 characters: head, tail, and every error/warning line kept:
   - [2001 lines of raw output]
   + [dsh-funnel] output curated: 2001 lines → 40 kept (head 15, tail 25, 0 pattern-matched). Full output: .dsh-funnel/2026-08-15T09-21-56-548Z-bash-1.log
   + 1 … 15
   + [dsh-funnel] … 1959 similar lines omitted …
   + 1977 … 2000

Every later turn in the session pays for 370 characters instead of 8,893 — the saving compounds each request.

  1. Nothing is lost, and the model recovers on its own. The full text spills to .dsh-funnel/ and the notice carries the path. In testing, the model missed a middle line in the curated view, searched the spill file itself, and answered correctly — curation is pagination, not deletion. The spool doubles as an audit trail of what the agent actually saw.
  2. Long tasks hold up better. Smaller context means cheaper turns, later compaction, and less attention dilution — the agent stays sharp deeper into a session instead of degrading as junk accumulates.
  3. Tune it to your workflow. Threshold, kept lines, keyword patterns (add your project's own failure markers), per-tool aggressiveness, spill on/off.

Boundaries: error results are never touched (they are short and load-bearing); this complements compaction rather than replacing it.

How it works

dsh-funnel wraps the tools/execute extension point (the seam the official timeout guard uses) and curates the canonical value of successful results: the registry re-projects model-facing content from value, so the curated view is exactly what the model sees and what the session log records. Long string fields inside value — stdout, stderr, fetched pages, file contents — are replaced in place; error results are never touched.

Install

dsh plugin add github:YuanyuanMa03/dsh-funnel

Works on every tool that returns text — bash, file reads, web fetch, search.

Configuration

All fields optional; set them under the plugin entry in your profile:

- id: dsh-funnel
  name: 'dsh-funnel'
  config:
    maxChars: 4000        # results at or below this length pass through untouched
    keepHead: 15          # lines kept verbatim from the head
    keepTail: 25          # lines kept verbatim from the tail (errors usually live here)
    keepPatterns: [error, warn, fail, fatal, exception, assert, denied, panic]
    maxLineChars: 1000    # single oversized lines (minified/JSON) are capped
    spill: true           # write the full text to disk and reference it
    tools:                # per-tool overrides
      web_fetch: { maxChars: 2000 }

Safety properties

  • Error results are never touched — they are short and load-bearing.
  • Lossless at the disk level — spilling keeps the full text; the model re-reads on demand.
  • Model-visible ⟺ logged — the curated view replaces the result at the tool seam, so the session log records exactly what the model saw.
  • Byte-identical passthrough — results under maxChars return as the same object; zero allocation when idle.

Status

v0.1.0 — verified end-to-end in a real headless session: a 2001-line bash result was curated to 40 lines in model view and log, and the model recovered the omitted middle by reading the spill file (its own words: "the tool curates long output for display … verified against the complete saved output"). Unit tests cover the curation logic and the plugin wrapper. Planned: session-level savings accounting ("this session: N tokens avoided").

License

MIT

使用前核对

安装步骤、兼容版本与授权范围以原项目当前文档为准。Stars 和评分是快照中的导航信号。

安装与排错 · 项目问题反馈

同类项目