@goodandready/dsh-context-lens

devtested: passnpmMIT condition deviation

DSH plugin for semantic AST code skeletonization and test/build log compression

📦 体积
13.18 MB · medium
🔌 Network
undeclared
✅ Sandbox
pass
🏷️ Versions
35

Who this is for

  • anyone who wants the agent to remember long-running context
下载量 / Downloads
0
依赖体积 / node_modules
13.18 MB
测试时间 / Tested
2026-11-06
DSH 版本 / Version
0.2.2-rc.1

Install

dsh plugin --profile web add @goodandready/dsh-context-lens

Sandbox test results

條件偏離 —— 本結果在 DSHIO/T 21 v0.9 條件下產生(內存 1g、CPU 1.5、T4 超時 60s,未記鏡像 digest)。偏離條款:5.1.3(内存 768MB)、5.1.3(CPU 1 核)、5.1.6(T4 超时 90s)、5.1.2(镜像 digest)。按 DSHIO/T 21 §8.2,該判定不得與標準條件結果比較,不得用作認證依據。
StageResult
T0 static check—
T1 install✓
T2 list✓
T3 mount✓
T4 boot—

Four stages run in an isolated sandbox: install (network on) → list → mount → boot (last three with no network).

README

📦 @goodandready/dsh-context-lens

<div align="center">

<h3>DeepSeek Harness 语义 AST 代码骨架提取与测试日志压缩插件</h3>

<p align="center">

<a href="https://www.npmjs.com/package/@goodandready/dsh-context-lens"><img src="https://img.shields.io/npm/v/@goodandready/dsh-context-lens.svg?style=for-the-badge&color=6366f1&labelColor=1e1b4b" alt="npm version"></a>

<a href="LICENSE"><img src="https://img.shields.io/badge/License-MIT-10b981.svg?style=for-the-badge&color=10b981&labelColor=064e3b" alt="license"></a>

<a href="https://github.com/topics/dsh-plugin"><img src="https://img.shields.io/badge/DSH-Plugin-8b5cf6.svg?style=for-the-badge&labelColor=2e1065" alt="DSH Plugin"></a>

<a href="https://nodejs.org"><img src="https://img.shields.io/badge/Node-20%2B-f59e0b.svg?style=for-the-badge&labelColor=451a03" alt="Node version"></a>

</p>

<!-- Showcase Button -->

<p align="center">

<a href="https://goodandready.app/"><img src="https://img.shields.io/badge/作者全部项目-goodandready.app-ff4500.svg?style=for-the-badge&logo=rocket&logoColor=white&labelColor=1a1a2e" alt="作者全部项目"></a>

</p>

<p align="center">

<a href="README.md"><b>🇬🇧 English</b></a> •

<a href="README.ru.md"><b>🇷🇺 Русский</b></a> •

<a href="README.zh.md"><b>🇨🇳 中文说明</b></a>

</p>

<table align="center">

<tr>

<td align="center">

⭐ <strong>如果您喜欢本插件,请在 GitHub 上点亮 Star</strong> —— 这能让我了解插件对您有所帮助,并激励我持续维护和演进它。

<br><br>

🐛 <strong>如遇问题或有功能建议</strong>,欢迎使用任意语言提交 GitHub Issue —— 您的所有实用建议都将在后续版本中得到评估和实现。

</td>

</tr>

</table>

</div>


⚡ 核心定位与职责划分

说明:
上下文预算控制、Token 计数、工具输出头尾截断 (dsh-compaction-tool-result-pruner) 以及大文件溢出落盘 (dsh-spill-policy, dsh-token-meter) 由 DSH 核心引擎 (>= 0.1.5) 原生负责。
dsh-context-lens 专注于核心不具备的能力 —— 语义压缩:
1. AST 代码骨架生成:提取函数签名、接口、类型定义及文档注释,去除冗长实现体(支持 9+ 种语言)。
2. 焦点路径机制:正在编辑的文件保留全量内容,周边工作区文件生成骨架。
3. 测试与构建日志压缩:保留失败信息、错误栈及汇总结果,剔除冗余输出。
graph LR
    subgraph RawContext [原始输入]
        Code[📁 源代码] --> Lens[dsh-context-lens 语义引擎]
        Logs[📋 测试与构建日志] --> Lens
    end

    subgraph Lens [语义压缩处理]
        Lens --> Focus{路径焦点判断}
        Focus -->|聚焦文件| FullCode[保留完整代码]
        Focus -->|周边文件| AST[AST 骨架提取]
        Lens --> LogCompress[日志压缩: 错误/堆栈/汇总]
    end

    subgraph Output [优化后上下文]
        FullCode --> Agent[🤖 Agent 上下文]
        AST --> Agent
        LogCompress --> Agent
        Agent --> Core[⚙️ DSH 核心截断与溢出策略]
    end

    style RawContext fill:#1e1e2e,stroke:#89b4fa,stroke-width:2px,color:#cdd6f4
    style Lens fill:#181825,stroke:#cba6f7,stroke-width:2px,color:#cdd6f4
    style Output fill:#11111b,stroke:#a6e3a1,stroke-width:2px,color:#cdd6f4

🛠️ Agent 工具参考 (归并至 2 个工具)

所有工具完全符合 DeepSeek Harness 规范,output.render 统一返回 ContentBlock[] 数组。

工具名 · 操作模式 · 参数 · 描述

context_lens_code · action: "skeleton" (默认) · filePath?, code?, language?, maxDepth?, sessionId? · 直接从 filePath 读取并生成 AST 骨架(无需预先读取完整文件,节省上下文),或基于传入的 code 处理。若处于焦点内则返回完整代码

context_lens_code · action: "focus" · paths: string[], sessionId? · 设置当前会话的焦点路径列表

context_lens_code · action: "get_focus" · sessionId? · 获取当前会话的焦点状态

context_lens_code · action: "clear_focus" · sessionId? · 清空当前会话的焦点路径

context_lens_log · N/A · text (或 log), mode?, maxLines?, auto?, command? · 压缩测试或构建日志,保留错误、堆栈及总结信息


⚙️ 配置项

在 DSH 设置中心 (plugins.row.config / plugins.item) 中配置:

配置项 · 类型 · 默认值 · 描述

compressionMode · string · 'balanced' · 日志压缩模式 (raw, balanced, aggressive)

astSkeletonMaxDepth · number · 3 · AST 骨架最大嵌套深度

autoCompressThreshold · number · 4000 · 调用 context_lens_log (auto: true) 时自动压缩触发的字符阈值(设为 0 禁用)


📄 授权协议

MIT © GooDAnDReaDY

Rendered from the README published on npm. Formatted only, not edited.

Embed the badge

Two badges, each using its own site's identity: left is the **standard** (published by DSHIO), right is the **testing organization** (deepseekbase, which ran the inspection). Each links to the standard text and the test report.

DSHIO/T 10deepseekbase

Markdown(推荐,两个一起)

[![DSHIO/T 10](https://deepseekbase.com/badge/std.svg)](https://dshio.org/10/) [![deepseekbase](https://deepseekbase.com/badge/goodandready-dsh-context-lens.svg)](https://deepseekbase.com/zh/plugins/goodandready-dsh-context-lens/)

Note: this is not a certification. DSHIO/T 32 is not in effect.

Versions

Published on npm::35,最后更新 2026-10-23

Links

GitHub · Homepage · npm

Frequently asked

How do I install @goodandready/dsh-context-lens?
Run dsh plugin --profile web add @goodandready/dsh-context-lens in DSH, or paste the package name into the DSH Desktop plugin page.
What if it fails to install?
Check your DSH version first (dsh --version), then look at the first error in the test-results section. If it still fails, open an issue on the repository.
How do I uninstall it?
Run dsh plugin --profile web remove @goodandready/dsh-context-lens.

Same category

Compare with peers

PluginDownloadsVerdictSize
@michengai/dsh-skills-manager174.8Kpass262.02 MB
dsh-unlag59.4Kpass0.37 MB
@michengai/dsh-simplify15.1Kpass11.51 MB
dsh-plugin-toolkit11.3Kpass0.42 MB
dsh-mcp-registry10.0Kinstall_failed—
huaweicloud-devkit9.3Kpass4.45 MB
dsh-plugin-health9.1Kpass2.01 MB
dsh-mcp-panel8.5Kpass16.85 MB