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-plugin-session-import

v0.1.1

Published

DeepSeek Harness 插件:导入 claude-code / codex / reasonix / zcode 的聊天记录为 dsh 会话(含工作区绑定)。

Readme

dsh-plugin-session-import

Awesome DSH Plugin

已收录于 awesome-dsh-plugin 精选列表(Sessions & Messages)· AdamPlatin123 自动雷达(✅ 运行级验证通过)

DeepSeek Harness(dsh)插件:把 claude-code / codex / reasonix / zcode 的历史聊天记录导入为 dsh 会话(含工作区绑定与工具能力),导入后可直接续聊。

功能

  • 四种工具解析
    • claude-code(含 Claude-3p 新端、中文路径 .claude.json 权威映射)
    • codex(新旧两种响应格式,custom_tool_call 参数自动从 JS 代码转 JSON)
    • reasonix(旧 CLI + 新桌面版,项目 slug 贪心解码真实路径)
    • zcode(db.sqlite 权威索引 + compaction 压缩摘要还原)
  • 会话发现:标题 / 项目名 / 消息数 / 时间齐全,30s 缓存扫描
  • 搜索:按标题 / 项目名过滤(防抖输入)
  • 批量导入:多选会话一次导入,每个会话独立 seed + 工作区绑定
  • 工具完整可用:导入会话自动加入默认 preset scope,25+ 工具(read/edit/glob/grep/pwsh 等)与正常会话一致
  • 超长会话保护:三层保障(内容裁剪 → 消息截断 → 单条兜底),任何长度 / 任何模型窗口都不超限
  • Web UI:侧边栏「⇩ 导入会话」按钮(明暗主题自适应),导入成功自动关闭
  • 命令/import <tool> <path>(文件或目录批量)

安装

方式一:官方命令(推荐)

# 装进 web profile(自动 reconcile dsh.profile.bundles)
dsh plugin --profile web add dsh-plugin-session-import
dsh web   # 重启生效

方式二:商店一键安装

dsh-store,打开「插件商店」搜索安装。

方式三:手动

# 1. 安装插件包
npm i dsh-plugin-session-import

# 2. 在 profile 挂载(~/.dsh/profiles/web/cordis.patch.yml):
# - insert:
#     - id: session-import
#       name: 'dsh-plugin-session-import'

# 3. 重启 dsh web
dsh web

使用

  • 点击侧边栏底部的 「⇩ 导入会话」 → 选择工具 → 搜索 / 滚动分批加载 → 勾选 → 导入
  • 或命令行:/import codex C:\Users\xxx\.codex\sessions(目录=批量)

会话数据位置

| 工具 | 会话目录 | |---|---| | claude-code | ~/.claude/projects/ + %LOCALAPPDATA%\Claude-3p\claude-code-sessions(新端) | | codex | ~/.codex/sessions/ | | reasonix | ~/.reasonix/sessions/(CLI)+ %APPDATA%\reasonix\projects\*\sessions(桌面版) | | zcode | ~/.zcode/cli/db/db.sqlite(权威索引) |

导入质量保障

| 能力 | 说明 | |---|---| | 工具调用链 | seed 中 assistant/message 承载 tool-call 块,tool/result 紧跟对应调用(含孤儿 result 丢弃、迟到 result 配对),满足 OpenAI/DeepSeek wire 规则 | | zcode 压缩 | 识别 compaction 标记,摘要正文(summary.body)原样还原为上下文 | | codex 参数 | custom_tool_call 的 JS 代码参数(tools.exec_command({...}))自动转成标准 JSON,避免模型学到错误调用格式 | | 超长截断 | 文本 ≤16K 字符、工具结果 ≤40K 字符裁剪;消息按预算截断(保留开头锚点 + 压缩摘要 + 尾部);单条超预算一半直接丢弃 | | 预算自适应 | 按默认模型真实窗口(contextWindow − maxTokens − 25% 余量)动态计算,DSH_IMPORT_CONTEXT_BUDGET 可覆盖 | | cwd 修复 | claude 中文路径(.claude.json 权威映射)、reasonix slug 贪心解码——避免 workspace=主目录导致沙箱拒绝 |

已知限制

  • 图片附件降级为占位文本(部分工具不支持 image block)
  • 被截断的历史消息不保留(超长会话的中间轮次丢失,但保留摘要与锚点)
  • reasonix 桌面版部分会话标题依赖 .titles.json,缺失时回退文件名提取

开发

npm run build      # esbuild 构建 lib/index.js + lib/client.js
node test-events.mjs   # toSessionEvents 单元测试 21 项(工具配对/孤儿丢弃等)
node test-codex.mjs    # codex 解析器 7 项(exec_command 参数转 JSON)
node test-reasonix.mjs # reasonix 解析器 5 项
node test-slug.mjs     # slug 路径解码 4 项
npm pack           # 打包验证

License

MIT