BaiZhi967/dsh-plugin-zcode-import 预览 preview

BaiZhi967/dsh-plugin-zcode-import

Plugin插件 Native原生 ⭐ 2 MIT Sessions & Context会话与上下文

DSH 会话导入插件:按工作区浏览本地 ZCode 的会话,勾选或整工作区导入 DeepSeek Harness · Import local ZCode conversations into DeepSeek Harness

Project Overview项目介绍

dsh-plugin-zcode-import is a DSH-native session-import plugin whose sole purpose is to move historical conversations from the local ZCode CLI tool into a DeepSeek Harness instance. It is installed with dsh plugin --profile web add github:BaiZhi967/dsh-plugin-zcode-import or by inserting it into the active profile through cordis.patch.yml; once loaded, the DSH Settings panel gains a dedicated "Session Import" tab with a two-pane layout that lists ZCode workspaces on the left and their conversations on the right. The plugin opens ZCode's cli/db/db.sqlite strictly read-only, aggregates sessions by the directory field (there is no workspace table), and writes through the runtime sessionPersistence and workspaceRegistry APIs instead of touching session.v3.jsonl.zstd directly, avoiding the fail-closed read path that would produce unopenable sessions.

Imported conversations become fully native DSH sessions: they appear under the correct workspace in the left sidebar, can be reopened, continued, archived, or deleted just like sessions created inside DSH itself, and the original ZCode data is never modified. Conversation ids are derived from ZCode's UUIDs as session-<uuid>, so re-running an import hits an stat() check and is reported as "already exists" rather than producing duplicates. The target user is a developer or team that has accumulated a large ZCode history and wants a unified DSH workspace with includeSubagents=1, an ZCODE_HOME environment variable, or a root field under the plugin's config in cordis.patch.yml.

Dependencies are DSH >= 0.1.6-alpha.2 and Node >= 22.19.0 (it relies on the built-in node:sqlite module added in Node 22.5+); the license is MIT. Attachments in ZCode file parts are reduced to filename placeholders only, the recorded provider/model is preserved merely as a display tag on assistant turns, subagent sessions are hidden by default, and new ZCode conversations generated after the import require a second run. Two verification scripts (tools/check-conversion.mjs and tools/verify-stored.mjs) validate conversion and on-disk output against the official @deepseek-ai/dsh-session-format-catalog, reporting 403/403 conversion passes and 44/44 stored-session passes on a 2.4 GB database.

dsh-plugin-zcode-import 是一款面向 DeepSeek Harness(DSH)的原生会话导入插件,专门把本地 ZCode(CLI 编码助手)的历史对话迁入 DSH。它通过 dsh plugin --profile web add github:BaiZhi967/dsh-plugin-zcode-import 安装,也支持写到 profile 的 cordis.patch.yml 中;安装后设置面板会多出"会话导入"页,左栏列 ZCode 工作区,右栏列会话,勾选后可批量或整工作区导入。它只读打开 ZCode 的 cli/db/db.sqlite,复用 sessionPersistence 与 workspaceRegistry 运行时 API 写入,避开 fail-closed 的原始 jsonl 读取路径。

导入会话在 DSH 侧是真实原生会话:会出现在左侧列表对应工作区下、可继续提问、可归档;会话 id 由 ZCode 的 UUID 派生为 session-<uuid>,重复导入会被识别为已存在而跳过,不会产生副本。它面向已经把 ZCode 作为主力 CLI、又希望把历史沉淀搬进 DSH 统一管理的开发者与团队;典型流程是设置→会话导入→选工作区→勾选→一键导入→关闭设置继续使用,自定义目录可通过 ZCODE_HOME 环境变量或 cordis.patch.yml 的 root 字段指定。

依赖与限制:要求 DSH >= 0.1.6-alpha.2、Node >= 22.19.0(依赖内置 node:sqlite),MIT 协议。ZCode 库以 readOnly 打开,插件不会改动 ZCode 数据;二进制附件仅保留文件名占位,模型来源标注沿用 ZCode 记录;子代理会话默认折叠,可加 ?includeSubagents=1 列出;ZCode 后续新对话需重新导入。本机实测 403 个真人会话、236,060 个事件、44 个落盘会话均零失败。

Pre-install check安装前体检Compatibility · Security兼容性 · 安全性 1 warning1 项注意
  • Only 2 stars - very few users, little community feedback星标只有 2,几乎没人在用,遇到问题缺少社区反馈
DSH walks through these 9 checksDSH 会逐条核对这 9 项

Compatibility兼容性

  • DSH, Node, OS and profile requirementsDSH 版本 / Node 版本 / 操作系统 / profile 是否满足要求
  • External dependencies and runtimes (Electron / Python / Docker, ...)外部依赖与运行时(Electron / Python / Docker 等)是否齐备
  • Conflicts with installed plugins: command names, skill / tool names, ports, duplicate MCP registration与已装插件是否冲突:命令名、skill / tool 重名、端口占用、重复 MCP 注册

Security安全性

  • Repo matches the facts registered here; archived or abandoned?仓库是否与页面登记一致,是否归档或长期停更
  • Safety of preinstall / install / postinstall and install.sh / setup.ps1preinstall / install / postinstall 与 install.sh、setup.ps1 是否安全
  • curl|bash, download-then-execute, obfuscation, unrelated domains → stop immediatelycurl|bash、下载即执行、混淆代码、无关域名 → 立刻停止
  • Typosquatting or unmaintained packages among the new dependencies新增依赖里有没有 typosquatting 或无人维护的包
  • Requested permissions vs. what the feature actually needs申请了哪些权限、是否超出功能所需(filesystem / network / shell / clipboard)
  • Any sudo / admin requirement, plus uninstall and rollback是否要求 sudo / 管理员权限,以及卸载与回滚方式

Anything uncertain must be marked unknown with a note on how to confirm it. This site's signal screen is a static snapshot, not a security audit.拿不准的必须标「未知」并说明要我怎么确认。本站的信号筛查是静态快照,不能替代安全审计。

Or use CLI install (for developers)或使用命令行安装(适合开发者)

CLI Install命令行安装

dsh plugin --profile web add github:BaiZhi967/dsh-plugin-zcode-import

把 BaiZhi967/dsh-plugin-zcode-import 加入你的 DSH 配置(web profile)即可启用。

READMEREADME

dsh-plugin-zcode-import banner

dsh-plugin-zcode-import

English | 中文

license stars node

把本地 ZCode 的会话导入 DeepSeek Harness:设置面板里多一页「会话导入」,左边列出 ZCode 的工作区,右边列出该工作区的对话,勾选几条或整个工作区一键导入。导入后就是原生 DSH 会话——出现在左侧会话列表对应工作区下,能打开、能继续对话,不是导出一份文本。

  • 直接读 ZCode 的 db.sqlite,只读打开,不改动、不迁移 ZCode 的任何数据;
  • 会话 id 由 ZCode 的 UUID 派生,重复导入会被识别为「已存在」,不会产生副本;
  • 全量导入很快:30 个会话约 3 秒(本机实测)。

✨ 功能

能力 说明
设置页入口 设置面板新增「会话导入」页(与「通用 / 模型 / 插件」同级),无需命令行
工作区列表 按 session.directory 自动聚合出 ZCode 工作区,显示会话数、最近更新时间;目录已被删除的会标黄提示
对话列表 选中工作区后列出其对话:标题、更新时间、消息条数、是否已导入;子代理会话默认折叠
部分导入 勾选任意几条 → 「导入选中会话」;「全选未导入」一键勾选
整工作区导入 「导入整个工作区」一次导入该工作区全部对话
进度与明细 导入过程有进度条 + 当前标题,结束后逐条列出「已导入 / 已存在 / 跳过 / 失败」及原因
内容完整 文本、思考(reasoning)、工具调用与工具结果全部还原成 DSH 的 tool/call + tool/result
自动建工作区 目标目录在 DSH 里还没有工作区时自动创建并挂载,导入完即出现在侧栏
热重载 改 impl.js 后 POST /__reload 即可生效,不用重启 DSH;客户端改动由 DSH 模块热更新送达页面

📦 安装

# 从 GitHub 安装(本仓库)
dsh plugin --profile web add github:BaiZhi967/dsh-plugin-zcode-import
dsh --profile web

本地开发(clone 下来改):

git clone https://github.com/BaiZhi967/dsh-plugin-zcode-import.git
cd dsh-plugin-zcode-import

# 在插件目录的「父目录」执行,dsh 会把相对路径锚定到调用目录
dsh plugin --profile web add ../dsh-plugin-zcode-import
dsh --profile web

也可以直接写进 profile 的 cordis.patch.yml:

- insert:
    - id: zcode-import
      name: dsh-plugin-zcode-import

环境要求:DSH >= 0.2.0-rc.2、Node >= 22.19.0(用到内置 node:sqlite,需 Node 22.5+;本插件按 22.19 起算)。

装好后刷新一次页面,打开 设置 → 会话导入。

🚀 用法

  1. 设置 → 会话导入:顶部会显示识别到的 ZCode 数据目录;
  2. 左栏点一个工作区;
  3. 右栏勾选要导入的对话,点 导入选中会话;或直接点 导入整个工作区;
  4. 进度条跑完看「导入明细」,然后关掉设置——会话已经在左侧列表里了。

导入的会话可以像平常一样打开、继续提问、归档或删除。删掉导入的会话不会影响 ZCode 原数据。

自定义 ZCode 位置

默认读 <用户目录>/.zcode。非标准安装用任一方式指定:

Showing the opening section of the README — the full document lives in the repository以上为 README 开头摘要,完整文档在仓库内 · View the full README on GitHub →在 GitHub 查看完整 README →

← 上一个 Prev dsh-scnet 下一个 Next chat2skill →