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

@qqqw114/dsh-archived-sessions

v0.1.0

Published

DeepSeek Harness (DSH) plugin — list, restore, and permanently delete archived sessions from the Web UI.

Readme

dsh-archived-sessions

一个 DeepSeek Harness (DSH) 插件:在 Web UI 的「设置」面板里查看、恢复、以及彻底删除已归档(隐藏)的会话

为什么需要它

DSH 的会话右键菜单有「归档会话」,但当前版本(0.1.0-rc.6没有查看或恢复已归档会话的入口——dsh-client-ui-workspace 的 README 原文是 "No Session deletion or unarchive control"。归档之后会话从侧边栏消失,且没有内置办法找回来。

本插件补上了这个能力,并且在「设置 → 已归档会话」里提供三个操作:

  • 列出:显示每个已归档会话的标题、所属工作区、会话 id。
  • 恢复:把会话从归档集合移除,立即回到侧边栏。
  • 彻底删除:二次确认后,从归档集合移除、从工作区会话清单 detachSession、并删除本地日志文件(session.jsonl.zstd,不可恢复)。

所有操作都走宿主的持久化写入,会触发 domain/changed → 前端实时刷新,无需重启

特性

  • 零构建:纯 JavaScript,不需要 TypeScript / tsdown / typert-generator。
  • 宿主侧走 Typert 网关的 SRC 模式:只靠 typertRemote 绑定 + Remote 方法标记即可被自动发现,无需手写 manifest。
  • 客户端 dsh.client bundle 挂载 TYPERT_REMOTE 后,用 ctx.remote.<namespace>.<method>() 调用宿主,codec 只需一个 { parse(value) } 对象(不依赖 zod)。

目录结构

dsh-archived-sessions/
├── package.json      # dsh.client 声明 + exports
├── lib/
│   ├── index.js      # 宿主侧:ArchivedSessionsService(list / restore / removeSession)
│   └── client.js     # 浏览器侧:挂载 Remote + 注册 settings.section 页面
└── README.md

工作原理

宿主侧(lib/index.js

ArchivedSessionsService 继承 @deepseek-ai/dsh-typert-protocolTypertRemoteService,其构造器会自动设置 typertRemote 绑定({ service, serviceKey, namespace })。

因为纯 JS 无法在调用点产生 TC39 stage-3 装饰器的 context.addInitializer,这里手工构造了装饰器上下文并调用 Remote(name),把方法标记注入 remoteMethods() 读到的私有 marker 表。Typert 网关的 SRC 发现据此把 archivedSessions/listarchivedSessions/restorearchivedSessions/removeSession 三个端点路由到本服务的方法。

关键点:

  • 服务通过 inject: ["workspaceRegistry", "sessionQuery", "sessionPersistence"] 拿到宿主能力。
  • restoreworkspaceRegistry.setState() 把 id 从 archivedSessionIds 里去掉(持久化 + 更新内存缓存)。
  • removeSession 额外用 workspace.detachSession(id) 从工作区清单移除,并用 sessionPersistence.locate(header) 找到日志文件路径后 node:fs/promisesrm 删除。

浏览器侧(lib/client.js

一个标准的 dsh.client 工厂 bundle:

  1. require("react")(平台 seed 模块,无需打包)。
  2. 定义 TYPERT_REMOTE(3 个 descriptor,codec 用 mode: "strict" + 带 parse() 的普通对象)。
  3. apply(ctx)await ctx.remote.$mount(TYPERT_REMOTE),然后 ctx.get("remote.archivedSessions") 拿到命名空间服务。
  4. ctx.slotssettings.section 注册「已归档会话」页面。

安装

dsh plugin --profile web add @qqqw114/dsh-archived-sessions

然后编辑 ~/.dsh/profiles/web/cordis.patch.yml,加入:

- insert:
    - id: archived-sessions
      name: dsh-archived-sessions

重启 DSH。

注意:cordis.patch.yml 是 profile 的用户补丁层;cordis.yml 顶部注释明确写着 "Edit cordis.patch.yml, not this file."。

运行时依赖(宿主侧服务)

插件不打包任何依赖,宿主必须已提供以下 Cordis 服务(@deepseek-ai/dsh-base / @deepseek-ai/dsh-web-app 默认都有):

  • workspaceRegistrysessionQuerysessionPersistence(宿主侧)
  • remote(api-gateway 客户端)、slots(浏览器侧)
  • @deepseek-ai/dsh-typert-protocol(宿主侧 import)

发布

已发布到 npm:@qqqw114/dsh-archived-sessions。GitHub 仓库已打上 dsh-plugin topic。

License

MIT