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-archive-sessions

v1.2.5

Published

会话管理:搜索已归档的会话记录、查看它们占用了多少磁盘,然后多选恢复或永久删除 / Session Manager for DeepSeek Harness: search archived sessions, see their on-disk size, then restore or permanently delete them with multi-select.

Readme

dsh-archive-sessions

会话管理 —— 在设置里搜索已归档的会话记录,看它们占了多少磁盘,然后多选恢复或永久删除。

A Session Manager page inside Settings that lists archived Harness sessions and lets you inspect, restore, and permanently delete them — with search, sorting, and multi-select batch actions.

What it does

  • Archived-only view — unarchived sessions are never shown; the page is the place where archived records are managed.
  • Search — filters the list by title, workspace path, or session id (literal, case-insensitive).
  • Sort — click Created or Size in the header; the largest sessions are one click away, which is usually why this page gets opened.
  • Multi-select — select all (of the current list) / per-row checkboxes, then act on the selection. A selection survives a search change; the toolbar and the confirm sentence say how many selected records are not currently listed.
  • Restore — unarchives the selected sessions; they return to the conversation list in their workspace.
  • Delete — permanently removes the durable session log, its projection-cache checkpoint, and its workspace membership entry. Destructive actions ask for confirmation (Cancel holds focus, Escape closes) and show the reclaimed size afterwards.
  • Size and totals — each row shows the on-disk size of the session log; the line above the table totals what is currently listed.

Safety model

Reading these before trusting the delete button is worthwhile; each one is enforced in the host half, not in the page.

  • The routes are authenticated or refused. Every request goes through the host's connection.requestRejection (Host/Origin check plus browser authentication). A composition that mounts no connection service cannot authenticate the call, so the request is rejected — absence fails closed rather than opening a data-destroying endpoint.
  • Only archived sessions can be deleted. The endpoint re-reads the archived set and refuses (not-archived) for any id outside it. An unarchived conversation keeps its log even if a client asks by id.
  • A session with work in flight is refused, not stopped. The check reads the live agent.status and the recorded turn boundary, so a turn parked on an approval or a question is caught too. An idle resident session (opened, no turn running) stays deletable. Only resident sessions are asked: a log left behind by a crash is not "busy".
  • A session the process still holds frees its bytes now, and its row on the next start. The harness keeps opened/restored sessions in memory, lists them from that memory, and exposes no public unload API — only the owner of an AgentHandle can dispose one. So the log, projection checkpoint and workspace membership go immediately, while the archive entry stays: an empty ghost must not fall back into the conversation list. The queued id lets the next start drop the entry too.
  • A session whose log cannot be removed yet is queued. Same queue path: if the directory is still held (Windows write handle), the id is retried at the next start and on teardown.
  • Best-effort steps report instead of failing silently. Removing the pin, the workspace membership, or the projection checkpoint cannot fail the delete (the log is already gone), but each failure is returned as a warnings entry and shown on the page.
  • Residue does not survive a restart, and does not need one. The startup drain and the per-list sweep both remove workspace membership, projection checkpoints, and archive entries whose Session no longer exists anywhere — a deleted session leaves nothing behind, on disk or in the sidebar.

Behavior and limits worth knowing

  • Deletion is real and immediate for a cold session: the log directory under ~/.dsh/sessions/<workspace>/<session-id>/, its session_projcache checkpoint, its Workspace sessionIds entry, and its archive entry are removed in one request — the row leaves the archived group at once.
  • A resident session is deleted in two stages: the log and cache go at once (space is freed, nothing is restorable from disk), and the archived row disappears at the next start, when the process no longer holds the Session. Until then it stays in the archived group rather than falling back into the conversation list — the failure mode of clearing the entry while the Session is still live.
  • Content search is not available: the shipped full-text backend is not mounted for the main query service (openAt: never), so search covers metadata only. A literal-content search could be added on top of sessionQuery.filterEvents, at the cost of reading every archived log.
  • The page cannot archive. Archiving belongs to the conversation list; this page only manages what is already archived, so it lists nothing else.

Configuration

Both roots are resolved at request time, in this order:

  1. the row's own config (sessionsRoot, storageRoot),
  2. the configEditor view of the @deepseek-ai/dsh-session-persistence-jsonl / @deepseek-ai/dsh-storage-json rows (root),
  3. $DSH_HOME — ~/.dsh/sessions and ~/.dsh/storages.
- id: session-manager
  name: 'dsh-archive-sessions'
  config:
    sessionsRoot: 'D:\dsh-data\sessions'
    storageRoot: 'D:\dsh-data\storages'

Files

| File | Role | |---|---| | index.js | Host half: registers /session-manager/{list,restore,delete} on the host webServer; reads the corpus through ctx.sessionQuery, the archived set through the live workspace domain, edits workspace membership, removes storage directories. | | client.js | Web half: registers the settings.section page, its settings.section.icon nav glyph, and its styles. | | test/host.test.mjs | Node test suite for the pure host logic (id validation, directory indexing, tombstone queue, per-id result handling). | | cordis.patch.yml | Inserts the session-manager Loader row. | | locale/en.json, locale/zh.json | Display metadata shown by Plugin Manager and Settings. | | icon.svg | Original line-style mark. |

Install

From npm:

npm i dsh-archive-sessions

Then add it to a profile's dsh.profile.bundles list (its cordis.patch.yml inserts the Loader row). Installing the package directory through Plugin Manager (install_bundle) works too.

Host-side code changes require an app restart; client code reloads with the page when the host re-serves the bundle.

Develop

npm test      # node --test "test/**/*.test.mjs"  (no dependencies)
npm run check # node --check on both halves
npm pack      # → dsh-archive-sessions-1.2.0.tgz(package/ 为根)

The tarball contains exactly the files list plus LICENSE.

License

MIT © 2026 xiaobaga281