DeepSeek Harness Plugin

wojiao42/dsh-space-optimizer

Stars ★ 0 Category Sessions & Messages Added 2026-10-16

Per-task disk-space ledger in the sidebar with opt-in reclamation of unowned junk; session logs are never trimmed.

Install

# from GitHub (first run asks for allowBuilds approval — follow the hint, retry)

dsh plugin --profile web add github:wojiao42/dsh-space-optimizer

Any plugin you install runs third-party code with your own permissions — it can read your files, use your credentials, and reach the network, and tool approvals don’t sandbox it. GitHub-sourced plugins also run build scripts at install time — pnpm blocks those until you allow them, so an install can stop with ERR_PNPM_GIT_DEP_PREPARE_NOT_ALLOWED or ERR_PNPM_IGNORED_BUILDS; dsh prints the exact key to add under allowBuilds in your profile’s pnpm-workspace.yaml, and the install works on the next run. Allowing a build is a trust decision: only install sources you trust, and pin a commit (github:owner/repo#sha).

README

简体中文(完整版) · English (abridged)

This is an abridged English version. The Chinese README is the source of truth; details that change often (design notes, changelog, screenshots) live there.

A sidebar disk-space ledger for DSH: see what every task occupies, what part of it can be optimized, and the unowned junk that belongs to no task. Session logs are never trimmed.

What it does

  • Per-task ledger. One row per session: occupied bytes, current session-log generation, on-disk tool spill, optimizable bytes, and referenced attachments (shared ones counted once).
  • Unowned junk by category. Plugin-market cache, orphaned spill files, stale projection-cache rows, and attachments no session log references.
  • You tick, it deletes. Unowned junk is pre-ticked; task-level items are never pre-ticked. The panel shows selected N · freeable X and posts the reclaim request only after you confirm.
  • Read-only until confirmed. Scanning touches nothing; only explicitly listed targets are deleted. node tools/space-report.mjs [--json] is a read-only ledger that never deletes.

Quick start

GUI (desktop, recommended). Settings (Ctrl+,) → Plugin market → Custom install → enter github:wojiao42/dsh-space-optimizer → restart DSH.

The desktop profile is managed by the app: running dsh plugin --profile desktop add directly may be rejected. If it is, use the GUI step above.

CLI (Web profile).

dsh plugin --profile web add github:wojiao42/dsh-space-optimizer

Refresh the page and click Space at the bottom of the sidebar; the scan takes 1–2 s (~170 ms for 9 tasks). Uninstall: dsh plugin --profile web remove dsh-space-optimizer.

Local source checkout. Use GUI custom install with this repo's absolute path; after editing, restart DSH or reinstall as described in the Chinese README.

Key limits

  • Session logs are never trimmed. They are the canonical state read by usage, context and first-token-latency projections; the ledger only counts them.
  • Only auxiliary artifacts are reclaimable: on-disk tool spill, superseded old-generation logs, and unreferenced attachments.
  • No "delete everything". The reclaim endpoint requires an explicit target list; there is no omit-to-delete form.
  • Conservative by design. If any session log cannot be read, attachment reclamation is skipped for that whole category; a failing newest generation keeps its older generations.
  • Deleted files do not go to the trash and cannot be restored.
  • No network requests. Everything is local filesystem work; results go only to the local page.

Compatibility

  • DSH Desktop and DSH Web (client platform: web).
  • Node: whatever the host DSH runtime provides. The ledger uses the built-in zlib.zstdDecompressSync, the same API the official session-log writer uses; no engines field is set.
  • Temp paths follow os.tmpdir() (%TEMP% on Windows); no OS-specific branches.
  • Offline tests, both must exit 0: node tools/space-optimizer-test.mjs (30 assertions) and node tools/client-panel-test.mjs (37 assertions). node tools/space-report.mjs is a read-only ledger that never deletes.

License

MIT. See LICENSE.

Content from the project README on GitHub ↗

Links

More in this category

View the whole category →

Community comments

Comments are public GitHub Discussions. Loading them connects to GitHub and Giscus; a GitHub account is required to post.