鱼皮AI导航
鱼皮AI导航
  • 主页
  • 社区
  • AI工具
  • AI知识库
  • AI提示词
  • MCP
  • Skills
  • AI学习资源
  • AI资讯
  • GitHub开源
登录/注册

dsh-context-proxy

按需取回薄层:context_query / context_slice / context_grep 三个工具读取已持久化的历史,引用可回放。

会话消息
访问 GitHub
文档README

dsh-context-proxy

Thin on-demand context-retrieval layer for the DeepSeek Harness.

Awesome DSH Plugin

Automatic truncation, spill-to-disk, compaction, and token metering are already owned by output-retention, spill-policy, compaction-basic, and session-query. This package adds only the missing piece: three model-facing tools that read already-persisted history back on demand.

Install

▼
sh
复制代码
dsh plugin --profile <name> add github:EvilIrving/dsh-context-proxy

Or, from a checkout:

▼
sh
复制代码
dsh plugin --profile <name> add ./dsh-context-proxy

The bundle patch inserts one plugin row (dsh-context-proxy). sessionQuery and subprocess are optional backends (ctx.get): without a sessionQuery backend each tool degrades to an isError result instead of waiting forever.

Tools

ToolBacking seamReturns
context_querysessionQuery.filterEventslightweight { seq, type, text } matches by seq/type/surface/text
context_slicesessionQuery.readEventone event plus a bounded before/after window
context_grepsubprocess (packaged rg) or sessionQuery.filterEventsmatches with { text, citation }

Citations are replay-safe: context_query/context_slice cite session:<seq> (rebuildable from the canonical log), and context_grep cites either a spill path (path:line, fast local path) or session:<seq> (semantic-text fallback when no spill path is supplied or available).

Config

▼
ts
复制代码
export interface Config { readWindowDefault: number // default before/after for context_slice (default 0) grepMaxBytes: number // rg stdout in-memory cap (default 1 MiB) rgGraceMs: number // rg termination grace (default 5000) }

Dependencies

  • sessionQuery and subprocess are optional services read via ctx.get(...). A missing sessionQuery backend degrades each tool to an isError result (session query backend unavailable) instead of leaving the plugin waiting forever; the same applies to subprocess for context_grep with an explicit path.
  • tools is a hard dependency (inject).
  • The packaged ripgrep binary comes from @vscode/ripgrep — the same mechanism dsh-tool-fs-search uses — so no system rg install is required and no shell layer exists between the argv vector and ripgrep.

Model Experience

Request context and condition

What the model sees

Three tool schemas (context_query, context_slice, context_grep) are registered into the agent's tool set. Each result is a compact JSON object of matches/items plus citations; no prose is returned for the model to parse ids out of.

Token effect

Zero-direct effect until a tool is invoked; each invocation's cost is bounded by the query/slice window and the grepMaxBytes cap.

KV Cache effect

Append-only: tool results append to the surface; they never rewrite earlier request tokens.

Known Limitations and Deferred Work

  • context_grep line parse is path:line:text — a spill path containing a newline (not expressible in the durable locator) would confuse the parser; absolute spill paths never contain one.
  • Fallback text scan is literal, not regex — when no spill path is supplied, context_grep falls back to sessionQuery's literal, case-insensitive, whitespace-flexible scan, not a regex search.
  • Bundle writing is not sandboxed — nothing here writes files; retrieval only reads through the seams.
会话消息

快捷安装

复制到终端去安装插件

dshplugin--profilewebaddgithub:EvilIrving/dsh-context-proxy

温馨提示

装插件等于在本机跑第三方代码,权限与你相同,能读文件、用凭据、访问网络,工具审批管不到。请只装可信来源,并尽量锁定 commit。

站长:程序员鱼皮 老鱼简历 商务合作 增值电信业务经营许可证
2026 鱼皮AI导航 | 沪ICP备19026706号-6
站长:程序员鱼皮 老鱼简历 商务合作 增值电信业务经营许可证
2026 鱼皮AI导航 | 沪ICP备19026706号-6
🔥热门工具
朱雀AI检测朱雀AI检测
朱雀AI检测助手朱雀AI检测助手
LovartLovart
老鱼简历老鱼简历
WritePass官网WritePass官网
面多多面多多
CursorCursor
星月写作星月写作
零感AI零感AI
墨得问题墨得问题
dsh 插件推荐
dsh-btw
提供 /btw 一次性上下文旁问,不执行工具;回答显示在可复制、折叠或关闭的独立气泡中,不写入主对话。
billion-context
billion-context官方版:上下文压缩插件,兼顾小窗口(100k上下文足矣)省token(省5倍token)和超长会话(数月级别几十亿token单会话)。
dsh-conversation-archive
在 Windows 上管理 DSH 已归档会话,支持搜索、批量取消归档与删除、AI 辅助文件保留,以及经过校验的本地或网络目录备份。
dsh-auto-continue
回答因达到单次输出 token 上限被截断时自动发送"继续"续写,无需手动操作;面向自部署 Ollama 等小输出上限场景。
dsh-branchmark#dsh-branchmark
Vibe Coding 时,如果突然想到另一个问题,或者看到一段以后还会用到的回答,可以先保存下来、在 Side Chat 里快速问清楚,或另开一个相关会话继续研究,不打断当前任务的开发思路和注意力。