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

@happyqu/dsh-plugin-archive-explorer

v0.1.0

Published

deepseek-harness plugin: browse, search, read and permanently delete archived sessions, grouped by workspace

Readme

@happyqu/dsh-plugin-archive-explorer

一个 deepseek-harness 插件:在设置里新增「归档会话」页面,按 workspace 分组浏览、搜索、查看,并可重新加入或永久删除归档会话。

功能

  • 按 workspace 分组 — 复用工作区注册表,按工作区归组,无归属的归入「未分组」
  • 搜索 — 匹配标题、路径、会话 id、工作区名,以及消息正文(正文命中会显示片段预览)
  • 点击查看 — 点击卡片弹出对话内容(用户 / 助手 / 工具消息,带序号与时间)
  • 重新加入会话 — 从归档集合移除,会话回到侧边栏(不删日志)
  • 彻底删除 — 永久删除该会话的日志目录(二次确认,不可恢复)

安装

dsh plugin --profile web add @happyqu/dsh-plugin-archive-explorer
dsh --profile web --dump-config
# 重启 dsh web

dsh plugin add 会安装依赖并将 bundle 加入 profile。包自带 cordis.patch.yml,会以 insert 的方式追加插件行;--dump-config 可确认该行已进入配置树。

本地开发可从插件目录运行 dsh plugin --profile web add .。

发布

npm test
npm pack --dry-run
npm login
npm publish --access public

发布前确认 npm 账户拥有 @happyqu scope 的发布权限。prepublishOnly 会在发布时再次运行测试。

测试

npm test

三个套件,都不需要启动 dsh:

  • verify-encoding.mjs — 路径编码与 dsh-session-persistence-jsonl 逐字节比对 (含真实磁盘目录名 --D-happy-deepseek--)
  • verify-host.mjs — 用模拟的 Cordis 上下文驱动 RPC 路由,并在真实文件系统上 验证删除、墓碑保留、记账摘除、以及 415/405/未知方法等错误路径
  • verify-client.mjs — 用最小 React shim 载入 __ModuleLoader__ bundle, 断言 slot 注册、渲染文本、以及 RPC 坐标与 Host 一致

工作方式

隐藏机制:归档集合就是「隐藏标记」

工作区注册表的归档集合(archivedSessionIds)是本插件唯一可用的、由注册表拥有的隐藏手段:客户端 sessionVisible() 要求 !archived.has(id),因此被归档的 id 不会出现在任何侧边栏表面(分组行、平铺行、「未分组」)。

因此「彻底删除」会保留该 id(墓碑),只删除日志文件与工作区记账。若把 id 一并移除,会话会同时变得「可见」且「未被记账」——这正是它会重新出现在「未分组」的原因。

代价是 workspace.json 里多留一个 id 字符串。日志已被删除,因此该 id 不会出现在界面列表中(界面按 persisted === true 过滤)。

删除流程

  1. 若该会话有 agent 正在运行 → 拒绝(日志被占用且仍在写入)
  2. 先写墓碑 — 此时会话仍可被解析,官方 archiveSession() 的存在性校验能通过;日志删除后该校验就无法通过了
  3. 删除日志目录(node:fs/promises rm,失败重试 5 次)
  4. 通过工作区实体的 detachSession() 摘除记账

先写墓碑的另一个好处:即使日志删除失败,会话也仍处于「已归档」状态(可用「重新加入」恢复),不会变成半删除状态。

性能

查看对话使用 readSession(),一次加载即可拿到带 payload 的完整日志。

不要用 listEvents() + 每个事件 readEvent():readEvent() 内部会调用 corpus.load(),对冷会话意味着每个事件都重新读取、解压、解析并克隆整个日志,即 O(n²)。

目录结构

@happyqu/dsh-plugin-archive-explorer/
├── package.json          # dsh.bundle.patch + dsh.client.platform
├── cordis.patch.yml      # 插入插件行
└── lib/
    ├── index.js          # Host:RPC 端点 + 日志删除
    └── client.js         # Client:settings.section 页面

Host 与 Client 通过 Connection RPC 通信(connection.rpc.call / connection.fetch.register),端点 archive-explorer。

说明

  • 路径编码(projectKey / encodeSegment)按 @deepseek-ai/dsh-session-persistence-jsonl 的实现镜像,用于定位日志目录
  • connection 是可选注入:它只由 Web bundle 提供,静态 inject 会让本插件在 headless profile 中永久 pending,导致整个 profile 启动失败

License

MIT