context-guardian
LuminariSoftwares/context-guardian
为 compaction-basic 提供压缩兜底:当 LLM 摘要抛错、返回空内容或放不进上下文窗口时,改为确定性编译该区段,每行带 seq 指针(内置 dsh-compaction-instant 编译器)。提供 recall、search 工具与 /recall、/context 命令,占用超过窗口 45% 时空闲自动压缩,并将被压缩区段归档到磁盘。引擎以一行配置挂载到 agent preset(见 docs/dsh-integration.md)。
- 形态
- Plugin 插件
- 安装
- npm 包安装
- 需要密钥
- 是
- 近月下载
- 2,821
- 最近推送
- 昨天更新
项目说明
From README
Context Guardian Status: active development -- changelog mcp-name: io.github.LuminariSoftwares/context-guardian A 40-turn session: 1,130,722 tokens sent upstream without it, 161,141 with it.
A compaction proxy for OpenAI-compatible local backends that fails open, so a long session stops dying at the context limit.Quick start (60 seconds) Local model CLI, through the proxy: With an AI agent: paste one line, "Install context-guardian (docs: and point my client at it".llms.
txt is the whole install, configure, recall and limits story in one short file an agent can read.Another backend or window: see examples/ or Configure.Your client's settings: Point your client at the proxy.
After a compaction, context-guardian-recall " " searches the archived originals (the summary the model receives names the exact command and the MCP tools).DeepSeek Harness: dsh plugin --profile web add dsh-context
Original description
40 turns: 1,130,722 tokens upstream -> 161,141. A fail-open compaction proxy for local OpenAI-compatible models.
安装方式
npm 包安装 · 需要额外配置密钥
pip install context-guardian && context-guardian # proxy on :8786 in front of Ollama on :11434; set OPENAI_BASE_URL=http://localhost:8786/v1pip install context-guardian安全能力
静态扫描源码得到的权限画像 —— 回答的是「它要动什么」,而不是「它好不好」
- 执行命令
- 写入文件
- 读取文件
- 访问网络
- 读取环境变量
未发现已知红线(明文传输、安装期执行代码、凭据外传等)。
能力与红线来自 awesome-dsh-plugin 的静态扫描结果(CC0 公有领域),本站未逐行复核源码; 它只覆盖能被静态识别的模式,不等于安全审计结论。
为什么是这个分数
近 2 天仍在推送;README 给出了可直接复制的安装命令;运行前需要准备 API Key 或环境变量;近月 npm 下载 2821 次,star 不多但真在被使用。
- 维护活跃
- 100
- 实用度
- 92
- 生态热度
- 69
- 上手便捷
- 74
- 信号质量
- 100
- 数据置信度
- 100%
相关插件
tool-guardian
LuminariSoftwares/tool-guardian
用三个路由工具(list_capabilities、describe_tool、call_tool)代理 stdio MCP 服务器,schema 按需加载,不再随每次请求发送;所有工具结果经过确定性输出阶梯压缩,有损处理前先归档原文(retrieve_spill 可读回);按 token 为工具分组标价,并可按 agent 隐藏内置分组。桥接到纯标准库的 Python 路由器,需要 Python 3.9+。
smart-compaction
JoblessJoe/smart-compaction
让模型自己挑安全时机触发压缩:提供 compact_now 工具(回合进行中也能用),另有 context_status 工具,按会话真实的上下文窗口报告 token 占用。
dsh-context-zip
brunhildzhou/dsh-context-zip
接管 DSH 自带的压缩摘要器,改用五段式交接摘要,被压掉的每条消息都能在分段目录里读回。