GooDAnDReaDY/dsh-context-lens

DSH plugin for AST context compression, test log filtering, and token budget guard

Project Overview项目介绍

@goodandready/dsh-context-lens is a semantic AST code skeletonizer and test log condenser built specifically for the DeepSeek Harness (DSH) agent runtime, distributed as an npm package named @goodandready/dsh-context-lens and loaded through the DSH Settings page via plugins.row.config. The README explicitly positions it as filling the gap that DSH core (>= 0.1.5) does not cover: token counting, head/middle/tail pruning, and disk spilling remain the core's responsibility, while this plugin owns semantic compression only. It ships as an MIT-licensed npm module requiring Node.js 20+, pure-regex implementation across TypeScript, JavaScript, Python, Go, C/C++, Rust, Java, and SQL DDL.

The plugin exposes two consolidated agent tools that strictly conform to the DeepSeek Harness tool specification by returning structured ContentBlock[] arrays through output.render. context_lens_code supports four actions — skeleton (default), focus, get_focus, and clear_focus — letting a session mark active editing paths whose code is returned in full while surrounding files are reduced to imports, classes, structs, interfaces, exported types, signatures, and doc comments. context_lens_log condenses Jest, Vitest, Pytest, node --test, Go test, Cargo, Webpack, Vite, TSC, Maven, and Gradle output through raw, balanced, and aggressive modes, preserving errors, stack traces, and Expected/Received assertion diffs.

Three DSH-scoped configuration fields govern behavior: compressionMode defaults to balanced, astSkeletonMaxDepth defaults to 3, and autoCompressThreshold defaults to 4000 characters, with 0 disabling auto compression. Focus state is strictly scoped per sessionId so cross-session leakage is prevented, and the optimized output flows back into DSH core for final pruning and spill policy decisions. The package carries an MIT license, ships English/Russian/Chinese READMEs, and requires awareness of the DSH core vs plugin responsibility split before adoption.

@goodandready/dsh-context-lens 是一款专为 DeepSeek Harness(DSH)设计的语义上下文压缩插件,以 npm 包形式发布并通过 DSH 设置页加载。它聚焦于 DSH 内核未覆盖的语义压缩任务:提供多语言 AST 代码骨架化(支持 TypeScript、JavaScript、Python、Go、C/C++、Rust、Java、SQL DDL 等 9+ 语言),以及针对 Jest、Vitest、Pytest、Go test、Cargo、Webpack、Vite、TSC 等工具的测试与构建日志智能凝缩,输出仍交由 DSH core(≥0.1.5)的 token-meter 与 spill-policy 接管。

插件对外暴露两个工具 context_lens_code 与 context_lens_log,严格遵循 DSH 工具规范的 output.render 格式。其中 context_lens_code 支持 skeleton、focus、get_focus、clear_focus 四种 action,用于标记哪些路径保留完整代码、哪些被骨架化处理;典型使用者是在 DSH 内核之上还需要对源码结构与冗长测试日志进行二次语义压缩的代理作者与大型项目维护者。

依赖方面要求 Node.js 20+,采用纯正则实现 AST 解析以避免重型原生依赖;配置项 compressionMode、astSkeletonMaxDepth、autoCompressThreshold(默认 4000 字符阈值)由 DSH 设置页的 plugins.row.config 管理。许可为 MIT,路径焦点状态以 sessionId 严格隔离,仓库已发布英、俄、中三语 README,需注意与 DSH core 的职责边界。

Pre-install check安装前体检Compatibility · Security兼容性 · 安全性 1 warning1 项注意
  • Only 2 stars - very few users, little community feedback星标只有 2,几乎没人在用,遇到问题缺少社区反馈
DSH walks through these 9 checksDSH 会逐条核对这 9 项

Compatibility兼容性

  • DSH, Node, OS and profile requirementsDSH 版本 / Node 版本 / 操作系统 / profile 是否满足要求
  • External dependencies and runtimes (Electron / Python / Docker, ...)外部依赖与运行时(Electron / Python / Docker 等)是否齐备
  • Conflicts with installed plugins: command names, skill / tool names, ports, duplicate MCP registration与已装插件是否冲突:命令名、skill / tool 重名、端口占用、重复 MCP 注册

Security安全性

  • Repo matches the facts registered here; archived or abandoned?仓库是否与页面登记一致,是否归档或长期停更
  • Safety of preinstall / install / postinstall and install.sh / setup.ps1preinstall / install / postinstall 与 install.sh、setup.ps1 是否安全
  • curl|bash, download-then-execute, obfuscation, unrelated domains → stop immediatelycurl|bash、下载即执行、混淆代码、无关域名 → 立刻停止
  • Typosquatting or unmaintained packages among the new dependencies新增依赖里有没有 typosquatting 或无人维护的包
  • Requested permissions vs. what the feature actually needs申请了哪些权限、是否超出功能所需(filesystem / network / shell / clipboard)
  • Any sudo / admin requirement, plus uninstall and rollback是否要求 sudo / 管理员权限,以及卸载与回滚方式

Anything uncertain must be marked unknown with a note on how to confirm it. This site's signal screen is a static snapshot, not a security audit.拿不准的必须标「未知」并说明要我怎么确认。本站的信号筛查是静态快照,不能替代安全审计。

Or use CLI install (for developers)或使用命令行安装(适合开发者)

CLI Install命令行安装

dsh plugin --profile web add github:GooDAnDReaDY/dsh-context-lens

把 GooDAnDReaDY/dsh-context-lens 加入你的 DSH 配置(web profile)即可启用。

READMEREADME

📦 @goodandready/dsh-context-lens

Semantic AST Code Skeletonizer & Test Log Condenser for DeepSeek Harness

npm version license DSH Plugin Node version

All Author Projects

🇬🇧 English • 🇷🇺 Русский • 🇨🇳 中文说明

⭐ If you like this plugin, please star it on GitHub — it shows me that the plugin is useful to you and motivates me to keep developing it.

🐛 If you find a bug or would like to request a feature, open a GitHub issue in any language — I will review your proposal and implement useful suggestions in a future plugin version.

⚡ Overview & Semantic Compression Focus

Note on DSH Core vs Plugin Responsibility:
Context budgeting, token counting, tool result pruning (head/middle/tail), and spilling long results to disk (dsh-spill-policy, dsh-compaction-tool-result-pruner, dsh-token-meter) are natively managed by the DSH core (>= 0.1.5).
dsh-context-lens focuses strictly on what the core does not do — semantic compression:

  1. AST Code Skeletons: Signatures, interfaces, exported types, and doc comments instead of whole function/method bodies across 9+ languages.
  2. Path-Based Focus: Full code for active editing targets while surrounding workspace files remain skeletonized.
  3. Test & Build Log Compression: Failures, errors, stack traces, and test summary instead of raw multi-megabyte terminal streams.

Showing the opening section of the README — the full document lives in the repository以上为 README 开头摘要,完整文档在仓库内 · View the full README on GitHub →在 GitHub 查看完整 README →

← 上一个 Prev dsh-lan-proxy 下一个 Next dsh-tvision →