READMESource: master@0a6543f2
dsh-session-enhance
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
MutationObserverto 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 toexecCommand('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
No comments yet. Be the first to write one.