DSH HUB
HomePlugin StorePlugin PacksCommunityRankingsResourcesPublish Guide
Plugin source
Back to catalog

Cnily03 /

Cnily03/dsh-plugin-delete-archived

Verified

Two-step permanent delete for archived DeepSeek Harness sessions.

★ 0 Stars0 Forks0 IssuesN/A Community rating0 Confirmed installs
View on GitHub
READMESource: main@2f9d5f45

Archived Session Delete

简体中文

A DeepSeek Harness (dsh) plugin that permanently deletes archived sessions with a two-step confirm, from the sidebar row hover strip and the "⋯" more-menu. It stops the session's running work and removes its log and projection-cache record from disk.

Screenshots

Hover the delete button Armed, click again to confirm
Delete button on an archived row, tooltip "Delete archived session" Red delete button, tooltip "Permanently delete"

Install

dsh plugin --profile web add dsh-plugin-delete-archived

Installing from source runs tsup and produces dist/index.js (Host) and dist/client.js (Web). Restart the Harness afterwards.

Usage

The control renders only while the row's session is archived, in two places:

  • Hover strip — a trash icon after the archive and pin cells.
  • "⋯" more-menu — a "Delete archived session" row that dismisses the menu on click.

Both reuse the shipped IconTrashOutlineRegular, Tooltip and MenuItemButton, so they match the native controls.

Deleting takes two deliberate clicks:

  • The first click arms the control — it turns red, the label becomes Permanently delete, and it stays armed for 3 seconds.
  • A click while armed deletes the session. After the arm lapses, a click simply re-arms.

A confirmed click POSTs to POST /api/session.archiveDelete, which:

  1. re-checks the archived precondition (409 otherwise);
  2. asks workspace/session-stop to cancel whatever the session still runs;
  3. waits (bounded, 5 s) on the agent's whenIdle() barrier;
  4. flushes buffered events to disk;
  5. removes the session log directory;
  6. clears the workspace accounting, pin and projection-cache rows, then emits api-session/removed.

Archiving vs. deleting

  • Plain archive refuses a session with running work.
  • Stop-and-archive stops the work but does not wait for it, and keeps the files.
  • Neither variant disposes the agent or deletes anything.

Deletion runs its own stop → wait-for-idle → flush → remove sequence, so a session must be archived first.

Runtime limit

A plugin cannot fully dispose an agent another fiber owns, so a just-deleted session whose agent is still live stays in the Host's in-memory session/list until the next restart.

The plugin hides this: the files are already gone, the archive entry stays as the agent/pre-step gate, the response carries agentStillLive: true so the client keeps its optimistic row removal, and a startup sweep drops the stale entry later. A cold session (no live agent) is retired in one step.

Develop

pnpm install
pnpm build        # tsup -> dist/
pnpm typecheck    # tsc --noEmit
pnpm test         # node --test
pnpm format       # biome check --write
Path Purpose
src/index.ts Host half: delete route, stop/idle/flush/remove, cleanup, startup sweep.
src/client.ts Client half: the two-step control, arm timer and overlay notice.
src/locale.ts Namespace, route and message dictionaries.
cordis.patch.yml Bundle patch that inserts the Host row.

License

Copyright (c) Cnily03. All rights reserved.

Licensed under the MIT License.

—/ 5

No ratings yet

Verified DSH bundle

Commit 2f9d5f45dc28

Community comments

No comments yet. Be the first to write one.

DSH HUB

A community index for DSH plugins. Not an official GitHub or DeepSeek AI product.

CommunityResourcesAPIAbout