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

@dongfangw/paperskills

v0.3.2

Published

paperskills 的 DeepSeek Harness 插件:文献检索/下载/OCR/翻译/图谱/写作(AsciiDoc 交付)技能集 + 文献工作台 Web UI

Readme

@dongfangw/paperskills

paperskills 的 DeepSeek Harness 插件:把仓库里 32 个文献技能 + 文献工作台 Web UI 带进 DSH, 覆盖文献全流程 检索 → 下载 → 转 MD/OCR → 翻译 → 入库/图谱 → 阅读/笔记 → 写作/评审。

写作交付物为 AsciiDoc(.adoc):academic-paper / deep-research / adr-writer / implementation-plan / academic-paper-reviewer 不再产出 Markdown 文档;.adoc 渲染为 HTML/PDF/DOCX,期刊投稿才生成 LaTeX。规范 ars/shared/adoc_authoring_standard.md, 门禁/构建 ars/shared/scripts/adoc_tool.py。

与同仓库的 Claude Code 插件(.claude-plugin/ + skills/)双格式共存,skills/、ars/ 单一来源。 npm 发布包自带 assets/skills/(32 个技能)与 assets/ars/shared/,装完即用,不依赖仓库其余文件。

安装(npm,推荐)

# 1) 装进 profile(只转发 pnpm,不会改 bundles 列表)
dsh plugin --profile web add @dongfangw/paperskills

# 2) 把包加进 profile 的 dsh.profile.bundles(编辑 ~/.dsh/profiles/web/package.json)
#    "bundles": ["@deepseek-ai/dsh-base", "@deepseek-ai/dsh-web-app", "@dongfangw/paperskills"]

# 3) 重启 dsh web

在 Web 界面的「插件」页安装则会自动加入 bundles 并可启停,不需要手改 package.json。

安装/启动时 DSH 会按 peerDependencies 校验插件与运行时版本:本包声明 >=0.2.2-rc.1 <0.3.0-0(engines.dsh 同范围),在 0.2.2-rc.1 上实测通过;更低或更高的 DSH 需用 dsh plugin allow-version 显式豁免(dsh-app-boot 的 evaluatePluginCompatibility)。

安装(git 源码)

cd paperskills/dsh
bash scripts/install.sh            # 装进 web profile(默认)
# bash scripts/install.sh headless # 装进其它 profile

脚本会:定位本机 DSH → 装构建依赖(npm install + 合并复制本机 @deepseek-ai 对齐版本)→ 构建 → dsh plugin --profile web add。装完重启 dsh web 并新建会话。

DSH 版本兼容(基线 0.2.2-rc.1,最低 Node 24.9)

插件最初针对 DSH 0.1.0-rc.6 编写,0.1.2 起客户端 API 有破坏性变更,已就地适配:

| 变更点 | 旧(≤0.1.1) | 新(≥0.1.2-rc.1) | |---|---|---| | 客户端 apply(ctx) 上下文类型 | ClientContext from @deepseek-ai/dsh-client-runtime/client | Context from @deepseek-ai/cordis | | ctx.slots 服务声明 | 由 dsh-client-runtime 提供 | 由 @deepseek-ai/dsh-client-ui-renderer/client 增强 cordis Context 提供 | | JsonValue 类型 | dsh-tools 转出 | 改由内部 dsh-util-values 定义,插件内用本地结构等价别名 | | 客户端 inject | 含 @deepseek-ai/dsh-client-runtime | 换为 @deepseek-ai/dsh-client-ui-renderer(该包已不存在) |

2026-11-14 迁移到 DSH 0.2.2-rc.1(Cordis 4.1 / Node ≥ 24.9),三处必须改:

  1. peer 范围:>=0.2.0-rc.2 改为 >=0.2.2-rc.1 <0.3.0-0、cordis ~4.0.4 改 ^4.1.0, 并新增 "engines": { "node": ">=24.9.0", "dsh": ">=0.2.2-rc.1 <0.3.0-0" }。 两种判定的口径不同:dsh 的门禁取 includePrerelease,旧范围 >=0.2.0-rc.2 其实能过门禁; 真正卡住的是 npm/pnpm 的 peer 解析(标准 semver 下预发布只被同 [major,minor,patch] 的 比较器放行)与 cordis 4.1。反过来说,写成 >=0.2.2-rc.1 之后旧 dsh(0.2.0)会拒绝本插件 (dsh: skipping profile bundle …),这是预期的单向门禁。
  2. useProjection 的声明来源:0.2.2 的 dsh-client-ui-slots 把 SessionStandardProps 留成空接口,useProjection 由 @deepseek-ai/dsh-client-ui-session 声明合并进来。 本包原先没有这条依赖(旧 node_modules 里是别处 hoist 上来的),重新安装后 tsc 报 TS2339: Property 'useProjection' does not exist。已把 @deepseek-ai/dsh-client-ui-session 显式写进 peerDependencies + devDependencies。
  3. Node 运行时:本机从 Node 22.22.3 换到 24.16.0(nvm alias default 24.16.0), 全局 dsh、pnpm、asciidoctor、jq、slidev、pi 一并装到 Node 24 前缀。

2026-11-14 在 DSH 0.2.2-rc.1 / Node 24.16.0 上复验:npm run build 双侧 tsc 通过、 node scripts/verify-plugin.mjs 全绿(32 技能 / 4 投影 / 静态路由 Range)、 profile 启动无 skipping、会话内「文献工作台」标签渲染正常(文献库/检索/笔记/活动四个页签)、 三个 MCP(chrome-devtools / playwright / scholar-carsi)正常拉起、浏览器 console 零报错。

@deepseek-ai/dsh-client-ui-slots 只是纯类型包(无 dsh.client 字段,也不随宿主安装), 不在 dsh.client.inject 里,仅保留在 devDependencies 供类型检查。

另:install.sh 第 2 步改为合并复制 @deepseek-ai——DSH vendor 目录不含 dsh-client-ui-slots 等纯类型包,原先的 rm -rf 会把 npm install 装进来的类型包一起删掉,客户端 tsc 随即报 TS2307。

会话投影契约(stateSchema + wire,缺一则界面空)

四个投影(literatureLibrary / literatureActivity / notes / literatureSearch)按 DSH ≥ 0.1.1-rc.1 的新契约实现。宿主 acquire() 只读下面两个字段,其余一律忽略:

| 字段 | 宿主用途 | 缺失后果 | |---|---|---| | stateSchema | restore() / viewCheckpoint() 校验持久化 checkpoint 里的 state | restore() 里是 def.stateSchema.parse(row.val) 且没有 try-catch:打开历史会话直接抛 TypeError: Cannot read properties of undefined (reading 'parse') | | wire: { viewSchema, view } | 产出客户端值:snapshot / onChanged / refold 只认声明了 wire 的单元 | 状态照常折叠并写入 checkpoint,工具与缓存里数据齐全,但客户端 useProjection(key) 恒为 undefined —— 面板恒显示「文献库为空」/文献库 (0) |

顶层 schema / view 是 0.1.0 时代的字段,新宿主不再读取,仅作旧宿主兼容别名保留,且与新字段共用 同一份 schema / view 函数(不维护第二份逻辑)。

四个单元都经 defineUnit()(src/projections.ts)收口:漏 stateSchema / wire / wire.viewSchema 会在 npm run typecheck 阶段报错(Property 'wire' is missing in type … but required in type 'ProjectionUnit'), 而不是在界面上静默丢值。注册处(src/index.ts)仍写 as never,只为绕开宿主 ProjectionDefinition 里 wire: K extends keyof SessionProjectionMap ? … : never 这个条件类型——把 z.object 的大类型喂给它做推断 会让 tsc 指数膨胀(实测 10 分钟仍未收敛、峰值 7GB)。分工是:宿主管运行时,defineUnit 管编译期。

回归证据:node scripts/verify-plugin.mjs 的 2a(契约字段自检)与 2b(用真实 SessionProjectionRegistry 驱动一遍 snapshot() 与 restore());2b 在 0.3.0 的旧实现上会直接失败。

排障:文献工作台标签 / 面板异常

| 现象 | 原因 | 处理 | |---|---|---| | 顶部标签与设置页都没有「文献工作台」 | 客户端插件未加载:profile 里 @deepseek-ai/dsh-client-ui-slots 版本落后被 dsh 拒绝(日志 is incompatible with dsh 0.2.2-rc.1 … profile startup denies it),conversation.view 槽位整体不注册 | 把 profile 里该包升到与 dsh 同版本(0.2.2-rc.1),重启 | | 标签在,面板恒「文献库为空」(文献库 (0)),但 paperskills_library 正常返回 | 会话投影缺 stateSchema / wire(≤0.2.1 的 bug,0.3.1 修复) | 升级到 ≥0.3.1 | | 打开历史会话报 Cannot read properties of undefined (reading 'parse') | 同一根因:restore() 命中了旧 checkpoint 行 | 同上;升级后 stateVersion 未变,旧 checkpoint 可直接复用,不丢历史 |

profile 无关性:webServer 为可选服务

宿主 inject 不再包含 webServer(该服务只有带 HTTP 前端的 profile 提供)。静态路由 /paperskills/<rootKey>/<relpath> 在 registerStaticRoute 内用 ctx.get('webServer') 按需取用, 缺省即跳过。这样同一份插件既能在 web profile 提供文献工作台 UI,也能挂进 headless / ACP 这类 无前端 profile 做批处理——否则整棵插件树会以 @dongfangw/paperskills: pending (waiting for service: webServer) 启动失败。

MCP 前置(浏览器类技能)

cnki-*、nudt-library-fetcher、scihub-batch-download、scholar-carsi-download 需要真实浏览器, DSH 侧由官方插件 @deepseek-ai/dsh-mcp-client 桥接(本仓不含该插件,随 DSH 分发)。要点:

  • 每个 server 一行 YAML,serverName 必须与技能正文里的写法逐字一致:chrome-devtools(知网)、 playwright(NUDT SSO 付费墙);工具在会话里名为 mcp__<serverName>__<tool>。
  • playwright 行不要加 --headless/--isolated:SSO 登录态要留在持久 profile 里,且必须是有头浏览器。
  • 环境变量(MINERU_TOKEN / DEEPSEEK_API_KEY)由启动 dsh 的那个进程继承——请从交互终端启动; .bashrc 对非交互 shell 会提前 return。

架构

DSH 会话 ──paperskills_* 工具──▶ paperskills 脚本(ars-local-search / literature-fetcher /
   ▲                              mineru-converter / paper-translate 等)
   │                                        │
   └─ literature/* 事件 ── 投影(literatureLibrary/Activity/Search/notes) ── /paperskills/ 静态路由
                                             │
                             客户端 conversation.view「文献工作台」标签页(库/检索/笔记/活动四面板)
  • 宿主 src/index.ts:技能 provider + 工具 + 会话投影 + /paperskills/<rootKey>/<relpath> 静态路由 (白名单扩展名 + realpath 前缀校验防穿越 + HTTP Range 流式,PDF 可直接看)。
  • 客户端 src/client/:conversation.view 槽位注册「文献工作台」标签页(库/检索/笔记/活动四面板), settings.section 槽位注册「文献工作台」设置页(MCP server 注册指引 + API key 前置说明)。

技能分发(32 个)

宿主 ctx.skills.registerProvider() 扫描 <repo>/skills/,把 Claude Code 技能迁移为 DSH 技能,并做 一次性改写(get() 时注入):

  • argument-hint → whenToUse(DSH 路由提示字段)
  • user-invokable(拼写错)→ user-invocable
  • 裸 shared/ 引用 → ../../ars/shared/(ARS 四技能的共享内容,否则会静默断裂)
  • $ARGUMENTS → ⟨用户输入参数⟩
  • 注入「资源定位」说明头(resourceBase 语义显式化)

技能 rank=600(BUNDLED_SKILL_RANK),source: bundled,resourceBase 指向技能目录。撞名 (如 slidev 与本机用户技能)由 DSH 的 rank 决胜,用户技能(rank 400)优先,见 @deepseek-ai/dsh-skill-filesystem。

宿主工具(驱动 UI)

| 工具 | 作用 | 依赖 | |---|---|---| | paperskills_library | 扫描 raw/<分类>/<论文>/full.md + graphify-out/graph.json → 文献库快照 | 无(本地读) | | paperskills_local_search | 本地文献库关键词检索(图谱 + 全文) | _query_local_lit.py | | paperskills_arxiv_fetch | arXiv 检索 + 下载到 raw/<分类>/ | _arxiv_fetch.py | | paperskills_convert | MinerU 转 full.md | MINERU_TOKEN | | paperskills_translate | DeepSeek 翻译 full.md → translation.md | DEEPSEEK_API_KEY | | paperskills_note | 给论文记笔记(notes/ 持久化 + 投影) | 无 |

其余 20+ 技能(cnki-*、scihub、nudt-library、academic-paper 等)交给技能正文,工具不重复实现, 避免双轨漂移。

写作链路(AsciiDoc)

academic-paper / deep-research / academic-paper-reviewer / adr-writer / implementation-plan 的交付物是 .adoc,渲染产物为 HTML(必出)/ PDF / DOCX,LaTeX 仅投稿用。 每个技能自带 scripts/adoc_tool.py wrapper(转发到 ars/shared/scripts/adoc_tool.py),在技能目录下执行:

python3 scripts/adoc_tool.py lint paper.adoc --strict
python3 scripts/adoc_tool.py build paper.adoc --format html,pdf,docx

规范 ars/shared/adoc_authoring_standard.md,自检 ars/shared/scripts/adoc_tool_selftest.py。 prepack 会把 ars/shared/scripts/(含工具与自检)一并打进 assets/,npm 安装形态同样可用。

前置(不含密钥,需自行配置)

| 依赖 | 用到的技能 | 获取 | |---|---|---| | MCP server chrome-devtools(serverName 必须精确 = chrome-devtools) | cnki-* 系列 | 在 profile 的 cordis 组合里注册 @deepseek-ai/dsh-mcp-client | | MCP server playwright(serverName 精确 = playwright) | nudt-library-fetcher, scihub-batch-download | 同上 | | MINERU_TOKEN | mineru-converter | MinerU 平台申请 | | DEEPSEEK_API_KEY | paper-translate | platform.deepseek.com |

scihub 走 fetch_scihub.sh 脚本(其 MCP 镜像已失效,别按旧 README 注册 scihub MCP)。 未配置前置的技能仍会加载,调用时因缺凭据/缺 server 而失败或提示。

目录结构

dsh/
├── src/
│   ├── index.ts             # 宿主入口(provider + 投影 + 静态路由 + 会话工具注册)
│   ├── skills-provider.ts   # 技能 provider(扫描 + frontmatter 解析 + 迁移改写)
│   ├── tools.ts             # 6 个宿主工具 + 文献库扫描
│   ├── projections.ts       # 4 个会话投影(库/活动/笔记/检索)
│   ├── static.ts            # /paperskills 静态路由(白名单 + realpath + Range)
│   ├── paths.ts / run-script.ts / types.ts
│   └── client/              # 客户端(文献工作台 UI)
├── lib/                     # 构建产物(index.js 宿主 + client.js 客户端 bundle)
├── cordis.patch.yml         # 把插件插入 cordis 组合
├── package.json             # dsh.bundle + dsh.client 声明
├── tsconfig.json / tsconfig.client.json / tsdown.config.ts
└── scripts/install.sh       # 一键安装

已知限制

  • 文献库扫描假定项目结构为 raw/<分类>/<论文目录>/full.md + graphify-out/graph.json(paperskills 采集层技能的标准产出)。
  • 全文在 UI 内以纯文本 <pre> 展示(未接 Markdown 渲染器),PDF 走浏览器原生查看器(Range 流式)。
  • agents/cnki-researcher.md(Claude subagent)尚未映射为 DSH subagent,cnki-* 由技能直接引导。