Skip to content

Releases: sailoumili/dsh-session-remover

dsh-session-remover v1.0.2

Choose a tag to compare

@sailoumili sailoumili released this 25 Oct 16:26

中文 | English

中文

🎯 会话目录定位修正

删除对话时,会话目录的定位以会话日志头部记录的编号为准。同一编号对应多个会话目录时,优先删除目录名与所传编号完全一致者;无法确定唯一目标时拒绝删除并报错,不改动任何数据。

  • 新增错误码 E_AMBIGUOUS_TARGET,同一编号对应多个会话目录时拒绝删除
  • 空目录仅删除自身,不按编号展开子代理会话

English

🎯 Session directory resolution

The session directory is now located by the id recorded in the session log header. When one id maps to several session directories, the directory whose name equals the requested id exactly is deleted; if no unique target can be determined, deletion is refused with an error and no data is changed.

  • New error code E_AMBIGUOUS_TARGET, returned when one id maps to several session directories
  • An empty directory is deleted on its own and no longer expanded by id

dsh-session-remover v1.0.1

Choose a tag to compare

@sailoumili sailoumili released this 06 Oct 20:11

dsh-session-remover v1.0.1

中文 | English

修复 v1.0.0 的「回收站超时假失败」:回收站里项数很多时,删除对话会误报「已移入回收站 0 个」,其实文件已经进了回收站。

🐛 修复

  • 核对回收站不再全量枚举,改为直接读取回收站索引,删除耗时不再随回收站变大而变长。
  • 核对改为「搬移前后取差集」,只认本次新进回收站的项,再按「原位置 + 名字」点名;回收站里原有的同名旧项不会冒充成这次的成功。
  • 新增超时兜底:调用回收站超时、进程被杀或没写出结果文件时,先用索引复核,确认到位即按成功收尾。
  • 搬移前先确认目标磁盘有可用回收站:会话目录在网络盘、U 盘或未启用回收站的磁盘上时一律拒绝删除,不再有被永久删除的风险。

📦 升级

dsh plugin --profile web add dsh-session-remover@1.0.1

桌面版把 --profile web 换成 --profile desktop,装毕重启 DSH。用法与 v1.0.0 完全一致,无新增配置、无破坏性改动。

📄 许可

MIT。

🐛 Fixes

  • Verification no longer enumerates the whole recycle bin; it reads the recycle bin index directly, so deletion time no longer grows with the size of the bin.
  • Verification is now a before/after difference: only entries added by this deletion count, matched by original location and name, so an older item with the same name cannot pass as this deletion's success.
  • Added a timeout fallback: if the recycle-bin call times out, is killed, or writes no result file, the index is checked once more and the deletion is reported as successful once every item is confirmed present.
  • The target volume is now checked for a usable recycle bin before anything is moved: sessions on a network drive, a USB stick or a volume without one are refused instead of being permanently deleted.

📦 Upgrade

dsh plugin --profile web add dsh-session-remover@1.0.1

Use --profile desktop for the desktop edition, then restart DSH. Usage is identical to v1.0.0, with no new configuration and no breaking changes.

📄 License

MIT.

dsh-session-remover v1.0.0

Choose a tag to compare

@sailoumili sailoumili released this 06 Oct 16:13

dsh-session-remover v1.0.0

中文 | English

在 DSH 侧栏会话行的「…」菜单中增加「删除对话」与「批量删除…」,将对话及其子代理会话移入 Windows 回收站,可从回收站还原。

✨ 功能

  • 会话行「…」菜单新增红色危险项「删除对话」,确认后将对话移入系统回收站。
  • 一并移走该对话的全部子代理会话;由 fork 产生的分叉会话属独立对话,不受连带删除影响。
  • 新增「批量删除…」:按工作区分组列出全部普通会话,逐条勾选后串行删除,中途失败即停止并列出「已删除 / 未删除」明细。
  • 删除不是抹除:会话文件夹移入 Windows 回收站,同盘移动不复制数据,.dsh 内不留副本,可从回收站还原。
  • 支持删除当前打开的对话:先停止其运行中的任务并落盘,无需重启 DSH。
  • 界面文字随 DSH 界面语言切换,提供中文与英文两套。

🛡 安全设计

  • 删除端点仅放行回环地址(127.0.0.1 / localhost / [::1]),局域网来源一律返回 403。
  • 系统关闭回收站功能时(勾选「不将文件移到回收站中,直接删除」),插件拒绝删除,不会退化为永久删除。
  • 移入回收站后按「原位置 + 名字」逐项核对,确认确实进入回收站,而非被静默永久删除。
  • 无法读取会话目录时不作任何改动,不会将「读取失败」视为「磁盘上不存在」。
  • 待删除目录一律校验是否位于会话根目录内,越界即拒绝。

⚠️ 兼容性

  • 兼容 DSH 0.1.7 及以上版本,适用于网页版与桌面版。
  • 仅支持 Windows:移入回收站依赖系统脚本宿主 cscript.exe。
  • 零第三方运行时依赖,不写运行状态文件。

📦 安装

网页版:

dsh plugin --profile web add dsh-session-remover

桌面版:左侧栏「插件」→「添加插件」→ 输入包名 dsh-session-remover →「安装」→ 启用 → 重启 DSH。

⚠️ 已知限制

  • 回收站清空后不可还原;回收站存在容量上限,超出配额时 Windows 将丢弃最早的项。
  • 还原后可能不在原工作区:插件清除了工作区记账,还原的对话将出现在「未分组」中。
  • 附件不予回收:DSH 附件按内容寻址、跨会话共享且无引用计数。
  • 批量删除浮层不锁定焦点,按 Tab 键可能移至浮层后方的页面元素。

📄 许可

MIT。

✨ Features

  • A red danger item, "Delete conversation", is added to the session row "…" menu; confirming moves the conversation to the system recycle bin.
  • All subagent sessions of that conversation are moved along with it; forked conversations are independent and are unaffected by the cascading deletion.
  • "Batch delete…" lists all ordinary conversations grouped by workspace, deletes the ticked ones one by one, and stops at the first failure with an itemised report of what was and was not deleted.
  • Deletion is not erasure: the session folders go to the Windows recycle bin on the same volume, so no data is copied, nothing is left behind in .dsh, and a restore is possible.
  • Deleting the currently open conversation is supported: its running task is stopped and flushed to disk first, and no DSH restart is required.
  • Interface text follows the DSH interface language, in Chinese and English.

🛡 Safety

  • The delete endpoint accepts loopback addresses only (127.0.0.1 / localhost / [::1]) and returns 403 for LAN origins.
  • If the recycle bin is disabled system-wide ("Don't move files to the Recycle Bin. Remove files immediately when deleted"), the plugin refuses to delete rather than falling back to permanent deletion.
  • After the move, every item is verified in the recycle bin by original location and name, confirming it really landed there rather than being silently deleted for good.
  • When the session directory cannot be read, nothing is changed; a read failure is never treated as absence from disk.
  • Every directory to be deleted is checked to be inside the sessions root, and anything outside it is refused.

⚠️ Compatibility

  • Compatible with DSH 0.1.7 and later, for the web and desktop editions.
  • Windows only: moving to the recycle bin relies on the system script host cscript.exe.
  • No third-party runtime dependencies and no state files written.

📦 Installation

Web edition:

dsh plugin --profile web add dsh-session-remover

Desktop edition: sidebar Plugins → Add plugin → enter the package name dsh-session-remover → Install → enable → restart DSH.

⚠️ Known Limitations

  • An emptied recycle bin cannot be restored, and the bin has a size cap; past its quota Windows discards the oldest entries.
  • A restored conversation may not be in its original workspace: the plugin clears the workspace registry entry, so it appears under "Ungrouped".
  • Attachments are not reclaimed: DSH attachments are content-addressed, shared across conversations, and carry no reference counting.
  • The batch delete panel does not trap focus; Tab may move to page elements behind it.

📄 License

MIT.