npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@dsh-lens/dsh-lens

v0.1.0

Published

TypeScript/JavaScript diagnostics lens for DeepSeek Harness

Readme

dsh-lens

DSH(DeepSeek Harness)的"代码体检医生"插件。

它会自动检查你改过的代码有没有问题(语法错误、类型错误、代码风格问题), 把问题清楚地列出来,还能帮 AI 助手一起修——你不需要懂任何技术。


一、这是什么?有什么用?

想象你写代码的时候,旁边坐着一位体检医生:

  • 你每改一次代码,它马上看一眼有没有"低级错误"(比如少了个括号);
  • AI 打开读取或修改 TypeScript/JavaScript 文件时,它会在后台做一次"全面体检"(类型检查、代码规范检查);
  • 发现的问题会:① 显示在聊天框旁边的诊断卡片上;② 告诉 AI 助手,让 AI 帮忙修。

它不会阻止你写代码,也不会自己乱改你的文件。卡片刷新走独立的只读接口,不会把快照 JSON 塞进 AI 对话上下文。装好之后,你什么都不用做。


二、安装前,先确认三件事

| 你需要 | 怎么确认 | | --- | --- | | ① 一台电脑(Windows / Mac 都行) | 你现在就在用 ✓ | | ② DSH 应用已经装好 | 你能打开 DSH 的网页界面(web) | | ③ 会打开"终端"(黑色窗口) | 看下面的"第一步" |

什么是终端? Windows 上叫 PowerShell: 点屏幕左下角"开始"按钮 → 输入 PowerShell → 回车。 会弹出一个黑色(或深蓝色)窗口,里面有一个光标在闪。后面所有命令都在这里输入。


三、一步一步安装(大约 3 分钟)

第一步:确认 DSH 已经装好

在终端里,复制粘贴下面这一行,然后按回车:

dsh --version

看到什么算成功: 屏幕上出现一个版本号,比如 0.1.0-rc.6 这样的一串数字。

如果提示"dsh 不是内部或外部命令"(或 command not found): 说明 DSH 还没装好,或者终端找不到它。请先安装好 DSH 再继续(见文末"常见问题")。


第二步:安装插件(复制一条命令)

在终端里,复制粘贴下面这一行,按回车:

dsh plugin --profile web add npm:@dsh-lens/dsh-lens

这一行命令在做什么:

  • dsh plugin → 让 DSH 管理插件
  • --profile web → 装到"网页版"配置里
  • add npm:@dsh-lens/dsh-lens → 从 npm(一个软件商店)下载并安装 dsh-lens

看到什么算成功: 屏幕开始滚动一些文字,最后停下来,回到可以输入命令的状态 (通常看到 Done 或类似字样)。整个过程一般不超过 1 分钟。

没有发布 npm 包?想先在本机测试? ① 先在插件源码目录(有 package.json 的文件夹)打开终端,运行 npm run pack, 会生成一个 dsh-lens-0.1.0.tgz 文件; ② 然后用这条命令安装(把路径换成你的文件位置):

dsh plugin --profile web add C:\你的路径\dsh-lens-0.1.0.tgz

(直接 npm pack 生成的文件名是 dsh-lens-dsh-lens-0.1.0.tgz,也可以用;升级包时先删掉旧的 .tgz 再重新打包)


第三步:确认装好了

在终端里,复制粘贴下面这一行,按回车:

dsh plugin --profile web list

看到什么算成功: 列表里出现了 @dsh-lens/dsh-lens 这一行。


第四步:重启 DSH

  1. 把 DSH 的窗口/网页完全关掉;
  2. 重新打开 DSH(和平时一样打开网页版)。

装好了!接下来它会自动开始工作,不需要再做任何设置。


四、怎么知道它在工作?(30 秒体验)

  1. 打开任意一个 TypeScript 项目(文件夹里有 tsconfig.json 那种);
  2. 随便打开一个 .ts 文件,故意写错一行,比如:
    const x: number = "hello";
  3. 保存文件;
  4. 看聊天输入框附近——应该出现一张诊断卡片,显示类似"1 个问题"。

如果项目里没有 tsconfig.json,插件不会检查它(这是设计如此:没有体检表就不体检)。


五、常见问题(遇到问题先看这里)

| 问题 | 怎么办 | | --- | --- | | 提示 dsh 不是内部或外部命令 | DSH 没装好或不在系统路径里。重新安装 DSH,或在安装时勾选"加入 PATH"。 | | 提示权限错误 / Access denied | 右键"PowerShell",选以管理员身份运行,再试一遍第二步。 | | 装完重启了,没有诊断卡片 | ① 确认你打开的是网页版(web);② 确认项目里有 tsconfig.json;③ 看第三步列表里有没有 @dsh-lens/dsh-lens。 | | 卡片一直显示"暂无诊断" | 正常——说明当前没有发现问题。写一个错误再保存,卡片就会出现内容。 | | 想不装了这个插件 | 在终端运行:dsh plugin --profile web remove dsh-lens | | 想暂时关掉检查 | 见下面的"高级设置",把 enabled 改成 false。 |


六、高级设置(需要一点技术基础,小白可以跳过)

插件默认设置已经够用。想改的话,在 DSH 的配置里加一段,或在你项目的根目录 新建一个名为 .dsh-lens.json 的文件(不会自动生成,内容如下):

{
  "enabled": true,
  "typecheck": { "enabled": true },
  "eslint": { "enabled": false },
  "exclude": ["generated/**"]
}

优先级:内置默认值 < DSH 全局配置 < 项目里的 .dsh-lens.json。 改完保存即可生效(自动热重载),不用重启。

完整配置项(在 DSH profile 的 patch 配置里):

- id: dsh-lens
  config:
    enabled: true
    include:
      - "**/*.{ts,tsx,js,jsx,mts,cts,mjs,cjs}"
    exclude:
      - "**/node_modules/**"
      - "**/dist/**"
      - "**/build/**"
    fast:
      enabled: true
      maxFileBytes: 524288
      budgetMs: 50
    typecheck:
      enabled: true
      debounceMs: 800
      timeoutMs: 60000
    eslint:
      enabled: false
      debounceMs: 1000
      timeoutMs: 30000
    feedback:
      inject: true
      maxDiagnostics: 8
      maxBytes: 4096
    scheduler:
      maxConcurrentProjects: 2

七、给开发者的说明

  • 环境要求:Node.js >= 20;DSH 兼容基线 0.1.0-rc.6(所有 @deepseek-ai/* 包为 peerDependencies,不打进本包);TypeScript >= 5.0.0 为可选 peer。
  • 开发命令:npm install → npm run verify(typecheck + 107 测试 + build)→ npm pack --dry-run。
  • 工作流程:
write/edit ──► 快速语法(transpileModule)──► post-execute additionalContexts
     │
read ─┴─► 防抖后台检查(tsc / eslint,经 ctx.subprocess)
              └─► delta 分类 ──► agent.inject() 报告
                            └─► lens 快照 ──► Web 卡片
  • 子模块:./client(Web 插件)、./adapter、./diagnostics、./quick-syntax、 ./scheduler、./background-check、./providers、./delta、./feedback、 ./snapshot、./lens-card、./config、./reliability、./types。
  • Web 卡片通过同源、禁止缓存的 HTTP 接口轮询内存快照;轮询不会向 Session 上下文写入命令事件或快照 JSON。
  • 已知限制:Web 配置页不在首版;typecheck 与 eslint 共用一条防抖管线。

变更日志

见 CHANGELOG.md。

许可证

MIT — 见 LICENSE。