dsh-web
zhu1090093659/dsh-webDeepSeek Harness(DSH)Web 插件聚合生态包 · 一切皆插件,创意工坊分发(dsh-market.com)
dsh 插件:在原生会话菜单里给已归档的会话加一枚红色「彻底删除」行,不额外做归档面板 / dsh plugin: one red delete row in the native session menu, for archived sessions only
One red Shred session row inside DeepSeek Harness's own session menu, for permanently deleting a session you have already archived.
dsh-shredder is a community plugin for DeepSeek Harness (dsh). It is not an official DeepSeek AI product.
unarchiveSession), but only the current release is measured.desktop / web profiles).Clone this repository somewhere stable, e.g. C:\plugins\dsh-shredder.
In your profile manifest ~/.dsh/profiles/<profile>/package.json, add both entries:
{
"dependencies": { "dsh-shredder": "file:C:/plugins/dsh-shredder" },
"dsh": { "profile": { "bundles": [ /* …existing bundles…, */ "dsh-shredder" ] } }
}
Install with the pnpm that ships with dsh, then restart dsh (bundle composition is resolved at start; a page reload is not enough):
& "<dsh install>\resources\runtime\pnpm\bin\pnpm.cjs" --dir "$HOME\.dsh\profiles\<profile>" add "file:C:/plugins/dsh-shredder"
On the desktop app the profile is desktop. dsh --profile desktop --dump-config is refused there (profile "desktop" is managed exclusively by the Electron application), so verify by restarting and opening a session menu.
Open the "…" menu of an archived session → 彻底删除 / Shred session → click twice.
file: dependencies are installed as a copy, not a link. Deleting the installed copy and running pnpm install (even with --force) does not re-copy it — pnpm answers Already up to date and the plugin silently stops being mounted. Re-declare the dependency instead, and check bytes:
Remove-Item "$HOME\.dsh\profiles\<profile>\node_modules\dsh-shredder" -Recurse -Force
& "<pnpm.cjs>" --dir "$HOME\.dsh\profiles\<profile>" add "file:C:/plugins/dsh-shredder" # must print `Packages: +1`
Then compare lib/*.js between the two trees (sha256), and restart.
Remove the dependencies entry and the dsh.profile.bundles entry, run install again, restart. To stop mounting it without uninstalling, remove only the bundles entry — the bundle layer then never composes. Do not add a user-level - id: shredder / disabled: true line for that: an id that is not in the tree only makes every start print patch: entry "shredder" not found to stderr.
| Half | File | Role |
|---|---|---|
| Host | lib/index.js | one loopback HTTP endpoint |
| Client | lib/client.js | the menu row, injected into sidebar.workspaces.session.menu.item at order: 450 |
| Mount | cordis.patch.yml | bundle-layer insert row (id: shredder) |
| Method | Path | Body | Result |
|---|---|---|---|
| POST | /dsh-shredder/delete | { sessionId } | { ok, action: 'deleted' | 'record-only', … } |
Deletion order is part of correctness:
workspace/session-stop seam (agent turn, jobs, subagents, schedule).flush the live session so buffered events reach disk.WorkspaceEntity.detachSession — drop the workspace membership slot. Archiving keeps the slot on purpose (unarchive restores the position), so deleting the file first would make the session flash back into the workspace list.<session root>/<project>/<id>/.workspaceRegistry.unarchiveSession), which clears the archive record.session/disposed broadcast). It is not guaranteed when the instance was busy at that moment (the host defers the detach) or when the session is not resident in this process at all — in those two cases unarchiving would move a still-displayed row into the ordinary session list, and clicking it would read a deleted log ("session not found"). So the endpoint deletes the file and reports recordHeld: true instead. The browser half then re-pulls the official session list through the client sessions service (refresh() → session.list, whose merge keeps only ids the host still reports, so the vanished row drops out) and only afterwards re-issues the request to clear the record — no reload or restart needed. If that entry point is missing or the re-pull fails, the row simply stays archived; the background pass clears a deferred instance's record within 15 s, and a session resident in no process leaves one invisible dead id behind, which is cheaper than a broken row on screen.absent case. There is no session to dispose, so no event reaches the other tabs; they keep their stale row until they re-pull the list themselves.sessionPersistence.stat() computes a revision that, for pre-current format logs, fingerprints the whole session root (one stat() per session file). Measured on the author's machine: 215 session directories, of which 66 are session.v3.jsonl.zstd and 24 are session.v4.jsonl.zstd — deleting one of those 90 pays a ~215-file walk. Current-format sessions skip it entirely.storages/session_projcache/sessions/ and any content-addressed upload under attachments/ are owned by dsh itself and are not removed here — measured on this machine: after a session directory is gone, the only file still carrying its id is the projection-cache entry.store.store / entry.detach behind a presence probe; if a future host changes that shape the step reports unsupported instead of crashing.MenuItemButton markup (div.itemWrap > button[role=menuitem].item.danger + .itemIcon + .itemLabel) and its design tokens, because dsh-client-ui-primitives is a build-time dependency and is not in the client module table for a plugin to require. If the host restyles its menus, this row needs the same edit.sidebar.workspaces.session.menu.item gives its children { sessionId, displayTitle } plus the standard useWorkspaces snapshot hook (that is where the archive set comes from) and the injected useMenuOpenState. Native rows sit at orders 100/200/300/400.The plugin store has fuller archive managers — @michengai/dsh-archive-manager (a whole Settings page: title and content search, favorites, bulk restore, batch cleanup, log diagnosis), dsh-better-archive (settings section plus a right-sidebar archive tab, built on the host's own Menu / RiskConfirmation), and dsh-archive-manager (sidebar footer panel with agent teardown). They overlap with what this plugin does and go far beyond it. Pick this one only if what you wanted was "the delete option, in the menu, without another page".
node test/delete-endpoint.mjs # host endpoint: response shapes, ghost records, negative control (deletes real temp dirs)
node test/style-injection.mjs # client style-injection contract, four host-materialization scenarios
npm test # both
MIT — see LICENSE.