# dsh-session-context-menu
English | [中文](README.zh.md)
Lifecycle-safe, Codex-style Session context actions for [DeepSeek Harness](https://github.com/deepseek-ai/deepseek-harness). It extends the official Session-row registry and accessory Slot; it does not patch installed packages, inspect React Fiber, query private DOM, or replace the Workspace browser.
## Actions
- Pin or unpin a chat. Pinned rows lead while preserving their existing relative order.
- Mark a chat read or unread, with an accessible row indicator.
- Show the Workspace directory with DSH's native path opener.
- Copy the working directory, Session id, or a browser deep link.
- Open the deep link in a new browser window.
- Use DSH's built-in Rename, Fork, and Archive actions in the same menu.
The ellipsis button, native right click, Shift+F10, and the Menu key all open one shared action model. Deep links use `?session=` and are resolved only after the Session list contains that id.
## Compatibility
| DSH version | Status |
|---|---|
| `0.1.0-rc.6` | Unsupported: no official Session-row extension point |
| `0.1.0-rc.7` | Unsupported without the upstream `sessionRows` change |
| Upstream with `ctx.sessionRows` and `sidebar.workspaces.session.accessory` | Supported |
The plugin intentionally refuses to load when the required service is absent. This avoids silently falling back to private UI attachment.
## Install
After the compatible upstream release and this repository's first public release:
```sh
dsh plugin --profile web add github:Harzva/dsh-session-context-menu
```
For isolated local development:
```sh
DSH_HOME=/path/to/throwaway-dsh-home dsh plugin --profile web add /absolute/path/to/dsh-session-context-menu
DSH_HOME=/path/to/throwaway-dsh-home dsh web
```
Do not point development commands at a production profile. Removing the dependency cleanly removes the Host route, registry actions, accessory component, and deep-link listener:
```sh
dsh plugin --profile web remove dsh-session-context-menu
```
## Persistence and privacy
Pin/read state is stored as boolean-only JSON under `$DSH_HOME/storages/dsh-session-context-menu/state.json`, or under an explicit `storeRoot` supplied in the Cordis config entry. Writes are serialized and atomically renamed; files are created mode `0600`. Session transcripts, prompts, Workspace paths, credentials, and clipboard contents are never persisted by this plugin.
The Host exposes one same-origin, no-store JSON route at `/dsh-session-context-menu/state`. Request bodies are bounded to 32 KiB and accept only a bounded Session id plus boolean `pinned`/`unread` fields. Native path opening uses DSH's existing `ctx.workspaces.openPath()` capability instead of adding another filesystem endpoint.
## Development
```sh
npm test
npm pack --dry-run
```
The test suite covers state validation, concurrent atomic persistence, Cordis route disposal, client contribution registration, priority, deep-link opening, clipboard actions, native path delegation, and client cleanup. Release validation additionally uses a throwaway DSH profile for install, cold-start, light/dark visual checks, right-click/keyboard interaction, unload, and rollback.
## Marketplace submission
The [awesome-dsh-plugin](https://github.com/awesome-dsh-plugin/awesome-dsh-plugin) catalog currently requires an installable `dsh.bundle`, the `dsh-plugin` topic, a repository at least one day old, and at least ten commits. This repository keeps those requirements in its release checklist; the catalog entry is submitted only after the upstream extension ships and the isolated composition passes.
## License
[MIT](LICENSE)