NexusAgentX / dsh-lens

Listed

Real-time code feedback for DeepSeek Harness — LSP, linters, formatters, structural analysis via a host-native adapter around the pi-lens engine.

mainOther View source

Installation

npx dsh-lens build-graph --cwd .

This command is generated from the GitHub repository address. Inspect the upstream README and source before running it; pin a release or commit when reproducibility matters.

README

Maintainer-authored documentation snapshot.

View on GitHub ↗
Commit 01bdc84Synced Aug 18, 2026

dsh-lens

Real-time code feedback for DeepSeek Harness: LSP, linters, formatters, type-checking, and structural analysis while the agent writes.

Current release: dsh-lens@0.2.0.

English | 中文

What it does

This is a host-native port of pi-lens. The analysis engine stays in pi-lens; this plugin is the DeepSeek Harness adapter.

On every write / edit / bash mutation it runs the same pipeline pi-lens uses inside Pi:

  1. format queue / safe autofix
  2. LSP file sync and diagnostics
  3. ast-grep, tree-sitter, fact rules, and language scanners
  4. cascade diagnostics on likely neighbors
  5. turn-end blockers and advisories injected into the next model request

It also registers the full agent-facing tool set, the /lens-* commands, bundled pi-lens skills, and a WebUI chip/dock.

Standalone CLI (review graph, same as pi-lens build-graph):

npx dsh-lens build-graph --cwd .
npx dsh-lens status

Install

dsh plugin --profile web add dsh-lens

Or from git:

dsh plugin --profile web add github:NexusAgentX/dsh-lens

Do not also attach pi-lens-mcp / official MCP-wrapped pi-lens against the same workspace — that double-starts language servers.

Tools

Always available:

  • lens_diagnostics — cached / project diagnostic state (delta / all / full)
  • lsp_diagnostics — file- or directory-scoped LSP diagnostics
  • symbol_search — ranked identifier search
  • module_report / project_report
  • read_symbol / read_enclosing

Also registered (dsh has no dynamic-tool API, so they stay visible):

  • ast_grep_search / ast_grep_replace / ast_grep_outline / ast_grep_dump
  • lsp_navigation
  • lens_diagnostic_mark
  • pi_lens_activate_tools — no-op catalog on dsh; all tools are already active

The official lsp tool is left alone. Use it for simple go-to; use lsp_navigation for the full IDE surface.

lens_diagnostics, ast_grep_search, and symbol_search present as search cards with file follow-along.

Commands

CommandWhat it does
/lens-toggleEnable or disable the pipeline for this session
/lens-context-toggleKeep tools/LSP/format on, stop injecting into the next turn
/lens-widget-toggleShow or hide the WebUI chip and dock
/lens-healthSession health, LSP list, cascade, event-loop, noisy rules
/lens-perfProcess + machine-wide p50/p99 phase ranking
/lens-toolsInstaller status grouped by source
/lens-tdiTechnical Debt Index
/lens-mapWrite the HTML dependency map; the chip gets an Open map action
/lens-allow-edit <path>One-shot read-guard exemption

WebUI

On the official dsh web profile the plugin ships a browser half (dsh.client):

  • session header chip (conversation.session.header.actions)
  • composer dock (conversation.input.dock)
  • official primitives: Menu, Tooltip, StateDot, chevron, CSS modules, zh/en locale

The chip reads the lens session projection, folded from widget-state on tool/result, turn/end, and /lens-widget-toggle. It does not append a custom session event, so persistence will not reject the log.

Skills

The four upstream pi-lens skills are registered when ctx.skills is present:

  • pi-lens-ast-grep
  • pi-lens-lsp-navigation
  • pi-lens-write-ast-grep-rule
  • pi-lens-write-tree-sitter-rule

Config

Same files as pi-lens:

  • project: .pi-lens.json
  • global: ~/.pi-lens/config.json

Plugin config on the Cordis entry (omit a key to keep .pi-lens.json / env):

- id: dsh-lens
  name: dsh-lens
  config:
    cwd: /path/to/workspace
    enabled: true
    contextInjection: true
    lsp: true
    format: true
    immediateFormat: false
    autofix: true
    tests: true
    delta: true
    guard: false
    opengrep: true
    readGuard: true
    turnSummary: false
    actionableWarnings: false
    actionableWarningActions: false
    actionableWarningAutofix: false
    actionableWarningAll: false

Boolean keys map onto the same flags as pi-lens (--no-lsp, --lens-guard, --immediate-format, …).

Host limits

dsh freezes tool arguments before dispatch, so Pi's in-flight edit autopatch cannot rewrite old_string. dsh already has its own read-before-edit observation policy.

These Pi host surfaces are not cloned: TUI footer, interactive LSP install prompts, session fork / cross-process nudge, official Settings cards (apiproxy allowlist), and /lens-booboo (still deferred upstream).

License

MIT

Inspired by pi-lens (MIT). See NOTICE.


中文

DeepSeek Harness 用的实时代码反馈插件。分析引擎还是 pi-lens,这里是 dsh 宿主适配:写文件后跑 format / LSP / linter / 结构规则,并把 blocker 注回下一轮。

当前版本:dsh-lens@0.2.0

dsh plugin --profile web add dsh-lens

Web profile 会装上会话标题旁的 lens 芯片和输入框上面的 dock(官方 Menu / Tooltip / StateDot)。/lens-widget-toggle 可隐藏。/lens-health/lens-perf/lens-tools 与上游报告对齐。

不要和 pi-lens-mcp 同时挂同一批 workspace,会双开语言服务器。

配置继续用 .pi-lens.json / ~/.pi-lens/config.json,也可以在 Cordis 条目里写 lsp / format / guard 等开关。

Project files and signals

Shown items are public repository signals detected in the directory snapshot.

TestsDetected

Repository information

Language
TypeScript
License
MIT
Latest release
v0.2.5
Last updated
Aug 14, 2026, 8:34 AM

Install deliberately

Review source code, permissions, lifecycle hooks, dependencies and network access. Test untrusted plugins in an isolated environment.