Back to home@Triple3h

dsh-session-enhance

DSH Web plugin: session sidebar enhancements — copy session ID from the context menu, etc. DSH Web 插件:会话栏增强(上下文菜单一键复制会话 ID 等)。

Stars
0
Language
JavaScript
Created
Aug 19, 2026
Updated
Aug 23, 2026
GitHub repo

Introduction

dsh-session-enhance

English | 中文

GitHub stars GitHub license

A DeepSeek Harness (dsh) Web plugin that enhances the session sidebar — currently: copy the session ID with one click.

What you get

Copy session ID — a Copy session ID entry is appended to the context menu of the left session list (next to rename / fork / archive). Click it to write that session's full sessionId to the clipboard, with a brief "Copied!" feedback.

How it works:

  • Gets the session list via ctx.sessions.list.getSnapshot(), matching row elements to session IDs by title.
  • Listens for the "…" button click in the capture phase to record the current row's session ID in advance.
  • Uses a MutationObserver to detect the menu portal entering the DOM, then clones an existing menu item's structure to append the Copy session ID button.
  • Prefers navigator.clipboard.writeText, falling back to execCommand('copy').

Install (link, development)

npm install        # installs esbuild (devDependency, build only)
npm run build      # src/client.js → lib/client.js
npm run link-profile

link-profile adds a link: dependency, appends to dsh.profile.bundles, and runs pnpm install in the profile. Then restart dsh web (by convention, no auto-restart).

Directory layout

src/client.js        # browser source (hand-written ModuleLoader format; the client logic lives here)
lib/index.js         # host-side empty apply (host plugin logic goes here; see dsh-image-read)
lib/client.js        # browser build output (npm run build)
package.json         # three essentials: dsh.bundle.patch + dsh.client declaration + exports["./client"]
cordis.patch.yml     # bundle patch: inserts into the profile plugin tree
build.mjs            # build script (esbuild)
link-profile.mjs     # link install script

Development notes

  • Project-level skill dsh-plugin-dev: SKILL.md + references/ (manifest three essentials, client half, paste/reference chain, pnpm pitfalls).
  • Reference implementations: dsh-text-collapse (complete client plugin template), dsh-image-read (host tool plugin), ~/.dsh/profiles/web/node_modules/dsh-chat-timeline (hand-written client bundle).
  • Authoritative source for DSH internal APIs: /opt/homebrew/lib/node_modules/@deepseek-ai/dsh/ (installed version).

License

MIT