Pular para o conteúdo principal
J

dsh-quit-delete

jing-qifeng/dsh-quit-delete

Adds the /quit-delete slash command: it stops the current session's running work, waits for the agent to go idle, then permanently deletes the session's stored log and its stored subagent logs on disk, drops pins and leaves the conversation; a bare /quit-delete only opens a confirmation dialog, and nothing is archived.

Instalar

dsh plugin --profile web add github:jing-qifeng/dsh-quit-delete

README

dsh-quit-delete

A DeepSeek Harness plugin that adds the /quit-delete slash command: leave the current session and permanently remove its stored log from disk.

It is not an archive. The session's transcript directory is deleted, so the conversation cannot be restored.

Install

From GitHub (source install, no build step):

dsh plugin --profile web add github:jing-qifeng/dsh-quit-delete

From a local checkout:

dsh plugin --profile web add /path/to/dsh-quit-delete

Use --profile desktop for the desktop profile. Restart the Web UI after the first install so the client half is loaded.

Uninstall:

dsh plugin remove dsh-quit-delete

Usage

  • Type /quit-delete in the composer and press Enter, or pick it from the / menu. The page opens a confirmation dialog. Press Enter on the dialog (or click Delete and quit) to delete; Escape, the mask, or Cancel deletes nothing.
  • /quit-delete confirm (short form /quit-delete con) is the explicit confirmation token. Typing it skips the dialog and runs the deletion directly. This form is also what the browser half sends after you confirm.
  • A bare /quit-delete from a client that did not load this plugin's browser half only returns the risk notice and keeps the draft; it never deletes.

What happens on confirmation

  1. The session's running work is stopped through the shipped workspace/session-stop path, the agent is cancelled if it is not idle, and its terminals are killed.
  2. The plugin waits up to 20 seconds for the agent to reach idle. If it does not, the session is left intact and the command returns an error.
  3. The session log is flushed once, so pending writes are not lost behind the delete.
  4. Every target directory is resolved from each session header's own cwd: the session itself plus its stored subagent descendants.
  5. Each directory is removed with a path check that refuses anything outside the session-persistence root.
  6. Pins are dropped, and the session id is written into the Workspace archive set as an in-process tombstone (see Limitations).
  7. api-session/removed is emitted, so connected Web clients drop the row and leave the conversation immediately.

What is not deleted

  • Attachments under $DSH_HOME/attachments/ are content-addressed and may be shared with other sessions, so they are kept.
  • The derived projection cache and search index are not touched; they are rebuilt or reconciled from the persistence list.

Limitations

  • The Harness keeps ordinary live agents until the Host process exits, and the Web composition does not hand a plugin an AgentHandle to dispose of one. The archive-set tombstone therefore keeps the deleted session from coming back as an ordinary sidebar row after a page reload; after the Host exits the id no longer corresponds to any stored session.
  • Deletion is not dry-run and has no recycle bin.
  • The browser half is loaded with the page. A page that was already connected before an update gets the new client module through the Host's client HMR; a page that was not connected needs one reload.

Development

node --check index.js
node --check client.js
node test/host-delete.test.mjs    # deletes only in a temp directory
node test/client-wiring.test.mjs  # dialog wiring, failure notice, leave action

License

MIT

Plugins relacionados