nuwa-skill
alchaincyf
你想蒸馏的下一个员工,何必是同事。蒸馏任何人的思维方式——心智模型、决策启发式、表达DNA。Distill how anyone thinks.
1052088090/dsh-workspace-cleaner
Workspace & session cleanup for DeepSeek Harness: a settings page listing every workspace with its session count, plus a sidebar session menu row that really deletes a session log (into a recoverable trash).
PROJECT TOPICS
INSTALL REFERENCE
dsh plugin --profile web add github:1052088090/dsh-workspace-cleaner
该命令指向仓库当前默认分支;尚无绑定当前 commit 的完整验证结果。
PROJECT README
Workspace and session cleanup for DeepSeek Harness — a settings page that lists every workspace registration with its session count, plus a delete session row in the sidebar's session menu that really removes the log (into a recoverable trash).
Git 版说明见 README.zh.md。
DSH deliberately ships no session deletion. The JSONL persistence backend documents it plainly:
Nothing deletes session files — logs accumulate under
rootuntil removed externally; the seam has no deletion API.
So the sidebar's session menu only offers Archive. Once a few hundred sessions pile up, the sidebar becomes unmanageable and the logs keep growing on disk. This plugin fills the two gaps:
Nothing is unlinked on the first click: deletion is a rename, so it stays recoverable.
# from the directory that contains this package
dsh plugin add /absolute/path/to/dsh-workspace-cleaner
Or, inside a DSH session, ask the agent to install the bundle from the local directory; plugin_manager install_bundle links the checkout into the profile (node_modules/dsh-workspace-cleaner), so later edits to the files need only a restart.
Restart DSH after installing (the Host half registers HTTP routes), then reload the Web GUI.
Open a session's "…" menu → Delete session → confirm.
<dsh-home>/session-trash/<timestamp>--<session-id>/ with a meta.json recording the title, project directory, cwd and deletion time.| Action | Effect |
|---|---|
| Archive sessions (per workspace / bulk) | workspaceRegistry.archiveSession — sessions leave the grouped list, recoverable from the archived list |
| Delete workspace (per workspace / bulk) | workspaceRegistry.delete — drops the registration only; session logs, directories and files stay |
| Trash → Restore | Moves the log back, unarchives the session and re-attaches it to its workspace |
| Trash → Delete permanently | Removes the trashed directory for good and reports the freed bytes |
client.js ──POST /workspace-cleaner/api/{list,apply,trash,deleteSession,restore,purge}──► index.js
(settings.section page + sidebar session menu row) (Host: workspaceRegistry,
sessionPersistence,
node:fs over the log root)
ctx.connection.requestRejection). It is the only part that touches the filesystem.settings.section page (Workspace Cleanup) and one row in sidebar.workspaces.session.menu.item (Delete session, order 500, after the shipped rows). All text goes through the locale service (zh / en), and all styling uses --dsw-alias-* theme tokens.ctx.workspaces face, because that face can only mutate a workspace it is already given — it cannot enumerate them for a plugin page.The JSONL backend's documented layout is:
<root>/
--<normalized-cwd>--/
<session-id>/
session.v4.jsonl.zstd
<root> is resolved from the first candidate that exists and holds project directories:
config.sessionRoot (see below)$DSH_PROFILE_DIR/../../sessions$DSH_PROFILE_DIR/sessions$DSH_HOME/sessions~/.dsh/sessionsA session is matched by its own directory name, and the directory must contain session*.jsonl[.zstd].
- id: workspace-cleaner
name: dsh-workspace-cleaner
config:
sessionRoot: 'D:\somewhere\session-logs' # optional override
| Field | Default | Meaning |
|---|---|---|
sessionRoot |
auto-discovered | Absolute path of the JSONL session-log root |
ctx.agents.get(id)) is refused with 409 session/live.unmaterialized / alreadyDeleted instead of a failure..., no separators) before any path is built.<dsh-home>/session-trash) so the backend never scans it.No build step: plain ESM, plain browser module.
node .verify-host.mjs # Host route + real filesystem (delete/restore/purge) — 58 checks
node .verify-client.mjs # both slot components under a tiny hook renderer — 67 checks
MIT
CLASSIFICATION EVIDENCE
系统优先读取 GitHub Topics,再与站内分类词典和词根规则比对。当前命中: session-management。