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-session-lock

v0.1.0

Published

Passcode lock for DeepSeek Harness Sessions: a locked Session cannot be opened for viewing in the Web UI. / 用口令锁定 DSH 会话:锁定后必须输入口令才能在界面中打开查看。

Readme

dsh-session-lock / 会话锁

A DeepSeek Harness bundle that locks a Session behind a passcode. While a Session is locked it cannot be opened for viewing in the DSH Web UI; clicking its sidebar row asks for the passcode instead. The lock covers the whole Session, including its transcript, composer, and header actions.

用口令锁定一个会话。锁定后,该会话不能直接在 DSH 界面中打开查看;点击侧边栏 里的对应行会先要求输入口令。锁覆盖整个会话(对话内容、输入框和头部操作)。

What it does / 功能

  • Adds a lock button to the Session header and a lock action to each Session row.
  • 锁定会话 asks for a passcode (4–128 characters) and an optional hint.
  • While locked, the Session is replaced by a full-screen lock screen. Entering the passcode reveals it until you leave that Session; navigating away and returning asks for the passcode again, and a page reload asks again too.
  • The unlock dialog (and the full-screen lock screen) also offers 取消锁定 / Remove lock: enter the passcode and click the button twice to delete the lock record. The Session then opens directly.
  • Attempts are throttled on the Host: five wrong entries start a delay that backs off up to 15 minutes.
  • Lock state is stored on the Host, so it survives page reloads, other browser windows, and a DSH restart.

Install / 安装

From npm

dsh plugin --profile <profile> add dsh-session-lock

or open Plugins in DSH and install dsh-session-lock from the registry. The command adds the dependency and appends the bundle to dsh.profile.bundles. Reload the page once so the browser picks up the client bundle; restart DSH if the Host half does not activate.

From a tarball

Download or build dsh-session-lock-0.1.0.tgz, then:

dsh plugin --profile <profile> add .\dsh-session-lock-0.1.0.tgz

From a local checkout

dsh plugin --profile <profile> add C:\path\to\session-lock

A running Desktop profile can recompose through its profile watcher; otherwise restart DSH. After installation, reload the page once.

Compatibility / 兼容性

  • DSH >=0.2.0-rc.1 <0.3.0-0 (tested on 0.2.1-rc.2, Web and Desktop).
  • Node.js >=20.
  • The lock records use scrypt from node:crypto; no native module is built.

Storage and security / 存储与安全

Lock records live in ~/.dsh/session-lock/records.json (or under $DSH_HOME/session-lock/records.json). The file contains a random salt and a scrypt hash per Session, never the passcode itself.

The lock is a UI gate, not encryption. The Session JSONL under ~/.dsh/sessions/ is unchanged and remains readable by anyone with file access. The point is to keep a running task out of sight in the app, not to protect the disk.

To cancel a lock normally, open the Session's passcode dialog and use 取消锁定 / Remove lock; this needs the passcode and a second confirming click. Forgetting the passcode has no in-app recovery. Delete the Session's entry from ~/.dsh/session-lock/records.json while DSH is stopped, then restart.

Because the Host half runs in-process with the user's permissions and writes to ~/.dsh/session-lock, review the source before installing a third-party copy.

Limitations / 限制

  • Only Sessions (not background jobs, goals, or schedules) are locked.
  • The lock does not stop an already-running turn; it hides the Session while the turn continues.
  • A locked Session can still be archived or deleted through other UI surfaces that do not pass through uiWorkspace.openSession. The lock record is kept, but the Session may no longer be reachable.
  • The plugin is Web/Desktop UI only; it registers no agent tool, so the model cannot lock or unlock Sessions.

Package contents / 包内容

| File | Role | |---|---| | index.js | Host half: scrypt records, lock API, atomic persistence | | client.js | Browser half: lock buttons, passcode dialogs, full-screen gate | | cordis.patch.yml | Bundle row inserted into the profile | | locale/{en,zh}.json | Plugin Manager title and description | | icon.svg | Plugin icon |

The files field excludes the local test-*.mjs scripts and the dist/ release folder, so they are not part of the published package.

Release artifact / 发布产物

dist/dsh-session-lock-0.1.0.tgz is the packed npm tarball; dist/SHA256SUMS.txt carries its checksum and dist/RELEASE.txt the install commands. Rebuild it with npm pack and move the tarball into dist/.

Publishing / 发布

npm publish --access public

or with pnpm:

pnpm publish --access public

The package name dsh-session-lock was unclaimed on npm when this release was prepared. If you publish under another name, update cordis.patch.yml's row name and client.js's __ModuleLoader__.load id to match the package name. For a DSH plugin-market listing, submit the published package to the index the market is configured with.

Development

node --check index.js
node --check client.js
node test-host.mjs
node test-client.mjs

test-host.mjs exercises the API, hashing, persistence, and error paths. test-client.mjs mocks React, the slot registry, and fetch to exercise the lock dialog, gate, unlock flow, and openSession interception.