guo6x/dsh-housekeeper
Environment housekeeper for DeepSeek Harness: toolchain inventory, safe cache cleanup, and machine rules editor in the Web GUI settings.
已收录
1
Dev
Bundle 已验证
预览
功能介绍
agent 的环境管家:工具链台账(node/pnpm/git/gh/ffmpeg/浏览器)、缓存与临时目录扫描 + 白名单安全一键清理、机器规则(AGENTS.md)编辑,全在 Web GUI 设置面板。
适合
- 希望在 Web GUI 中盘点 Node、pnpm、Git、GitHub CLI、FFmpeg 和已安装浏览器的 DeepSeek Harness 管理者。
- 需要通过受保护控件清理 agent 创建的项目临时目录和缓存根目录子项的用户。
- 维护全局 AGENTS.md 机器规则,并需要自动备份和一键恢复的团队。
不适合
- 任意文件系统清理;删除范围仅限获准的项目 .tmp 路径和缓存根目录直属子项。
- 没有 DeepSeek Harness web profile 或 Node 22 以上版本的环境。
- 需要一次通过 housekeeper_clean 清理超过十个路径的大批量自动化任务。
README
🧹 dsh-housekeeper — Environment Housekeeper
中文说明 · DeepSeek Harness plugin
Keep your agent’s hands clean: toolchain inventory, safe one-click cache cleanup, and machine rules (AGENTS.md) editing — all inside the DSH Web GUI settings. Zero runtime dependencies, one command install.
- 📋 Toolchain inventory — auto-detects node/pnpm/git/gh/ffmpeg/Edge/Chrome locations and versions
- 🗑️ Honest cache cleanup — scans the
.tmpand cache directories agents leave behind: size / file count / mtime, 4000-file truncation markers, 30-day-untouched highlighting, click-to-expand content preview, check and delete - 🛡️ Whitelist protection — only project
.tmpdirs and cache-root children are deletable;..escapes, symlink escapes, and system paths are rejected, with a realpath re-check before every delete - 📝 Machine rules editor with a safety net — read/write
~/.dsh/AGENTS.md(the global rules every agent session loads), auto-backup of the previous version on every save, one-click restore, live on save - 🌍 Configurable — scan roots default per platform (Windows:
D:\github/D:\environment\cache), editable in the panel, overridable via env vars - 🤖 Agent tools —
housekeeper_report(inventory + disk report) andhousekeeper_clean(same whitelist, max 10 paths per call)
Install
dsh plugin --profile web add dsh-housekeeper
Restart dsh web, then Settings → Plugins → 环境管家.
Requirements: DSH web profile, Node ≥ 22.
Security model
- All routes accept loopback clients only (403 otherwise)
-
Cleanup whitelist — a path is deletable only when ALL hold:
- under
<projects-root>\<repo>\ .tmp\, or a direct child of<cache-root>\ - normalized path stays inside the whitelist root (no
..) -
realpathstill lands inside the whitelist root (no symlink escapes) - the whitelist roots and repo dirs themselves are never deletable
- under
- The rules endpoint reads/writes
$DSH_HOME/AGENTS.mdonly; the path is fixed - No telemetry, no external network calls
How it works
GUI settings ──fetch──▶ /housekeeper/state|clean|rules (loopback) ──▶ host plugin
├─ probe: candidate paths + PATH lookup + versions
├─ scan: rule-driven walk with sizes (4000-file cap)
├─ clean: whitelist + realpath check, then rm
└─ rules: read/write $DSH_HOME/AGENTS.md (64KB cap)
Develop
pnpm install
node build.mjs # esbuild → lib/index.js (host ESM) + lib/client.js (ModuleLoader bundle)
node tests/core.mjs # 21 whitelist/scan/clean sandbox tests, no real environment needed
MIT licensed. Issues and ideas welcome.
常见问题常见问题
在启用了 DSH 的终端中执行已验证命令 dsh plugin --profile default add github:guo6x/dsh-housekeeper。命令会解析公开 package 元数据,并保持插件与本页展示的目录身份一致。
兼容性以页面上展示的 bundle 与 profile 状态为准。如果某个 profile 尚未检测到,请先保持禁用,并在生产启用前阅读仓库文档。
GitHub 链接和 activity 元数据是 release 与维护状态的来源。新版本发布后重新查看本页,确认目录已经观察到最新版本。