DeepSeek Harness Plugin Hub

发布与管理完整 Harness Profiles,发现适合你的插件。

探索

插件目录环境预设文档中心动态

社区

发布插件联系我们报告问题

相关链接

Plugin Hub GitHubDeepSeek Harness 官方项目系统状态隐私说明
© 2026 DeepSeek Harness Plugin HubPowered byPaxTech

独立、非官方社区项目,与 DeepSeek 官方无隶属、授权或背书关系。

Context Lens — DeepSeek Harness 插件(DSH Plugin)
DeepSeek Harness Plugin Hub
ProfilesPlugins分类动态文档登录管理 Profiles
ProfilesPlugins分类动态文档登录
← Plugins

@goodandready/dsh-context-lens

Context Lens

用于 AST 上下文压缩、测试日志过滤和令牌预算保护的 DSH 插件

插件会安装到这里;不确定时保持 web。

npx -y @deepseek-ai/dsh plugin --profile web add @goodandready/dsh-context-lens@0.1.22
README兼容性版本

兼容性与来源证明

Context Lens 以 @goodandready/dsh-context-lens 发布,当前版本为 0.1.22。Plugin Hub 会校验它的 manifest,并保存精确安装来源,便于复现安装结果。

DSH 兼容范围
*
运行环境
web
发布来源
npm
Registry 更新时间
2026/9/20

版本

0.1.22stable
2026/9/19
0.1.21stable
2026/9/18
0.1.20stable
2026/9/18
查看其余 19 个版本收起版本
0.1.19stable
2026/9/18
0.1.18stable
2026/9/16
0.1.17stable
2026/9/13
0.1.16stable
2026/9/10
0.1.15stable
2026/9/9
0.1.14stable
2026/9/8
0.1.13stable
2026/9/6
0.1.12stable
2026/9/6
0.1.10stable
2026/9/4
0.1.9stable
2026/9/4
0.1.8stable
2026/9/2
0.1.7stable
2026/9/1
0.1.6stable
2026/8/31
0.1.5stable
2026/8/31
0.1.4stable
2026/8/31
0.1.3stable
2026/8/31
0.1.2stable
2026/8/31
0.1.1stable
2026/8/31

相关插件

正在加载相关插件…

最新版
0.1.22
DSH
*
HMR
重启进程
Tree shaking
未声明可安全裁剪
解包体积
139.2 kB
文件数
17
Surface
web
许可证
MIT
发布源
npm
GitHub
★ 1
周下载
942
安全扫描
✓ v0.1.22 扫描通过
最近提交
2026/9/19
查看源码 ↗项目主页 ↗
README Badge

点击下方 Badge 复制 Markdown,粘贴到 README 即可。

这是你的 Plugin?认领权益 · 优先安全扫描

验证 package.json 声明的 GitHub 仓库,即可管理这个公开页面。认领后,Hub 会优先安排当前版本的安全扫描,并在通过后公开展示结果。

认领这个 Plugin →
报告问题
0.1.0
stable
2026/8/31

相关插件

继续浏览 memory-context 分类下经过校验的插件。

Memory Plugin@openviking/dsh-memory-plugin适用于 DeepSeek Harness 的 OpenViking 记忆与上下文套件Contextdsh-context用于上下文洞察和管理的 DeepSeek Harness 插件,提供上下文仪表板和上下文命令,帮助了解上下文的构成及其演变过程。Weknora@wxg-prc-cpg/dsh-weknora适用于 DeepSeek Harness (dsh) 的 WeKnora 知识检索工具:通过自有知识库进行语义搜索、文档阅读以及 RAG/代理回答。Memsearch Dsh@zilliz/memsearch-dsh适用于 DeepSeek Harness 的 MemSearch 插件:在多个代理之间共享 Markdown 记忆,支持捕获、步骤前上下文注入、记忆召回技能和技能候选审核面板。

README

📦 @goodandready/dsh-context-lens

AST Code Skeletonizer, Terminal Log Condenser & Token Budget Guard for DeepSeek Harness

🇬🇧 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 & The Problem

Large codebase contexts and verbose build/test logs quickly fill the LLM context window, waste token budget, slow down inference, and cause agent hallucination.

dsh-context-lens solves this by providing:

  1. Active Focus Scoping: Keeping full fidelity for files currently being edited, while collapsing surrounding workspace files into lightweight AST skeletons.
  2. Multi-Language AST Skeletonization: Extracting structural types, classes, and method signatures across TypeScript, JavaScript, Python, Go, C/C++, Rust, and SQL, cutting raw code size by 70–85%.
  3. Intelligent Terminal Log Compression: Stripping noisy passing test lines and build boilerplate while preserving critical error stack traces and failure windows, cutting log size by up to 90%.
  4. Session Token Telemetry & Budget Guard: Live tracking of token savings with configurable budget alerts and visual indicators in the DSH Web UI.
graph LR
    subgraph RawContext [Raw Context Streams]
        Code[📁 Source Code: Lengthy Implementation Details] --> LensEngine[dsh-context-lens Engine]
        Logs[📋 Build/Test Logs: Verbose Success Noise] --> LensEngine
    end

    subgraph LensEngine [Context Processing Pipeline]
        LensEngine --> Focus{Focus Evaluator}
        Focus -->|Focused File| RawKeep[Full Code Details Retained]
        Focus -->|Surrounding Workspace| AST[AST Skeletonizer: Signatures & Types]
        LensEngine --> LogFilter[Log Condenser: Stack Traces & Errors Only]
    end

    subgraph Output [Optimized Agent Context]
        AST --> Agent[🤖 DSH Agent Context: Compact High-Value Prompt]
        RawKeep --> Agent
        LogFilter --> Agent
        Agent --> Tracker[📊 Live Token Telemetry & Budget Guard]
    end

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

✨ Full Feature Breakdown

1. 🧬 Multi-Language AST Structural Skeletonizer

  • Supported Languages: TypeScript, JavaScript, Python, Go, C/C++, Rust, and SQL DDL.
  • Structural Preservation: Retains imports, classes, structs, interfaces, exported types, function signatures, and doc comments while discarding inner implementation bodies.
  • Multiline Signature Support: Seamlessly accumulates complex multiline generic arguments, return types, and parameter lists up to block delimiters.
  • Pure Regex Implementation: Zero heavy native dependencies or binary parser overhead; runs lightning-fast across any platform.

2. 📋 Heuristic Test & Build Log Condenser

  • Supported Test Runners & Tools: Jest, Vitest, Pytest, Go test, Cargo, Webpack, Vite, TSC, Maven, Gradle.
  • Targeted Extraction: Identifies and preserves critical error messages, stack traces, assertion differences (Expected ... Received ...), and failure context windows.
  • 3 Aggressiveness Modes:
    • raw: Removes simple noise lines while keeping general execution order.
    • balanced: Preserves failure sections with surrounding context windows (default).
    • aggressive: Extracts strictly error lines and stack frames.
  • ANSI Stripping: Cleans terminal escape codes and color formatting before processing.

3. 🎯 Active Path Focus Scoping (context_lens_focus)

  • Allows designating specific files or folders as active working targets for the current task.
  • Files inside focus remain uncompressed; non-focused dependencies are automatically served as structural skeletons.
  • Focus state is strictly scoped per session (sessionId) and can be inspected or cleared instantly via UI or API.

4. 📊 Token Savings Tracking & Budget Telemetry

  • Calculates exact tokens before and after compression using accurate token estimation.
  • Tracks cumulative tokens saved, compression ratio, and session budget percentage.
  • Configurable warning threshold (budgetAlertPercent) dynamically alerts when the session budget approaches depletion.

5. 🖥️ Visual Surfaces & Dual Sidebar Integration

Context Lens shares the unified .cl-* design language and --dsw-alias-* token system with dsh-clinebot:

  • Conversation Header Chip: Mounted in conversation.session.header.utilities (order: 7). Always displays efficiency badges (◐ Lens, ◐ <N>%, or ⚠ alert) with an interactive dropdown Popover showing savings details and recent operations.
  • Dual Sidebar Compatibility: Supports both native DeepSeek Harness right sidebar (ctx.sidebarRightTabs + sidebar.right.pane.tab slot) and legacy dsh-better-sidebar with non-conflicting IDs.
  • ErrorBoundary Protection: Every UI component (PluginCard, LensTab, StatusPanel) is isolated inside React error boundaries with instant retry buttons, preventing parent UI crashes.
  • One-Click In-App Updater: Settings card displays live version checks against npm with a single-click update trigger.

🛠️ Agent Tools Reference (5 Tools)

All tools strictly conform to the DeepSeek Harness tool specification by providing output.render returning structured ContentBlock[] arrays ([{ type: 'text', text: ... }]), ensuring 100% session stability with core LLM stream processors.

Tool NameParametersDescription
context_lens_focuspaths: string[], sessionId?: stringSets active focus files/folders for the session; collapses surrounding workspace into AST skeletons
context_lens_compress_logtext: string (or log), `mode?: "raw""balanced"
context_lens_compress_codecode: string, language?: string, maxDepth?: number, filePath?: string, sessionId?: stringGenerates a clean structural AST skeleton from raw source code
context_lens_tracksessionId?: stringReturns real-time cumulative token savings, history, and budget status for the session
context_lens_resetsessionId?: stringResets token tracker counters and compression history at the start of new tasks

🔌 HTTP API Reference

EndpointMethodSecurity ChecksDescription
/dsh-context-lens/statusGETOpen (safe read)Returns session token savings stats, active focus paths, and compression history
/dsh-context-lens/clear-focusPOSTLoopback / Same-OriginClears focused paths for the specified session (rejects GET with 405)
/dsh-context-lens/compress-previewPOSTLoopback / Same-OriginPreview log compression with 256KB body size limit and maxLines clamping (1–5000)
/api/dsh-context-lens/updateGET, POSTLoopback + Security HeaderIn-app plugin updater checking npm registry and executing safe background updates

⚙️ Configuration Reference (settings.yaml)

Settings can be modified via settings.yaml or directly in the DSH Web UI under Settings → Plugins → Context Lens.

dsh-context-lens:
  compressionMode: balanced        # Log compression mode: 'raw', 'balanced', or 'aggressive'
  astSkeletonMaxDepth: 3          # Maximum depth level for AST signature traversal (1..10)
  tokenSavingsTracking: true      # Track and display live token savings
  autoCompressThreshold: 4000     # Auto-compression character threshold (0 to disable)
  budgetLimit: 100000             # Session token budget limit
  budgetAlertPercent: 90          # Budget percentage threshold triggering warning badge (50..99)
  autoCollapse: true              # Display warning in UI when budget is nearly exhausted
ParameterTypeDefaultDescription
compressionModestringbalancedDefault log compression aggressiveness (raw, balanced, aggressive)
astSkeletonMaxDepthnumber3Maximum nesting depth for AST signature parsing (1 to 10)
tokenSavingsTrackingbooleantrueTrack token savings before/after compression
autoCompressThresholdnumber4000Auto-compress terminal logs exceeding this character length (0 to disable)
budgetLimitnumber100000Total token budget limit allocated per session
budgetAlertPercentnumber90Budget alert threshold percentage triggering warnings (50 to 99)
autoCollapsebooleantrueDisplay low-budget warning badge in settings card and header chip

📦 Quick Installation

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

[!TIP] After installation, reload the DSH Web UI or restart the service (systemctl --user restart dsh-web) to activate context compression tools.


📄 License

MIT © GooDAnDReaDY