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-rpg-workstation

v0.3.0

Published

Game-ify your DeepSeek Harness: earn XP per conversation turn, level up, unlock achievements and keep daily streaks, with a floating RPG dashboard in the web UI.

Readme

dsh-rpg-workstation

把 DeepSeek Harness 变成一个 RPG 工作台:每次完成一个对话回合就获得经验值,升级、解锁成就、保持每日连击,右下角浮动的游戏面板实时展示你的“战绩”。

Game-ify your DeepSeek Harness usage — earn XP per completed conversation turn, level up, unlock achievements and keep daily streaks, with a floating RPG dashboard in the web UI.

截图: alt text


环境要求

| 依赖 | 版本 | 说明 | |---|---|---| | Node.js | ≥ 18 | 构建与运行 | | pnpm | 任意较新版本 | 仅 dsh plugin 命令需要(没有也能手动安装,见下文) | | DeepSeek Harness | web profile | 插件面向 dsh web 界面 |


安装

前置:先全局安装 dsh 命令行工具。没有它就没有 dsh plugin / dsh web 这些命令:

npm install -g @deepseek-ai/dsh

之后一条命令安装本插件:

dsh plugin --profile web add dsh-rpg-workstation

dsh plugin add 会自动把包加入 profile 层叠(包声明了 dsh.bundle.patch),无需手写补丁。

安装完成后重启 dsh web,界面右下角就会出现 RPG 面板。

卸载:

dsh plugin --profile web remove dsh-rpg-workstation

原理:dsh 的 profile 由一层层补丁拼装。cordis.patch.yml 里的 - insert: 是标准补丁写法,id 是该行的稳定句柄,name 是 loader 要解析的 npm 包名(必须先装进 profile 的 node_modules)。客户端 bundle 由 dsh 的 dsh.client 扫描自动打包,所以 lib/ 产物 + dsh 两个字段就够用了。


使用方法

面板挂在右下角(shell.overlay 插槽),一切都是自动的——聊着聊着就攒经验:

| 操作 | 效果 | |---|---| | 正常对话 / 让 AI 干活 | 每完成一个回合 +10 XP;回合内每调用一次工具额外 +2 XP(上限 +20) | | 点击面板头部 | 折叠 / 展开 | | 按住头部拖动 | 把面板移到任意位置 | | 点击成就圆点区 | 展开详情:本周柱状图、每日任务、统计、成就列表、存档导入/导出 | | 升级瞬间 | 等级数字轻放大 + 「升级 Lv.N」浮出(里程碑等级 5/10/15 有专属彩蛋) | | 全成就解锁 | 称号变「圆满」+ 高亮彩蛋 |


功能一览

  • 经验与等级 — 每回合 (10 + min(20, 工具数×2)) × 连击加乘;level = floor(sqrt(xp/100)) + 1
  • 连击加乘 — 连击 3 / 7 / 30 天 → XP ×1.1 / ×1.25 / ×1.5
  • 14 个成就 — 对话数、等级、工具调用、文件写入、连击、单日回合、深夜/清晨各成一档
  • 每日任务 — 对话达人 / 工具狂人 / 保持连击,每完成一个 +20 XP,次日刷新
  • 称号系统 — 新手 → 学徒 → 冒险者 → 勇者 → 大师 → 传说(全成就时「圆满」)
  • 每周报告 — 最近 7 个自然日柱状图(以 XP 为高度)+ 周汇总
  • 存档导出 / 导入 — 一键下载 rpg-data-YYYY-MM-DD.json,导入自动归一化(旧版/手改存档不留空洞)
  • 持久化 — ~/.dsh/rpg-data.json(尊重 $DSH_HOME),原子写入 + 串行队列,崩溃不损坏
  • 界面克制 — 宿主主题变量、无 emoji 噪音、prefers-reduced-motion 支持

架构

┌─ Host (Node.js) ────────────────────────────────────────────┐
│ apply(ctx)                                                  │
│  ├─ ctx.on('session/event')  → turn/end(completed)          │
│  │     → registerCompletedTurn()  (+XP, 连击, 成就, 任务)     │
│  │     → updateWeekHistory()     (按活跃日累计周历史)          │
│  │     → saveSoon()              (timer.debounce + ctx.effect)│
│  └─ webServer.register × 3                                   │
│       ├─ /rpg-workstation/state.json → computeSnapshot       │
│       ├─ /rpg-workstation/export     → 原始存档 JSON          │
│       └─ /rpg-workstation/import     → normalize + 落盘      │
└──────────────────────────┬──────────────────────────────────┘
                           │ 同源 fetch(纯 JSON)
┌─ Client (Browser) ───────▼──────────────────────────────────┐
│ apply(ctx)                                                  │
│  ├─ styles 注入 style.css(命名空间隔离)                      │
│  └─ slots.inject('shell.overlay')                            │
│        → <Dashboard/> 每 2s 轮询                              │
│             ├─ 等级/称号/经验条/连击/每日任务/周报/成就          │
│             └─ 升级轻提示 + 圆满彩蛋                           │
└─────────────────────────────────────────────────────────────┘
  • Host 面(src/index.ts)负责后端:监听会话事件、算分、落盘、状态/导出/导入路由。
  • Client 面(src/client/)负责界面:插槽注册、样式注入、轮询渲染。
  • 两端类型(src/shared/types.ts)单一定义快照结构,改一处另一侧立刻类型报错,防止漂移。

玩法公式

| 项目 | 公式 | |---|---| | 每回合经验 | (基础 +10 + 工具加成 min(20, 工具数 × 2)) × 连击加乘(turn/end 且 reason.kind === 'completed') | | 连击加乘 | 连击 3 / 7 / 30 天 → ×1.1 / ×1.25 / ×1.5 | | 等级 | level = floor(sqrt(xp / 100)) + 1 | | 升下一级阈值 | level² × 100(xpAtLevel(level+1)) | | 当前级跨度 | (2·level − 1) × 100(进度条分母) | | 连击 | 当天首次 → 1;连续每天 → +1;中断一天 → 归零 | | 称号 | 1-2 新手 / 3-4 学徒 / 5-6 冒险者 / 7-9 勇者 / 10-14 大师 / 15+ 传说 | | 行为统计 | 累计工具调用(tool/call)、文件写入(write/edit)、今日回合 |


License

MIT