dsh-deepseek-sidebar
DeepSeek web chat inside the DeepSeek Harness sidebar.
One row in the left sidebar opens the free web chat (chat.deepseek.com) in the right pane,
keeps it alive while you keep working in the conversation, expands to fullscreen on demand,
and — with the helper script below — stops asking you to log in on every restart.
English | 中文
What you get
| Action | Result |
|---|---|
| Click the DeepSeek row in the left sidebar | The right sidebar opens with a DeepSeek tab; the conversation stays untouched |
| Click Fullscreen in the tab toolbar | The chat takes over the main area |
| Click Dock to sidebar in the fullscreen toolbar | Back into the right pane |
| Restart DSH | The chat is still signed in (see persistent login) |
The webview reuses the sidebar browser partition (persist:zcodebrowseruse), i.e. the same
cookie jar as the built-in sidebar browser — no second account, no token juggling.
Requirements
- DeepSeek Harness desktop (Electron) whose UI exposes the
sidebar.panellist,main,sidebarRightTabsandsidebar.right.pane.tabseats. - Node.js 20+ (DSH ships its own; nothing extra to install).
- Windows only for
tools/apply-persist-patch.ps1; the plugin itself is platform-neutral.
Install
The plugin is a plain DSH bundle: package.json + host half (index.js) + client half
(client.js) + cordis.patch.yml.
Manual (works on every build)
In
<profile>/package.jsonadd the dependency and the bundle entry:{ "dependencies": { "dsh-deepseek-sidebar": "link:E:/path/to/dsh-deepseek-sidebar" }, "dsh": { "profile": { "bundles": ["dsh-deepseek-sidebar"] } } }Write it as UTF-8 without BOM — the host JSON-parses it, and a BOM silently drops the whole profile.
Create the junction so the loader can resolve the package:
mklink /J "<profile>\node_modules\dsh-deepseek-sidebar" "E:\path\to\dsh-deepseek-sidebar"Fully restart the app. Client bundles are resolved at boot — a page refresh is not enough.
Managed
dsh plugin --profile <profile> add github:<owner>/dsh-deepseek-sidebar
Use it when your build accepts third-party bundles for that profile; otherwise stick to the manual step above.
Persistent login (one-time patch)
Out of the box DSH builds every sidebar webview session on a random, memory-only partition, so cookies die with the process and every launch asks you to sign in again. A plugin cannot override that: the main process rejects any guest whose partition differs from the one it issued.
tools/apply-persist-patch.ps1 rewrites the single statement that decides it:
pwsh -File tools\apply-persist-patch.ps1 # apply (idempotent, keeps app.asar.orig-bak)
pwsh -File tools\apply-persist-patch.ps1 -Check # report only
pwsh -File tools\apply-persist-patch.ps1 -Restore # roll back
| before | a 50-byte template producing dsh-sidebar-browser-<uuid> (no persist: prefix) |
| after | partition="persist:"+workspace.replace(/\W/g,""); (same 50 bytes) |
A DSH upgrade replaces app.asar, so re-run the script after every upgrade; otherwise the
login starts disappearing again. The patch is equal-length and applied in place, so no header,
offset or integrity field is invalidated, and it is idempotent — running it twice is harmless.
How it works
left sidebar row (sidebar.panellist, id "deepseek-chat")
click -> ctx.layout.selectPanel("deepseek-chat") (hard-coded in ui-sidebar.js)
our shadow method intercepts the id
-> sidebarRight.openTab("deepseek-chat") right-pane tab
-> expand the right column if collapsed
the main area keeps the conversation (nothing remounts)
right-pane tab (kind "deepseek-chat", id "dsh-deepseek-sidebar/chat", keepMounted)
body = ChatBody(mode="tab") webview on partition persist:zcodebrowseruse
toolbar: back / forward / reload / home / fullscreen
fullscreen -> main key "deepseek-chat-full" = ChatBody(mode="full")
Why the obvious alternative — registering a main entry that opens the tab and returns to
the conversation — cannot work is documented with the exact call sites in
docs/architecture.md. Short version: selectPanel(id) replaces the
conversation, the right-pane surface is mounted under the conversation, so it is already
gone when the redirect runs (sidebarRight: no session surface is mounted).
Diagnostics
The desktop shell runs on a dsh-app:// origin and its renderer console is unreachable from
outside, so the host half exposes a same-origin route:
| Method | Path | Purpose |
|---|---|---|
| GET | /deepseek-sidebar/report |
collected entries (?clear=1 resets) |
| POST | /deepseek-sidebar/report |
client batches { source, entries } |
Entries are also appended to %TEMP%\dsh-deepseek-sidebar\diag.log (override with
DSH_DEEPSEEK_SIDEBAR_LOG). Events worth reading: patch:layout, patch:intercept,
openTab:ok|error, toSidebar:result, guest:acquired|did-finish-load.
Limitations
- Without a
sidebarRightservice the row still opens the fullscreen page; the tab is simply never placed. keepMounted: truekeeps the tab webview alive while the fullscreen one is created, so two webviews can coexist for a moment. EachChatBodyowns its own guest lease for that reason.- DSH's own platform login cannot be reused by the web chat: that credential is scoped to the account origin and wiped on close. The sidebar partition is the only reusable session.
Uninstall
Drop the package from the profile dependencies and dsh.profile.bundles, delete the
junction, restart. Run the patch script with -Restore if you also want the archive pristine.
License
MIT — see LICENSE.
No comments yet. Be the first to write one.