dsh-web
zhu1090093659/dsh-webDeepSeek Harness(DSH)Web 插件聚合生态包 · 一切皆插件,创意工坊分发(dsh-market.com)
一个 DeepSeek Harness 插件,用于自动归档闲置会话。超过设定闲置时间的会话将被自动归档,从侧边栏隐藏但数据完整保留,可随时恢复。
$DSH_HOME/settings.yaml# 安装到默认 profile
dsh plugin --profile default add @ohmejj/dsh-chat-archive
# 或安装到 web profile
dsh plugin --profile web add @ohmejj/dsh-chat-archive
# 或安装到 tui profile
dsh plugin --profile tui add @ohmejj/dsh-chat-archive
安装后会自动配置:dsh plugin add 命令会自动将插件添加到 profile 的 bundle 层,插件会在下次启动时自动加载。
重启 DSH 即可使用:
# 如果是 web profile
kill "$(cat ~/.dsh/dsh-web.pid)"
dsh --profile web
# 如果是其他 profile,使用对应的启动命令
工作原理:插件包含 dsh.bundle.patch 配置,会自动向 DSH 的 Cordis loader 注册自己。安装命令会将插件添加到 profile 的 dsh.profile.bundles 列表中,DSH 启动时会自动加载。
| 配置项 | 说明 | 默认值 |
|---|---|---|
| 启用自动归档 | 总开关,关闭后不扫描不归档 | 关闭 |
| 闲置阈值 | 会话闲置超过该时间后将被归档 支持单位:分钟/小时/天 | 72 小时 |
| 扫描间隔 | Host 端每隔多久扫描一次(分钟) | 30 分钟 |
| 立即归档 | 点击后立即按当前配置扫描一次 | - |
$DSH_HOME/settings.yaml 的 chat-archive 章节sessionPersistence.locate() 定位会话工件(如 session.jsonl / session.jsonl.v3),读取其 mtime 作为最后活动信号;.v3.jsonl 工件缺失时自动回退到旧版 .jsonlmax(阈值, 一个完整扫描间隔) 才会被归档在实际启用归档前,可以使用预览脚本查看哪些会话将被归档:
# 使用默认配置预览(72 小时阈值,30 分钟间隔)
node scripts/preview-archive.mjs
# 自定义阈值和间隔
node scripts/preview-archive.mjs 10 minutes 5 # 10 分钟阈值,5 分钟间隔
node scripts/preview-archive.mjs 7 days # 7 天阈值
node scripts/preview-archive.mjs 48 hours # 48 小时阈值
预览脚本会列出:
# 从指定 profile 卸载
dsh plugin --profile web remove @ohmejj/dsh-chat-archive
卸载后会自动清理:卸载命令会自动从 profile 的 bundle 列表中移除插件。重启 DSH 即可生效。
注意:卸载插件不会影响已归档的会话,这些会话仍然存在于归档集中,可通过 DSH 原生功能恢复。
依次检查:
ls ~/.dsh/profiles/web/node_modules/@ohmejj/dsh-chat-archive~/.dsh/profiles/web/package.json 中的 dsh.profile.bundles 是否包含插件$DSH_HOME/settings.yaml 中的 chat-archive 配置是否生效插件通过 dsh plugin add 安装后,会自动添加到 profile 的 dsh.profile.bundles 列表中。可以通过以下方式确认:
# 查看 profile 的 package.json
cat ~/.dsh/profiles/web/package.json | grep -A 5 '"bundles"'
应该能看到类似这样的输出:
"bundles": [
"@deepseek-ai/dsh-base",
"@deepseek-ai/dsh-web-app",
"@ohmejj/dsh-chat-archive"
]
重启 DSH 后,插件会自动加载,无需手动编辑配置文件。
MIT License - 详见 LICENSE 文件
ohmejj
欢迎提交 Issue 和 Pull Request!
注意:本插件使用 DSH 原生的归档机制,归档操作是可逆的,归档的会话可以随时通过 DSH 的归档管理功能恢复。