Zum Hauptinhalt springen
D

dsh-go-artifacts

dengxingyu/dsh-go-artifacts

Chat artifacts panel for the dsh-go native phone UI: intermediate files in the workspace grouped by the conversation that produced them, multi-select and batch delete, and a confirmed clean-up of the current scope. Session logs are read locally to attribute a file to a chat; deletion is limited to regular files inside the workspace root and refuses symlinks and escaping paths.

Installation

dsh plugin --profile web add github:dengxingyu/dsh-go-artifacts

README

dsh-go-artifacts

给 dsh-go 手机 App 的原生「对话产物」面板:把工作区里由对话产生的中间文件按对话归类,点进去逐个清理,也可以一次清空。

通用文件浏览交给 dsh-go-files;这个插件只管「这个对话造了哪些文件、占了多少、能不能删」。

功能

位置内容
对话详情页「插件」页签 / 全部功能面板 对话产物:文件数、占用空间、对话数三个数字,下面是按对话分组的列表
分组列表每组显示这个对话产出的文件数与总大小,按占用从大到小排;没有归属的文件进「未归类」
单个对话逐行列出文件名、大小、相对时间、类型(图片 / 临时文件 / 其他);点一行勾选,可多选后批量删除
全部删除列表底部与对话内都有确认按钮,确认后删掉当前范围的产物并回报删了几个、腾出多少

它怎么判断「产物」

只看工作区里的文件,规则故意保守,宁可少列也不误删:

  • 图片:png jpg jpeg webp gif bmp tif tiff svg heic avif
  • 临时文件:tmp temp log part crdownload cache bak swp pyc
  • 文件名以 img_ shot screenshot crop thumb ocr vision tool tmp temp preview render 之类开头
  • 路径里出现 tmp/、temp/、artifacts/、cache/、.cache/

扫描上限:下探 6 层、最多 800 个文件、单个文件超过 64 MiB 跳过;.git、node_modules、.venv、__pycache__、.dsh-vision-toolkit 等目录不进。

「哪个对话造了它」

读本机会话日志 $DSH_HOME/sessions/…/session.v4.jsonl*(zstd),把日志里出现过的路径和文件比对:一个文件被多个对话提到时,归给最近结束的那个对话;一次都没提到的进「未归类」。全部在本机读,运行时不联网、不上传任何内容。

删除的安全性

  • 只能删工作区根目录里面的普通文件:路径越界、符号链接、非普通文件一律拒绝。
  • 删除是直接 unlink,不进回收站,所以两个入口都要确认;先在单个对话里勾选删更稳。
  • 不碰源码、配置、用户交付物——只有符合上面规则的候选文件会出现在列表里。

发布 / 更新

仓库自带两个脚本,登录一次就能重复用:

node scripts/login.mjs              # GitHub 设备码登录,token 存 ~/.dsh/github-token(600)
node scripts/login.mjs --status     # 看 token 属于谁、有哪些 scope
node scripts/publish.mjs            # 建仓库 → 推 main → 打 topic → 发 Release → 提条目 PR
node scripts/publish.mjs --step repo|release|pr
node scripts/login.mjs --logout
  • token 不进 git config:推送走一次性 http.extraheader,git remote -v 里只有干净 URL。
  • 网络会瞬断,所有 API 与 push 都带退避重试(GH_RETRIES 可调)。
  • GH_OWNER 缺省取 token 的登录名;DRY_RUN=1 只打印请求。

安装

dsh plugin --profile web add github:dengxingyu/dsh-go-artifacts

装完在 App 里:对话详情页 →「插件」页签 →「对话产物」,或「全部功能」里找同名面板。改了 lib/ 里的代码要在 App 的「引擎」页重启引擎才生效。

npm 包:npm i -g dsh-go-artifacts 之后同样用 dsh plugin --profile web add dsh-go-artifacts 安装(预构建安装免 allowBuilds 授权)。

许可

MIT。

Ähnliche Plugins