dsh-archived-sessions

by hashdiana

记忆github收录于 08-23

DeepSeek Harness 设置里的「归档会话」页——重新打开侧栏藏起来的那些会话

An "Archived sessions" page in the DeepSeek Harness settings — reopen the sessions the sidebar hides.

安装

dsh plugin --profile web add github:hashdiana/dsh-archived-sessions

GitHub 源码安装:首次需按提示配置 allowBuilds 构建授权后重试

安装与环境配置指引、插件开发教程见 DSH 中文社区文档 ↗

安装即在你的机器上以你的权限运行第三方代码——它可读写文件、使用凭据、访问网络,DSH 的工具审批不会为插件代码加沙箱。「检测到 manifest」仅代表发现 dsh.bundle / dsh.plugin 清单,不构成兼容性或安全审查;安装前请审阅源码,不熟悉的插件先在不含密钥的环境试用。

README

目录

dsh-archived-sessions

在 DeepSeek Harness 设置面板中新增「已归档会话」页——重新打开侧边栏藏起来的会话。

GitHub stars License: MIT DSH Plugin

🌐 中文 · English

DSH 插件:在设置面板中新增一个「已归档会话」分区页,列出所有已归档的会话(这些会话默认从侧边栏分组界面与搜索中隐藏),点击任意条目即可重新打开该会话并关闭设置面板。

🎯 归档不应该是单行道——每个已归档会话都应保持在一次点击之内。

为什么需要它

DSH 0.1.0-rc.6 中会话归档是单向的:workspace.archiveSession 把会话移入 registry 级归档集合后,所有分组界面与搜索结果都会隐藏它,且当前版本没有 unarchive API。本插件补上「找回归档会话」的缺口——会话日志与 workspace 记账都还保留着,随时可以重新打开继续。

安装

从 GitHub 安装(推荐):

npx -p @deepseek-ai/dsh dsh plugin --profile web add github:hashdiana/dsh-archived-sessions

从本地源码目录安装:

npx -p @deepseek-ai/dsh dsh plugin --profile web add <仓库本地路径>

安装后重启目标 profile(dsh web --profile web 等)。插件以纯 client 插件形态运行:host 半是空实现,浏览器半注册 settings.section 条目。(lib/ 构建产物已提交进仓库,Git 安装不会触发 build。)

开发

pnpm install
pnpm typecheck   # tsc -b
pnpm build       # tsc -b && tsdown → lib/index.js(host) + lib/client.js(browser)
pnpm test        # vitest run --pool=threads
  • client bundle 由 tsdown 产出为 window.__ModuleLoader__.load({id, factory});
  • CSS Modules 走 lightningcss 哈希 + <style data-plugin> 注入;
  • 改源码后记得 pnpm build 并提交 lib/(Git 安装用的是构建产物,不跑 build)。

架构

  • 接缝:settings.section(list 槽,dsh-client-ui-settings 声明类型,ui-settings-general 运行时声明),条目 id=archived-sessions、order=100,label 为函数式 () => t('nav')——shell 在每次 locale revision 上重解析,语言切换自动生效。
  • 数据:ctx.workspaces.list(WorkspaceListState.archivedSessionIds,归档顺序)与 ctx.sessions.list(SessionListState.byId,标题/时间/运行态),通过 register 的 inject 工厂传入组件,useSyncExternalStore 订阅快照。
  • 行为:点击行 → ctx.sessions.open(id) + 设置面板 close();归档会话仍在会话列表 store 中,可直接打开。

验证矩阵

  • pnpm typecheck / pnpm build / pnpm test
  • 全新 scratch profile:dsh plugin --profile <scratch> add github:hashdiana/dsh-archived-sessions → dsh --profile <scratch> --dump-config 应出现 dsh-archived-sessions 层
  • GUI:web profile 打开设置 → 左侧导航出现「已归档会话」→ 归档一个会话后条目出现在列表中 → 点击打开

License

MIT

原始 README: https://github.com/hashdiana/dsh-archived-sessions/blob/main/README_CN.md ↗