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 会话:锁定后必须输入口令才能在界面中打开查看。
Maintainers
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-lockor 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.tgzFrom a local checkout
dsh plugin --profile <profile> add C:\path\to\session-lockA 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 on0.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 publicor with pnpm:
pnpm publish --access publicThe 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.mjstest-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.
