# dsh-more-session-operations [English](./README.en.md) | [中文](./README.md) A DeepSeek Harness Web plugin that enhances the sidebar session-row "…" menu. GitHub: - [Changelog](./CHANGELOG.md) - [Release Guide](./RELEASING.md) ## Features - **Mark unread** Adds "Mark unread" (small eye icon) above "Copy session ID". Clicking it reuses the official "finished but not yet opened" green reminder dot. Opening/selecting the session clears it automatically, so there is no manual "Mark read" action. Like the official completion reminder, the flag is session-runtime state and is not persisted separately. - **Copy session ID** Adds "Copy session ID" to the session-row menu. Clicking it writes the session ID to the clipboard and briefly shows "Copied". - **Delete session** Adds "Delete session" to the session-row menu. Clicking it opens a confirmation dialog; after confirmation it calls the host endpoint `POST /__dsh-more-session-operations/delete` to physically delete the session. The host stops a running agent, flushes and detaches the session, removes the log directory, projection cache and workspace accounting, and **recursively deletes all descendant subagent sessions** (ordinary fork children are kept). - **Archive confirmation** Intercepts the official "Archive session" menu item and asks for confirmation before calling the official archive service. - **Same-origin protection** The delete endpoint validates `Origin` / `Sec-Fetch-Site` and rejects cross-origin browser requests. ## Installation Local development / runtime injection: ```bash npm run build # sync src/ to lib/ # In a web session with dsh-super-injector loaded: # dev_inject_plugin {"dir": ""} ``` Packaging / install: ```bash npm pack # prepack automatically builds lib/ # Then install with: dsh plugin --profile web add ``` ## Project Layout ``` src/index.js Host source: registers the delete endpoint src/client.js Client source: DOM menu injection, archive interception, confirm dialogs lib/ Build output (copied from src/ by scripts/build.mjs) scripts/ Build script and read-only smoke tests cordis.patch.yml Plugin row insertion config ``` ## Technical Notes - The host delete chain is adapted from [lsz-asd/dsh-plugin-session-delete](https://github.com/lsz-asd/dsh-plugin-session-delete) and keeps only the HTTP endpoint. - The client uses the proven `MutationObserver + [role=menu] + sessionRow.menuOpen` DOM injection approach. - The confirmation dialog is a self-contained plain-DOM overlay using the same DSH theme tokens and the official Menu dimensions (40px item height, 14px text), so the no-build client bundle does not depend on the client module table for React or UI primitives. - Chinese and English copy live in `src/client.js` (`zhDict` / `enDict`); the active UI language is used when the locale service is available, with browser-language fallback. ## License MIT